i_stream_create_dot:
  230|  1.55k|{
  231|  1.55k|	struct dot_istream *dstream;
  232|       |
  233|  1.55k|	dstream = i_new(struct dot_istream, 1);
  ------------------
  |  |    8|  1.55k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  1.55k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  1.55k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  1.55k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  1.55k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  1.55k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  234|  1.55k|	dstream->istream.max_buffer_size = input->real_stream->max_buffer_size;
  235|  1.55k|	dstream->istream.read = i_stream_dot_read;
  236|       |
  237|  1.55k|	dstream->istream.istream.readable_fd = FALSE;
  ------------------
  |  |   11|  1.55k|#  define FALSE (!1)
  ------------------
  238|  1.55k|	dstream->istream.istream.blocking = input->blocking;
  239|  1.55k|	dstream->istream.istream.seekable = FALSE;
  ------------------
  |  |   11|  1.55k|#  define FALSE (!1)
  ------------------
  240|  1.55k|	dstream->send_last_lf = HAS_NO_BITS(flags, ISTREAM_DOT_TRIM_TRAIL);
  ------------------
  |  |   12|  1.55k|#define HAS_NO_BITS(val,bits) (((val) & (bits)) == 0)
  ------------------
  241|  1.55k|	dstream->accept_bare_lf = HAS_ANY_BITS(flags, ISTREAM_DOT_LOOSE_EOT);
  ------------------
  |  |   16|  1.55k|#define HAS_ANY_BITS(val,bits) (((val) & (bits)) != 0)
  ------------------
  242|  1.55k|	dstream->state = DOT_STATE_SEEN_CR_LF;
  243|  1.55k|	dstream->state_no_cr = TRUE;
  ------------------
  |  |   15|  1.55k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  1.55k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  244|  1.55k|	dstream->state_no_lf = TRUE;
  ------------------
  |  |   15|  1.55k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  1.55k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  245|  1.55k|	return i_stream_create(&dstream->istream, input,
  246|  1.55k|			       i_stream_get_fd(input), 0);
  247|  1.55k|}
istream-dot.c:i_stream_dot_read:
  120|  5.56k|{
  121|       |	/* @UNSAFE */
  122|  5.56k|	struct dot_istream *dstream = (struct dot_istream *)stream;
  123|  5.56k|	const unsigned char *data;
  124|  5.56k|	size_t i, dest, size, avail;
  125|  5.56k|	ssize_t ret, ret1;
  126|       |
  127|  5.56k|	if (dstream->pending[0] != '\0') {
  ------------------
  |  Branch (127:6): [True: 86, False: 5.48k]
  ------------------
  128|     86|		if (!i_stream_try_alloc(stream, 1, &avail))
  ------------------
  |  Branch (128:7): [True: 0, False: 86]
  ------------------
  129|      0|			return -2;
  130|     86|		dest = stream->pos;
  131|     86|		(void)flush_pending(dstream, &dest);
  132|  5.48k|	} else {
  133|  5.48k|		dest = stream->pos;
  134|  5.48k|	}
  135|       |
  136|  5.56k|	if (dstream->dot_eof) {
  ------------------
  |  Branch (136:6): [True: 1.16k, False: 4.40k]
  ------------------
  137|  1.16k|		stream->istream.eof = TRUE;
  ------------------
  |  |   15|  1.16k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  1.16k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  138|  1.16k|		return i_stream_dot_return(stream, dest, -1);
  139|  1.16k|	}
  140|       |
  141|       |	/* we have to update stream->pos before reading more data */
  142|  4.40k|	ret1 = i_stream_dot_return(stream, dest, 0);
  143|  4.40k|	if ((ret = i_stream_dot_read_some(dstream)) <= 0) {
  ------------------
  |  Branch (143:6): [True: 472, False: 3.93k]
  ------------------
  144|    472|		if (stream->istream.stream_errno != 0)
  ------------------
  |  Branch (144:7): [True: 391, False: 81]
  ------------------
  145|    391|			return -1;
  146|     81|		if (ret1 != 0)
  ------------------
  |  Branch (146:7): [True: 0, False: 81]
  ------------------
  147|      0|			return ret1;
  148|     81|		dest = stream->pos;
  149|     81|		if (ret == -1 && dstream->state != DOT_STATE_SEEN_NONE)
  ------------------
  |  Branch (149:7): [True: 0, False: 81]
  |  Branch (149:20): [True: 0, False: 0]
  ------------------
  150|      0|			(void)flush_dot_state(dstream, &dest);
  151|     81|		return i_stream_dot_return(stream, dest, ret);
  152|     81|	}
  153|  3.93k|	dest = stream->pos;
  154|       |
  155|  3.93k|	data = i_stream_get_data(stream->parent, &size);
  156|  13.8M|	for (i = 0; i < size && dest < stream->buffer_size; i++) {
  ------------------
  |  Branch (156:14): [True: 13.8M, False: 2.06k]
  |  Branch (156:26): [True: 13.8M, False: 126]
  ------------------
  157|  13.8M|		switch (dstream->state) {
  ------------------
  |  Branch (157:11): [True: 0, False: 13.8M]
  ------------------
  158|  7.85M|		case DOT_STATE_SEEN_NONE:
  ------------------
  |  Branch (158:3): [True: 7.85M, False: 5.99M]
  ------------------
  159|  7.85M|			break;
  160|  4.76M|		case DOT_STATE_SEEN_CR:
  ------------------
  |  Branch (160:3): [True: 4.76M, False: 9.08M]
  ------------------
  161|       |			/* CR seen */
  162|  4.76M|			if (data[i] == '\n')
  ------------------
  |  Branch (162:8): [True: 1.22M, False: 3.53M]
  ------------------
  163|  1.22M|				dstream->state = DOT_STATE_SEEN_CR_LF;
  164|  3.53M|			else {
  165|  3.53M|				if (!flush_dot_state(dstream, &dest))
  ------------------
  |  Branch (165:9): [True: 365, False: 3.53M]
  ------------------
  166|    365|					goto end;
  167|  3.53M|			}
  168|  4.76M|			break;
  169|  4.76M|		case DOT_STATE_SEEN_CR_LF:
  ------------------
  |  Branch (169:3): [True: 1.22M, False: 12.6M]
  ------------------
  170|       |			/* [CR]LF seen */
  171|  1.22M|			if (data[i] == '.')
  ------------------
  |  Branch (171:8): [True: 4.75k, False: 1.22M]
  ------------------
  172|  4.75k|				dstream->state = DOT_STATE_SEEN_CR_LF_DOT;
  173|  1.22M|			else {
  174|  1.22M|				if (!flush_dot_state(dstream, &dest))
  ------------------
  |  Branch (174:9): [True: 207, False: 1.22M]
  ------------------
  175|    207|					goto end;
  176|  1.22M|			}
  177|  1.22M|			break;
  178|  1.22M|		case DOT_STATE_SEEN_CR_LF_DOT:
  ------------------
  |  Branch (178:3): [True: 4.74k, False: 13.8M]
  ------------------
  179|       |			/* [CR]LF. seen */
  180|  4.74k|			if (data[i] == '\r')
  ------------------
  |  Branch (180:8): [True: 2.97k, False: 1.77k]
  ------------------
  181|  2.97k|				dstream->state = DOT_STATE_SEEN_CR_LF_DOT_CR;
  182|  1.77k|			else if (data[i] == '\n' && dstream->accept_bare_lf) {
  ------------------
  |  Branch (182:13): [True: 431, False: 1.34k]
  |  Branch (182:32): [True: 0, False: 431]
  ------------------
  183|       |				/* EOF */
  184|      0|				i_stream_dot_eof(dstream, &dest);
  185|      0|				i++;
  186|      0|				goto end;
  187|  1.77k|			} else {
  188|       |				/* drop the initial dot */
  189|  1.77k|				if (!flush_dot_state(dstream, &dest))
  ------------------
  |  Branch (189:9): [True: 16, False: 1.75k]
  ------------------
  190|     16|					goto end;
  191|  1.77k|			}
  192|  4.72k|			break;
  193|  4.72k|		case DOT_STATE_SEEN_CR_LF_DOT_CR:
  ------------------
  |  Branch (193:3): [True: 2.96k, False: 13.8M]
  ------------------
  194|       |			/* [CR]LF.CR seen */
  195|  2.96k|			if (data[i] == '\n') {
  ------------------
  |  Branch (195:8): [True: 1.16k, False: 1.80k]
  ------------------
  196|       |				/* EOF */
  197|  1.16k|				i_stream_dot_eof(dstream, &dest);
  198|  1.16k|				i++;
  199|  1.16k|				goto end;
  200|  1.80k|			} else {
  201|       |				/* drop the initial dot */
  202|  1.80k|				if (!flush_dot_state(dstream, &dest))
  ------------------
  |  Branch (202:9): [True: 1, False: 1.80k]
  ------------------
  203|      1|					goto end;
  204|  1.80k|			}
  205|  13.8M|		}
  206|  13.8M|		if (dstream->state == DOT_STATE_SEEN_NONE) {
  ------------------
  |  Branch (206:7): [True: 12.6M, False: 1.23M]
  ------------------
  207|  12.6M|			if (data[i] == '\r') {
  ------------------
  |  Branch (207:8): [True: 4.75M, False: 7.85M]
  ------------------
  208|  4.75M|				dstream->state = DOT_STATE_SEEN_CR;
  209|  4.75M|				dstream->state_no_cr = FALSE;
  ------------------
  |  |   11|  4.75M|#  define FALSE (!1)
  ------------------
  210|  7.85M|			} else if (data[i] == '\n' && dstream->accept_bare_lf) {
  ------------------
  |  Branch (210:15): [True: 222k, False: 7.63M]
  |  Branch (210:34): [True: 0, False: 222k]
  ------------------
  211|      0|				dstream->state = DOT_STATE_SEEN_CR_LF;
  212|      0|				dstream->state_no_cr = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  213|  7.85M|			} else {
  214|  7.85M|				stream->w_buffer[dest++] = data[i];
  215|  7.85M|			}
  216|  12.6M|		}
  217|  13.8M|	}
  218|  3.93k|end:
  219|  3.93k|	i_stream_skip(stream->parent, i);
  220|       |
  221|  3.93k|	ret = i_stream_dot_return(stream, dest, 0) + ret1;
  222|  3.93k|	if (ret == 0)
  ------------------
  |  Branch (222:6): [True: 1.06k, False: 2.86k]
  ------------------
  223|  1.06k|		return i_stream_dot_read(stream);
  224|  3.93k|	i_assert(ret > 0);
  ------------------
  |  |  219|  2.86k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  2.86k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  2.86k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  2.86k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 2.86k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 2.86k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  2.86k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  3.93k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  3.93k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  225|  2.86k|	return ret;
  226|  2.86k|}
istream-dot.c:flush_pending:
   65|  4.76M|{
   66|  4.76M|	struct istream_private *stream = &dstream->istream;
   67|  4.76M|	size_t dest = *destp;
   68|  4.76M|	unsigned int i = 0;
   69|       |
   70|  10.7M|	for (; dstream->pending[i] != '\0' && dest < stream->buffer_size; i++)
  ------------------
  |  Branch (70:9): [True: 5.98M, False: 4.76M]
  |  Branch (70:40): [True: 5.98M, False: 86]
  ------------------
   71|  5.98M|		stream->w_buffer[dest++] = dstream->pending[i];
   72|  4.76M|	memmove(dstream->pending, dstream->pending + i,
   73|  4.76M|		sizeof(dstream->pending) - i);
   74|  4.76M|	*destp = dest;
   75|  4.76M|	return dest < stream->buffer_size;
   76|  4.76M|}
istream-dot.c:i_stream_dot_return:
  110|  9.58k|{
  111|  9.58k|	if (dest != stream->pos) {
  ------------------
  |  Branch (111:6): [True: 2.87k, False: 6.71k]
  ------------------
  112|  2.87k|		i_assert(dest > stream->pos);
  ------------------
  |  |  219|  2.87k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  2.87k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  2.87k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  2.87k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 2.87k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 2.87k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  2.87k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  2.87k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  2.87k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  113|  2.87k|		ret = dest - stream->pos;
  114|  2.87k|		stream->pos = dest;
  115|  2.87k|	}
  116|  9.58k|	return ret;
  117|  9.58k|}
istream-dot.c:i_stream_dot_read_some:
   34|  4.40k|{
   35|  4.40k|	struct istream_private *stream = &dstream->istream;
   36|  4.40k|	size_t size, avail;
   37|  4.40k|	ssize_t ret;
   38|       |
   39|  4.40k|	size = i_stream_get_data_size(stream->parent);
   40|  4.40k|	if (size == 0) {
  ------------------
  |  Branch (40:6): [True: 2.16k, False: 2.24k]
  ------------------
   41|  2.16k|		ret = i_stream_read_memarea(stream->parent);
   42|  2.16k|		if (ret <= 0) {
  ------------------
  |  Branch (42:7): [True: 472, False: 1.69k]
  ------------------
   43|    472|			i_assert(ret != -2); /* 0 sized buffer can't be full */
  ------------------
  |  |  219|    472|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    472|#  define STMT_START do
  |  |  ------------------
  |  |  220|    472|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    472|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 472]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 472]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    472|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    472|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    472|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   44|    472|			if (stream->parent->stream_errno != 0) {
  ------------------
  |  Branch (44:8): [True: 0, False: 472]
  ------------------
   45|      0|				stream->istream.stream_errno =
   46|      0|					stream->parent->stream_errno;
   47|    472|			} else if (ret < 0 && stream->parent->eof) {
  ------------------
  |  Branch (47:15): [True: 391, False: 81]
  |  Branch (47:26): [True: 391, False: 0]
  ------------------
   48|       |				/* we didn't see "." line */
   49|    391|				io_stream_set_error(&stream->iostream,
   50|    391|					"dot-input stream ends without '.' line");
   51|    391|				stream->istream.stream_errno = EPIPE;
   52|    391|			}
   53|    472|			return ret;
   54|    472|		}
   55|  1.69k|		size = i_stream_get_data_size(stream->parent);
   56|  1.69k|		i_assert(size != 0);
  ------------------
  |  |  219|  1.69k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  1.69k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  1.69k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  1.69k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1.69k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1.69k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  1.69k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  1.69k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.69k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   57|  1.69k|	}
   58|       |
   59|  3.93k|	if (!i_stream_try_alloc(stream, size, &avail))
  ------------------
  |  Branch (59:6): [True: 0, False: 3.93k]
  ------------------
   60|      0|		return -2;
   61|  3.93k|	return 1;
   62|  3.93k|}
istream-dot.c:flush_dot_state:
   79|  4.76M|{
   80|  4.76M|	unsigned int i = 0;
   81|       |
   82|  4.76M|	if (!dstream->state_no_cr)
  ------------------
  |  Branch (82:6): [True: 4.75M, False: 2.65k]
  ------------------
   83|  4.75M|		dstream->pending[i++] = '\r';
   84|  4.76M|	if (dstream->state_no_lf)
  ------------------
  |  Branch (84:6): [True: 1.51k, False: 4.76M]
  ------------------
   85|  1.51k|		dstream->state_no_lf = FALSE;
  ------------------
  |  |   11|  1.51k|#  define FALSE (!1)
  ------------------
   86|  4.76M|	else if (dstream->state > DOT_STATE_SEEN_CR)
  ------------------
  |  Branch (86:11): [True: 1.22M, False: 3.53M]
  ------------------
   87|  1.22M|		dstream->pending[i++] = '\n';
   88|  4.76M|	dstream->pending[i] = '\0';
   89|       |
   90|  4.76M|	if (dstream->state != DOT_STATE_SEEN_CR_LF_DOT_CR)
  ------------------
  |  Branch (90:6): [True: 4.76M, False: 1.80k]
  ------------------
   91|  4.76M|		dstream->state = DOT_STATE_SEEN_NONE;
   92|  1.80k|	else {
   93|       |		/* \r\n.\r seen, go back to \r state */
   94|  1.80k|		dstream->state = DOT_STATE_SEEN_CR;
   95|  1.80k|	}
   96|  4.76M|	return flush_pending(dstream, destp);
   97|  4.76M|}
istream-dot.c:i_stream_dot_eof:
  100|  1.16k|{
  101|  1.16k|	if (dstream->send_last_lf) {
  ------------------
  |  Branch (101:6): [True: 1.16k, False: 0]
  ------------------
  102|  1.16k|		dstream->state = DOT_STATE_SEEN_CR_LF;
  103|  1.16k|		(void)flush_dot_state(dstream, destp);
  104|  1.16k|	}
  105|  1.16k|	dstream->dot_eof = TRUE;
  ------------------
  |  |   15|  1.16k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  1.16k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  106|  1.16k|}

LLVMFuzzerTestOneInput:
   73|  12.4k|FUZZ_BEGIN_FD
  ------------------
  |  |   27|  6.21k|	FUZZ_BEGIN_DATA(const uint8_t *_param_data, size_t _param_size) \
  |  |  ------------------
  |  |  |  |   15|  6.21k|	int LLVMFuzzerTestOneInput(data_arg, size_arg) { \
  |  |  |  |   16|  6.21k|		struct fuzzer_context fuzz_ctx; \
  |  |  |  |   17|  6.21k|		fuzzer_init(&fuzz_ctx); T_BEGIN {
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   69|  6.21k|		data_stack_frame_t _data_stack_cur_id = t_push(__FILE__ ":" T_XSTRING(__LINE__));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  6.21k|#define T_XSTRING(x)	T_STRING(x)	/* expand and then stringify */
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|  6.21k|#define T_STRING(x)	#x
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   28|  6.21k|	fuzz_ctx.ioloop = io_loop_create(); \
  |  |   29|  6.21k|	(void)fuzzer_io_as_fd(&fuzz_ctx, _param_data, _param_size);
  ------------------
   74|  12.4k|{
   75|  12.4k|	struct smtp_server_connection *conn;
   76|  12.4k|	struct smtp_server_settings smtp_server_set = {
   77|  12.4k|		.max_client_idle_time_msecs = 500,
   78|  12.4k|		.max_pipelined_commands = 16,
   79|  12.4k|		.auth_optional = TRUE,
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   80|  12.4k|	};
   81|  12.4k|	struct smtp_server_callbacks server_callbacks = {
   82|  12.4k|		.conn_cmd_rcpt = server_cmd_rcpt,
   83|  12.4k|		.conn_cmd_data_begin =  server_cmd_data_begin,
   84|  12.4k|		.conn_cmd_data_continue = server_cmd_data_continue,
   85|  12.4k|		.conn_free = server_connection_free,
   86|  12.4k|	};
   87|  12.4k|	struct smtp_server *smtp_server = NULL;
   88|  12.4k|	struct timeout *to;
   89|       |
   90|  12.4k|	to = timeout_add_short(10, test_server_continue, &fuzz_ctx);
  ------------------
  |  |  145|  6.21k|	timeout_add_short(msecs, __FILE__, __LINE__ - \
  |  |  146|  6.21k|		CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
  |  |  ------------------
  |  |  |  |  171|  6.21k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  6.21k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  147|  6.21k|		(io_callback_t *)callback, context)
  ------------------
   91|  12.4k|	smtp_server = smtp_server_init(&smtp_server_set);
   92|       |
   93|  12.4k|	conn = smtp_server_connection_create(smtp_server, fuzz_ctx.fd, fuzz_ctx.fd, NULL, 0,
   94|  12.4k|					     FALSE, NULL, &server_callbacks, &fuzz_ctx);
  ------------------
  |  |   11|  6.21k|#  define FALSE (!1)
  ------------------
   95|  12.4k|	smtp_server_connection_start(conn);
   96|       |
   97|  12.4k|	io_loop_run(fuzz_ctx.ioloop);
   98|       |
   99|  12.4k|	smtp_server_deinit(&smtp_server);
  100|  12.4k|	timeout_remove(&to);
  101|  12.4k|}
  102|  12.4k|FUZZ_END
  ------------------
  |  |   32|  6.21k|	} T_END; fuzzer_deinit(&fuzz_ctx); return 0; }
  |  |  ------------------
  |  |  |  |   71|  6.21k|	STMT_START { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  ------------------
  |  |  |  |   72|  6.21k|		if (unlikely(!t_pop(&_data_stack_cur_id))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   73|  6.21k|			i_panic("Leaked t_pop() call"); \
  |  |  |  |   74|  6.21k|	} STMT_END; \
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   75|  6.21k|	} STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
fuzz-smtp-server.c:server_cmd_rcpt:
   19|  12.1k|{
   20|  12.1k|	return 1;
   21|  12.1k|}
fuzz-smtp-server.c:server_cmd_data_begin:
   56|  2.20k|{
   57|  2.20k|	state.data_input = data_input;
   58|  2.20k|	return 0;
   59|  2.20k|}
fuzz-smtp-server.c:server_cmd_data_continue:
   27|  11.2k|{
   28|  11.2k|	struct istream *data_input = state.data_input;
   29|  11.2k|	const unsigned char *data;
   30|  11.2k|	size_t size;
   31|  11.2k|	ssize_t ret;
   32|       |
   33|  20.0k|	while ((ret = i_stream_read(data_input)) > 0 || ret == -2) {
  ------------------
  |  Branch (33:9): [True: 8.83k, False: 11.2k]
  |  Branch (33:50): [True: 0, False: 11.2k]
  ------------------
   34|  8.83k|		data = i_stream_get_data(data_input, &size);
   35|  8.83k|		i_stream_skip(data_input, size);
   36|  8.83k|		if (!smtp_server_cmd_data_check_size(cmd))
  ------------------
  |  Branch (36:7): [True: 0, False: 8.83k]
  ------------------
   37|      0|			return -1;
   38|  8.83k|	}
   39|       |
   40|  11.2k|	if (ret == 0)
  ------------------
  |  Branch (40:6): [True: 9.37k, False: 1.85k]
  ------------------
   41|  9.37k|		return 0;
   42|  1.85k|	if (ret < 0 && data_input->stream_errno != 0) {
  ------------------
  |  Branch (42:6): [True: 1.85k, False: 0]
  |  Branch (42:17): [True: 608, False: 1.24k]
  ------------------
   43|       |		/* Client probably disconnected */
   44|    608|		return -1;
   45|    608|	}
   46|       |
   47|  1.24k|	smtp_server_reply_all(cmd, 250, "2.0.0", "Accepted");
   48|  1.24k|	return 1;
   49|  1.85k|}
fuzz-smtp-server.c:server_connection_free:
   62|  6.21k|{
   63|  6.21k|	struct fuzzer_context *ctx = context;
   64|  6.21k|	io_loop_stop(ctx->ioloop);
   65|  6.21k|}
fuzz-smtp-server.c:test_server_continue:
   68|  3.77k|{
   69|       |	//instead of simple io_loop_stop so as to free input io
   70|  3.77k|	io_loop_stop_delayed(ctx->ioloop);
   71|  3.77k|}

smtp_address_parse_path_full:
  388|  35.9k|{
  389|  35.9k|	struct smtp_address_parser aparser;
  390|  35.9k|	int ret;
  391|       |
  392|  35.9k|	if (address_r != NULL)
  ------------------
  |  Branch (392:6): [True: 35.9k, False: 0]
  ------------------
  393|  35.9k|		*address_r = NULL;
  394|  35.9k|	if (error_r != NULL)
  ------------------
  |  Branch (394:6): [True: 35.9k, False: 0]
  ------------------
  395|  35.9k|		*error_r = NULL;
  396|  35.9k|	if (endp_r != NULL)
  ------------------
  |  Branch (396:6): [True: 35.9k, False: 0]
  ------------------
  397|  35.9k|		*endp_r = NULL;
  398|       |
  399|  35.9k|	if (path == NULL || *path == '\0') {
  ------------------
  |  Branch (399:6): [True: 0, False: 35.9k]
  |  Branch (399:22): [True: 886, False: 35.0k]
  ------------------
  400|    886|		if ((flags & SMTP_ADDRESS_PARSE_FLAG_ALLOW_EMPTY) == 0 ||
  ------------------
  |  Branch (400:7): [True: 526, False: 360]
  ------------------
  401|    886|		    (flags & SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL) == 0) {
  ------------------
  |  Branch (401:7): [True: 360, False: 0]
  ------------------
  402|    886|			if (error_r != NULL)
  ------------------
  |  Branch (402:8): [True: 886, False: 0]
  ------------------
  403|    886|				*error_r = "Path is empty string";
  404|    886|			return -1;
  405|    886|		}
  406|      0|		if (address_r != NULL)
  ------------------
  |  Branch (406:7): [True: 0, False: 0]
  ------------------
  407|      0|			*address_r = p_new(pool, struct smtp_address, 1);
  ------------------
  |  |   97|      0|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|      0|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|      0|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  408|      0|		if (endp_r != NULL)
  ------------------
  |  Branch (408:7): [True: 0, False: 0]
  ------------------
  409|      0|			*endp_r = path;
  410|      0|		return 0;
  411|    886|	}
  412|       |
  413|  35.0k|	i_zero(&aparser);
  ------------------
  |  |  249|  35.0k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  35.0k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  35.0k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  414|  35.0k|	smtp_parser_init(&aparser.parser, pool_datastack_create(), path);
  415|  35.0k|	aparser.address_end = (endp_r != NULL ? NULL : aparser.parser.end);
  ------------------
  |  Branch (415:25): [True: 35.0k, False: 0]
  ------------------
  416|  35.0k|	aparser.parse = (address_r != NULL);
  417|       |
  418|  35.0k|	if ((ret = smtp_parse_path(&aparser, flags)) <= 0) {
  ------------------
  |  Branch (418:6): [True: 7.94k, False: 27.1k]
  ------------------
  419|  7.94k|		if (error_r != NULL) {
  ------------------
  |  Branch (419:7): [True: 7.94k, False: 0]
  ------------------
  420|  7.94k|			*error_r = (ret < 0 ? aparser.parser.error :
  ------------------
  |  Branch (420:16): [True: 7.53k, False: 411]
  ------------------
  421|  7.94k|				"Missing '<' at beginning of path");
  422|  7.94k|		}
  423|  7.94k|		ret = -1;
  424|  27.1k|	} else if (endp_r != NULL) {
  ------------------
  |  Branch (424:13): [True: 27.1k, False: 0]
  ------------------
  425|  27.1k|		if (aparser.parser.cur == aparser.parser.end ||
  ------------------
  |  Branch (425:7): [True: 18.1k, False: 8.97k]
  ------------------
  426|  27.1k|		    *aparser.parser.cur == ' ' ||
  ------------------
  |  Branch (426:7): [True: 8.24k, False: 728]
  ------------------
  427|  27.1k|		    HAS_NO_BITS(flags, SMTP_ADDRESS_PARSE_FLAG_IGNORE_BROKEN)) {
  ------------------
  |  |   12|    728|#define HAS_NO_BITS(val,bits) (((val) & (bits)) == 0)
  |  |  ------------------
  |  |  |  Branch (12:31): [True: 728, False: 0]
  |  |  ------------------
  ------------------
  428|  27.1k|			*endp_r = (const char *)aparser.parser.cur;
  429|  27.1k|			ret = 0;
  430|  27.1k|		} else {
  431|      0|			if (error_r != NULL)
  ------------------
  |  Branch (431:8): [True: 0, False: 0]
  ------------------
  432|      0|				*error_r = "Invalid character in path";
  433|      0|			ret = -1;
  434|      0|		}
  435|  27.1k|	} else if (aparser.parser.cur == aparser.parser.end) {
  ------------------
  |  Branch (435:13): [True: 0, False: 0]
  ------------------
  436|      0|		ret = 0;
  437|      0|	} else {
  438|      0|		if (error_r != NULL)
  ------------------
  |  Branch (438:7): [True: 0, False: 0]
  ------------------
  439|      0|			*error_r = "Invalid character in path";
  440|      0|		ret = -1;
  441|      0|	}
  442|       |
  443|  35.0k|	if (ret < 0) {
  ------------------
  |  Branch (443:6): [True: 7.94k, False: 27.1k]
  ------------------
  444|       |		/* normal parsing failed */
  445|  7.94k|		if (smtp_address_parse_path_broken(&aparser, flags,
  ------------------
  |  Branch (445:7): [True: 7.94k, False: 0]
  ------------------
  446|  7.94k|						   endp_r) < 0) {
  447|       |			/* failed to parse it as a broken address as well */
  448|  7.94k|			return -1;
  449|  7.94k|		}
  450|       |		/* broken address */
  451|  27.1k|	} else if (HAS_ALL_BITS(flags, SMTP_ADDRESS_PARSE_FLAG_PRESERVE_RAW) &&
  ------------------
  |  |   18|  54.2k|#define HAS_ALL_BITS(val,bits) ((~(val) & (bits)) == 0)
  |  |  ------------------
  |  |  |  Branch (18:32): [True: 12.9k, False: 14.1k]
  |  |  ------------------
  ------------------
  452|  27.1k|		   aparser.address.localpart != NULL) {
  ------------------
  |  Branch (452:6): [True: 4.14k, False: 8.77k]
  ------------------
  453|  4.14k|		if (aparser.path &&
  ------------------
  |  Branch (453:7): [True: 4.14k, False: 0]
  ------------------
  454|  4.14k|		    ((const unsigned char *)(path + 1) < aparser.parser.cur)) {
  ------------------
  |  Branch (454:7): [True: 4.14k, False: 0]
  ------------------
  455|  4.14k|			aparser.address.raw = t_strdup_until(
  456|  4.14k|				path + 1, aparser.parser.cur - 1);
  457|  4.14k|		} else {
  458|      0|			aparser.address.raw = t_strdup_until(
  459|      0|				path, aparser.parser.cur);
  460|      0|		}
  461|  4.14k|	}
  462|       |
  463|  27.1k|	if (address_r != NULL)
  ------------------
  |  Branch (463:6): [True: 27.1k, False: 0]
  ------------------
  464|  27.1k|		*address_r = smtp_address_clone(pool, &aparser.address);
  465|  27.1k|	return ret;
  466|  35.0k|}
smtp_address_write:
  655|  42.9k|{
  656|  42.9k|	bool quoted = FALSE;
  ------------------
  |  |   11|  42.9k|#  define FALSE (!1)
  ------------------
  657|  42.9k|	const unsigned char *p, *pend, *pblock;
  658|  42.9k|	size_t begin;
  659|       |
  660|  42.9k|	if (smtp_address_isnull(address))
  ------------------
  |  Branch (660:6): [True: 15.5k, False: 27.3k]
  ------------------
  661|  15.5k|		return;
  662|  27.3k|	begin = str_len(out);
  663|       |
  664|       |	/* encode localpart */
  665|  27.3k|	p = (const unsigned char *)address->localpart;
  666|  27.3k|	pend = p + strlen(address->localpart);
  667|  27.3k|	pblock = p;
  668|  93.9k|	while (p < pend) {
  ------------------
  |  Branch (668:9): [True: 82.3k, False: 11.5k]
  ------------------
  669|  2.68M|		while (p < pend && smtp_char_is_atext(*p))
  ------------------
  |  Branch (669:10): [True: 2.67M, False: 15.8k]
  |  Branch (669:22): [True: 2.60M, False: 66.5k]
  ------------------
  670|  2.60M|			p++;
  671|       |
  672|  82.3k|		if (!quoted && p < pend && (*p != '.' || p == pblock)) {
  ------------------
  |  Branch (672:7): [True: 24.4k, False: 57.9k]
  |  Branch (672:18): [True: 10.3k, False: 14.0k]
  |  Branch (672:31): [True: 2.41k, False: 7.96k]
  |  Branch (672:44): [True: 2.90k, False: 5.05k]
  ------------------
  673|  5.32k|			quoted = TRUE;
  ------------------
  |  |   15|  5.32k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  5.32k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  674|  5.32k|			str_insert(out, begin, "\"");
  675|  5.32k|		}
  676|       |
  677|  82.3k|		str_append_data(out, pblock, p - pblock);
  678|  82.3k|		if (p >= pend)
  ------------------
  |  Branch (678:7): [True: 15.8k, False: 66.5k]
  ------------------
  679|  15.8k|			break;
  680|       |
  681|  66.5k|		if (!quoted) {
  ------------------
  |  Branch (681:7): [True: 5.05k, False: 61.4k]
  ------------------
  682|  5.05k|			str_append_c(out, '.');
  ------------------
  |  |   54|  5.05k|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|  5.05k|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|  5.05k|			(unsigned char)(chr), (chr)))
  ------------------
  683|  61.4k|		} else {
  684|  61.4k|			i_assert(smtp_char_is_qpair(*p));
  ------------------
  |  |  219|  61.4k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  61.4k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  61.4k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  61.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 61.4k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 61.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  61.4k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  61.4k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  61.4k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  685|  61.4k|			if (!smtp_char_is_qtext(*p))
  ------------------
  |  Branch (685:8): [True: 4.03k, False: 57.4k]
  ------------------
  686|  4.03k|				str_append_c(out, '\\');
  ------------------
  |  |   54|  4.03k|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|  4.03k|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|  4.03k|			(unsigned char)(chr), (chr)))
  ------------------
  687|  61.4k|			str_append_c(out, *p);
  ------------------
  |  |   54|  61.4k|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|  61.4k|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|  61.4k|			(unsigned char)(chr), (chr)))
  ------------------
  688|  61.4k|		}
  689|       |
  690|  66.5k|		p++;
  691|  66.5k|		pblock = p;
  692|  66.5k|	}
  693|       |
  694|  27.3k|	if (p == pblock && !quoted) {
  ------------------
  |  Branch (694:6): [True: 11.5k, False: 15.8k]
  |  Branch (694:21): [True: 8.03k, False: 3.51k]
  ------------------
  695|  8.03k|		quoted = TRUE;
  ------------------
  |  |   15|  8.03k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  8.03k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  696|  8.03k|		str_insert(out, begin, "\"");
  697|  8.03k|	}
  698|       |
  699|  27.3k|	if (quoted)
  ------------------
  |  Branch (699:6): [True: 13.3k, False: 14.0k]
  ------------------
  700|  13.3k|		str_append_c(out, '\"');
  ------------------
  |  |   54|  13.3k|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|  13.3k|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|  13.3k|			(unsigned char)(chr), (chr)))
  ------------------
  701|       |
  702|  27.3k|	if (address->domain == NULL || *address->domain == '\0')
  ------------------
  |  Branch (702:6): [True: 784, False: 26.6k]
  |  Branch (702:33): [True: 0, False: 26.6k]
  ------------------
  703|    784|		return;
  704|       |
  705|  26.6k|	str_append_c(out, '@');
  ------------------
  |  |   54|  26.6k|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|  26.6k|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|  26.6k|			(unsigned char)(chr), (chr)))
  ------------------
  706|  26.6k|	str_append(out, address->domain);
  707|  26.6k|}
smtp_address_encode:
  717|  42.9k|{
  718|  42.9k|	string_t *str = t_str_new(256);
  719|  42.9k|	smtp_address_write(str, address);
  720|  42.9k|	return str_c(str);
  721|  42.9k|}
smtp_address_encode_raw:
  731|  4.54k|{
  732|  4.54k|	if (address != NULL && address->raw != NULL && *address->raw != '\0')
  ------------------
  |  Branch (732:6): [True: 4.54k, False: 0]
  |  Branch (732:25): [True: 864, False: 3.68k]
  |  Branch (732:49): [True: 864, False: 0]
  ------------------
  733|    864|		return address->raw;
  734|       |
  735|  3.68k|	return smtp_address_encode(address);
  736|  4.54k|}
smtp_address_clone:
  787|  66.4k|{
  788|  66.4k|	struct smtp_address *new;
  789|  66.4k|	size_t size, lpsize = 0, dsize = 0, rsize = 0;
  790|  66.4k|	char *data, *localpart = NULL, *domain = NULL, *raw = NULL;
  791|       |
  792|  66.4k|	if (src == NULL)
  ------------------
  |  Branch (792:6): [True: 16.7k, False: 49.7k]
  ------------------
  793|  16.7k|		return NULL;
  794|       |
  795|       |	/* @UNSAFE */
  796|       |
  797|  49.7k|	size = sizeof(struct smtp_address);
  798|  49.7k|	if (!smtp_address_isnull(src)) {
  ------------------
  |  Branch (798:6): [True: 32.7k, False: 16.9k]
  ------------------
  799|  32.7k|		lpsize = strlen(src->localpart) + 1;
  800|  32.7k|		size = MALLOC_ADD(size, lpsize);
  ------------------
  |  |   47|  32.7k|	malloc_add_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  ------------------
  801|  32.7k|	}
  802|  49.7k|	if (src->domain != NULL && *src->domain != '\0') {
  ------------------
  |  Branch (802:6): [True: 30.7k, False: 18.9k]
  |  Branch (802:29): [True: 30.7k, False: 0]
  ------------------
  803|  30.7k|		dsize = strlen(src->domain) + 1;
  804|  30.7k|		size = MALLOC_ADD(size, dsize);
  ------------------
  |  |   47|  30.7k|	malloc_add_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  ------------------
  805|  30.7k|	}
  806|  49.7k|	if (src->raw != NULL && *src->raw != '\0') {
  ------------------
  |  Branch (806:6): [True: 6.34k, False: 43.3k]
  |  Branch (806:26): [True: 6.34k, False: 0]
  ------------------
  807|  6.34k|		rsize = strlen(src->raw) + 1;
  808|  6.34k|		size = MALLOC_ADD(size, rsize);
  ------------------
  |  |   47|  6.34k|	malloc_add_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  ------------------
  809|  6.34k|	}
  810|       |
  811|  49.7k|	data = p_malloc(pool, size);
  812|  49.7k|	new = (struct smtp_address *)data;
  813|  49.7k|	if (lpsize > 0) {
  ------------------
  |  Branch (813:6): [True: 32.7k, False: 16.9k]
  ------------------
  814|  32.7k|		localpart = PTR_OFFSET(data, sizeof(*new));
  ------------------
  |  |   25|  32.7k|	((void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  ------------------
  815|  32.7k|		memcpy(localpart, src->localpart, lpsize);
  ------------------
  |  |   84|  32.7k|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
  816|  32.7k|	}
  817|  49.7k|	if (dsize > 0) {
  ------------------
  |  Branch (817:6): [True: 30.7k, False: 18.9k]
  ------------------
  818|  30.7k|		domain = PTR_OFFSET(data, sizeof(*new) + lpsize);
  ------------------
  |  |   25|  30.7k|	((void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  ------------------
  819|  30.7k|		memcpy(domain, src->domain, dsize);
  ------------------
  |  |   84|  30.7k|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
  820|  30.7k|	}
  821|  49.7k|	if (rsize > 0) {
  ------------------
  |  Branch (821:6): [True: 6.34k, False: 43.3k]
  ------------------
  822|  6.34k|		raw = PTR_OFFSET(data, sizeof(*new) + lpsize + dsize);
  ------------------
  |  |   25|  6.34k|	((void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  ------------------
  823|  6.34k|		memcpy(raw, src->raw, rsize);
  ------------------
  |  |   84|  6.34k|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
  824|  6.34k|	}
  825|  49.7k|	new->localpart = localpart;
  826|  49.7k|	new->domain = domain;
  827|  49.7k|	new->raw = raw;
  828|       |
  829|  49.7k|	return new;
  830|  66.4k|}
smtp-address.c:smtp_parse_mailbox:
  123|  33.0k|{
  124|  33.0k|	struct smtp_parser *parser = &aparser->parser;
  125|  33.0k|	const char **value = NULL;
  126|  33.0k|	const unsigned char *p, *dp;
  127|  33.0k|	int ret;
  128|       |
  129|       |	/* Mailbox = Local-part "@" ( Domain / address-literal )
  130|       |	 */
  131|       |
  132|  33.0k|	value = (aparser->parse ? &aparser->address.localpart : NULL);
  ------------------
  |  Branch (132:11): [True: 33.0k, False: 0]
  ------------------
  133|  33.0k|	if ((flags & SMTP_ADDRESS_PARSE_FLAG_STRICT) != 0 ||
  ------------------
  |  Branch (133:6): [True: 0, False: 33.0k]
  ------------------
  134|  33.0k|	    (flags & SMTP_ADDRESS_PARSE_FLAG_ALLOW_BAD_LOCALPART) == 0 ||
  ------------------
  |  Branch (134:6): [True: 33.0k, False: 0]
  ------------------
  135|  33.0k|	    aparser->path || *parser->cur == '\"') {
  ------------------
  |  Branch (135:6): [True: 0, False: 0]
  |  Branch (135:23): [True: 0, False: 0]
  ------------------
  136|  33.0k|		if ((ret = smtp_parse_localpart(parser, value)) <= 0)
  ------------------
  |  Branch (136:7): [True: 11.3k, False: 21.7k]
  ------------------
  137|  11.3k|			return ret;
  138|  33.0k|	} else {
  139|       |		/* find the end of the address */
  140|      0|		if (smtp_address_parser_find_end(aparser, flags) < 0)
  ------------------
  |  Branch (140:7): [True: 0, False: 0]
  ------------------
  141|      0|			return -1;
  142|       |		/* use the right-most '@' as separator */
  143|      0|		dp = aparser->address_end - 1;
  144|      0|		while (dp > parser->cur && *dp != '@')
  ------------------
  |  Branch (144:10): [True: 0, False: 0]
  |  Branch (144:30): [True: 0, False: 0]
  ------------------
  145|      0|			dp--;
  146|      0|		if (dp == parser->cur)
  ------------------
  |  Branch (146:7): [True: 0, False: 0]
  ------------------
  147|      0|			dp = aparser->address_end;
  148|       |		/* check whether the resulting localpart could be encoded as
  149|       |		   quoted string */
  150|      0|		for (p = parser->cur; p < dp; p++) {
  ------------------
  |  Branch (150:25): [True: 0, False: 0]
  ------------------
  151|      0|			if (!smtp_char_is_qtext(*p) &&
  ------------------
  |  Branch (151:8): [True: 0, False: 0]
  ------------------
  152|      0|			    !smtp_char_is_qpair(*p)) {
  ------------------
  |  Branch (152:8): [True: 0, False: 0]
  ------------------
  153|      0|				parser->error =
  154|      0|					"Invalid character in localpart";
  155|      0|				return -1;
  156|      0|			}
  157|      0|		}
  158|      0|		if (aparser->parse) {
  ------------------
  |  Branch (158:7): [True: 0, False: 0]
  ------------------
  159|      0|			aparser->address.localpart =
  160|      0|				p_strdup_until(parser->pool, parser->cur, dp);
  161|      0|		}
  162|      0|		parser->cur = dp;
  163|      0|	}
  164|       |
  165|  21.7k|	if ((parser->cur >= parser->end || *parser->cur != '@') &&
  ------------------
  |  Branch (165:7): [True: 920, False: 20.8k]
  |  Branch (165:37): [True: 2.24k, False: 18.6k]
  ------------------
  166|  21.7k|	    (flags & SMTP_ADDRESS_PARSE_FLAG_ALLOW_LOCALPART) == 0) {
  ------------------
  |  Branch (166:6): [True: 868, False: 2.29k]
  ------------------
  167|    868|		if (parser->cur >= parser->end ||
  ------------------
  |  Branch (167:7): [True: 354, False: 514]
  ------------------
  168|    868|		    (aparser->path && *parser->cur == '>'))
  ------------------
  |  Branch (168:8): [True: 514, False: 0]
  |  Branch (168:25): [True: 237, False: 277]
  ------------------
  169|    591|			parser->error = "Missing domain";
  170|    277|		else
  171|    277|			parser->error = "Invalid character in localpart";
  172|    868|		return -1;
  173|    868|	}
  174|       |
  175|  20.9k|	if (parser->cur >= parser->end || *parser->cur != '@')
  ------------------
  |  Branch (175:6): [True: 566, False: 20.3k]
  |  Branch (175:36): [True: 1.72k, False: 18.6k]
  ------------------
  176|  2.29k|		return 1;
  177|  18.6k|	parser->cur++;
  178|       |
  179|  18.6k|	value = (aparser->parse ? &aparser->address.domain : NULL);
  ------------------
  |  Branch (179:11): [True: 18.6k, False: 0]
  ------------------
  180|  18.6k|	if ((ret = smtp_parser_parse_domain(parser, value)) == 0 &&
  ------------------
  |  Branch (180:6): [True: 1.25k, False: 17.3k]
  ------------------
  181|  18.6k|	    (ret = smtp_parser_parse_address_literal(
  ------------------
  |  Branch (181:6): [True: 800, False: 453]
  ------------------
  182|  1.25k|		parser, value, NULL)) == 0) {
  183|    800|		if (parser->cur >= parser->end ||
  ------------------
  |  Branch (183:7): [True: 363, False: 437]
  ------------------
  184|    800|		    (aparser->path && *parser->cur == '>')) {
  ------------------
  |  Branch (184:8): [True: 437, False: 0]
  |  Branch (184:25): [True: 215, False: 222]
  ------------------
  185|    578|			parser->error = "Missing domain after '@'";
  186|    578|			return -1;
  187|    578|		} else {
  188|    222|			parser->error = "Invalid domain";
  189|    222|			return -1;
  190|    222|		}
  191|    800|	}
  192|  17.8k|	return ret;
  193|  18.6k|}
smtp-address.c:smtp_parse_localpart:
   83|  33.0k|{
   84|  33.0k|	int ret;
   85|       |
   86|  33.0k|	if ((ret = smtp_parser_parse_quoted_string(parser, localpart_r)) != 0)
  ------------------
  |  Branch (86:6): [True: 8.54k, False: 24.5k]
  ------------------
   87|  8.54k|		return ret;
   88|       |
   89|  24.5k|	return smtp_parser_parse_dot_string(parser, localpart_r);
   90|  33.0k|}
smtp-address.c:smtp_parser_parse_dot_string:
   58|  24.5k|{
   59|  24.5k|	const unsigned char *pbegin = parser->cur;
   60|       |
   61|       |	/* Dot-string = Atom *("." Atom)
   62|       |	 */
   63|       |
   64|       |	/* NOTE: this deviates from Dot-String syntax to allow some Japanese
   65|       |	   mail addresses with dots at non-standard places to be accepted. */
   66|       |
   67|  24.5k|	if (parser->cur >= parser->end ||
  ------------------
  |  Branch (67:6): [True: 980, False: 23.5k]
  ------------------
   68|  24.5k|	    (!smtp_char_is_atext(*parser->cur) && *parser->cur != '.'))
  ------------------
  |  Branch (68:7): [True: 11.8k, False: 11.7k]
  |  Branch (68:44): [True: 9.74k, False: 2.10k]
  ------------------
   69|  10.7k|		return 0;
   70|  13.8k|	parser->cur++;
   71|       |
   72|   248k|	while (parser->cur < parser->end &&
  ------------------
  |  Branch (72:9): [True: 247k, False: 919]
  ------------------
   73|   248k|	       (smtp_char_is_atext(*parser->cur) || *parser->cur == '.'))
  ------------------
  |  Branch (73:10): [True: 232k, False: 15.2k]
  |  Branch (73:46): [True: 2.31k, False: 12.8k]
  ------------------
   74|   234k|		parser->cur++;
   75|       |
   76|  13.8k|	if (value_r != NULL)
  ------------------
  |  Branch (76:6): [True: 13.8k, False: 0]
  ------------------
   77|  13.8k|		*value_r = t_strndup(pbegin, parser->cur - pbegin);
   78|  13.8k|	return 1;
   79|  24.5k|}
smtp-address.c:smtp_parse_path:
  240|  35.0k|{
  241|  35.0k|	struct smtp_parser *parser = &aparser->parser;
  242|  35.0k|	int ret, sret = 0;
  243|       |
  244|       |	/* Path = "<" [ A-d-l ":" ] Mailbox ">"
  245|       |	 */
  246|       |
  247|       |	/* "<" */
  248|  35.0k|	if (parser->cur < parser->end && *parser->cur == '<') {
  ------------------
  |  Branch (248:6): [True: 35.0k, False: 0]
  |  Branch (248:35): [True: 34.6k, False: 411]
  ------------------
  249|  34.6k|		aparser->path = TRUE;
  ------------------
  |  |   15|  34.6k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  34.6k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  250|  34.6k|		parser->cur++;
  251|  34.6k|	} else if ((flags & SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL) == 0) {
  ------------------
  |  Branch (251:13): [True: 411, False: 0]
  ------------------
  252|    411|		return 0;
  253|    411|	}
  254|       |
  255|       |	/* [ A-d-l ":" ] */
  256|  34.6k|	if (aparser->path && (sret = smtp_parse_source_route(parser)) < 0)
  ------------------
  |  Branch (256:6): [True: 34.6k, False: 0]
  |  Branch (256:23): [True: 1.56k, False: 33.0k]
  ------------------
  257|  1.56k|		return -1;
  258|       |
  259|       |	/* Mailbox */
  260|  33.0k|	if ((ret = smtp_parse_mailbox(aparser, flags)) < 0)
  ------------------
  |  Branch (260:6): [True: 2.71k, False: 30.3k]
  ------------------
  261|  2.71k|		return -1;
  262|  30.3k|	if (ret == 0) {
  ------------------
  |  Branch (262:6): [True: 10.7k, False: 19.6k]
  ------------------
  263|  10.7k|		if (parser->cur < parser->end && *parser->cur == '>') {
  ------------------
  |  Branch (263:7): [True: 9.74k, False: 980]
  |  Branch (263:36): [True: 9.49k, False: 257]
  ------------------
  264|  9.49k|			if (sret > 0) {
  ------------------
  |  Branch (264:8): [True: 306, False: 9.18k]
  ------------------
  265|    306|				parser->error =
  266|    306|					"Path only consists of source route";
  267|    306|				return -1;
  268|    306|			}
  269|  9.18k|			if ((flags & SMTP_ADDRESS_PARSE_FLAG_ALLOW_EMPTY)
  ------------------
  |  Branch (269:8): [True: 410, False: 8.77k]
  ------------------
  270|  9.18k|				== 0) {
  271|    410|				parser->error = "Null path not allowed";
  272|    410|				return -1;
  273|    410|			}
  274|  9.18k|		} else {
  275|  1.23k|			parser->error = "Invalid character in localpart";
  276|  1.23k|			return -1;
  277|  1.23k|		}
  278|  10.7k|	}
  279|       |
  280|       |	/* ">" */
  281|  28.4k|	if (aparser->path) {
  ------------------
  |  Branch (281:6): [True: 28.4k, False: 0]
  ------------------
  282|  28.4k|		if (parser->cur >= parser->end || *parser->cur != '>') {
  ------------------
  |  Branch (282:7): [True: 886, False: 27.5k]
  |  Branch (282:37): [True: 417, False: 27.1k]
  ------------------
  283|  1.30k|			parser->error = "Missing '>' at end of path";
  284|  1.30k|			return -1;
  285|  1.30k|		}
  286|  27.1k|		parser->cur++;
  287|  27.1k|	} else if (parser->cur < parser->end && *parser->cur == '>') {
  ------------------
  |  Branch (287:13): [True: 0, False: 0]
  |  Branch (287:42): [True: 0, False: 0]
  ------------------
  288|      0|		parser->error = "Unmatched '>' at end of path";
  289|      0|		return -1;
  290|      0|	}
  291|  27.1k|	return 1;
  292|  28.4k|}
smtp-address.c:smtp_parse_source_route:
  196|  34.6k|{
  197|       |	/* Source-route = [ A-d-l ":" ]
  198|       |	   A-d-l        = At-domain *( "," At-domain )
  199|       |	   At-domain    = "@" Domain
  200|       |	 */
  201|       |
  202|       |	/* "@" Domain */
  203|  34.6k|	if (parser->cur >= parser->end || *parser->cur != '@')
  ------------------
  |  Branch (203:6): [True: 915, False: 33.7k]
  |  Branch (203:36): [True: 31.7k, False: 1.98k]
  ------------------
  204|  32.6k|		return 0;
  205|  1.98k|	parser->cur++;
  206|       |
  207|  2.77k|	for (;;) {
  208|       |		/* Domain */
  209|  2.77k|		if (smtp_parser_parse_domain(parser, NULL) <= 0) {
  ------------------
  |  Branch (209:7): [True: 408, False: 2.36k]
  ------------------
  210|    408|			parser->error =
  211|    408|				"Missing domain after '@' in source route";
  212|    408|			return -1;
  213|    408|		}
  214|       |
  215|       |		/* *( "," At-domain ) */
  216|  2.36k|		if (parser->cur >= parser->end || *parser->cur != ',')
  ------------------
  |  Branch (216:7): [True: 531, False: 1.83k]
  |  Branch (216:37): [True: 638, False: 1.19k]
  ------------------
  217|  1.16k|			break;
  218|  1.19k|		parser->cur++;
  219|       |
  220|       |		/* "@" Domain */
  221|  1.19k|		if (parser->cur >= parser->end || *parser->cur != '@') {
  ------------------
  |  Branch (221:7): [True: 197, False: 1.00k]
  |  Branch (221:37): [True: 209, False: 793]
  ------------------
  222|    406|			parser->error = "Missing '@' after ',' in source route";
  223|    406|			return -1;
  224|    406|		}
  225|    793|		parser->cur++;
  226|    793|	}
  227|       |
  228|       |	/* ":" */
  229|  1.16k|	if (parser->cur >= parser->end || *parser->cur != ':') {
  ------------------
  |  Branch (229:6): [True: 531, False: 638]
  |  Branch (229:36): [True: 221, False: 417]
  ------------------
  230|    752|		parser->error = "Missing ':' at end of source route";
  231|    752|		return -1;
  232|    752|	}
  233|    417|	parser->cur++;
  234|    417|	return 1;
  235|  1.16k|}
smtp-address.c:smtp_address_parse_path_broken:
  349|  7.94k|{
  350|  7.94k|	struct smtp_parser *parser = &aparser->parser;
  351|  7.94k|	const char *begin = (const char *)parser->begin, *end;
  352|  7.94k|	const char *raw = aparser->address.raw;
  353|  7.94k|	const char **address_p = NULL;
  354|       |
  355|  7.94k|	i_zero(&aparser->address);
  ------------------
  |  |  249|  7.94k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  7.94k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  7.94k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  356|  7.94k|	aparser->address.raw = raw;
  357|       |
  358|  7.94k|	if (aparser->totally_broken ||
  ------------------
  |  Branch (358:6): [True: 0, False: 7.94k]
  ------------------
  359|  7.94k|	    HAS_NO_BITS(flags, SMTP_ADDRESS_PARSE_FLAG_IGNORE_BROKEN))
  ------------------
  |  |   12|  7.94k|#define HAS_NO_BITS(val,bits) (((val) & (bits)) == 0)
  |  |  ------------------
  |  |  |  Branch (12:31): [True: 7.94k, False: 0]
  |  |  ------------------
  ------------------
  360|  7.94k|		return -1;
  361|      0|	if (*begin != '<' &&
  ------------------
  |  Branch (361:6): [True: 0, False: 0]
  ------------------
  362|      0|	    HAS_NO_BITS(flags, SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL)) {
  ------------------
  |  |   12|      0|#define HAS_NO_BITS(val,bits) (((val) & (bits)) == 0)
  |  |  ------------------
  |  |  |  Branch (12:31): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  363|       |		/* brackets missing; totally broken */
  364|      0|		return -1;
  365|      0|	}
  366|      0|	i_assert(aparser->parse);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  367|      0|	if (aparser->parsed_any) {
  ------------------
  |  Branch (367:6): [True: 0, False: 0]
  ------------------
  368|      0|		if (endp_r != NULL)
  ------------------
  |  Branch (368:7): [True: 0, False: 0]
  ------------------
  369|      0|			*endp_r = (const char *)aparser->address_end;
  370|      0|		return 0;
  371|      0|	}
  372|       |
  373|      0|	if (HAS_ALL_BITS(flags, SMTP_ADDRESS_PARSE_FLAG_PRESERVE_RAW))
  ------------------
  |  |   18|      0|#define HAS_ALL_BITS(val,bits) ((~(val) & (bits)) == 0)
  |  |  ------------------
  |  |  |  Branch (18:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  374|      0|		address_p = &aparser->address.raw;
  375|      0|	if (smtp_address_parse_any(begin, address_p, &end) < 0) {
  ------------------
  |  Branch (375:6): [True: 0, False: 0]
  ------------------
  376|       |		/* totally broken */
  377|      0|		return -1;
  378|      0|	}
  379|      0|	if (endp_r != NULL)
  ------------------
  |  Branch (379:6): [True: 0, False: 0]
  ------------------
  380|      0|		*endp_r = end;
  381|      0|	return 0;
  382|      0|}

smtp-address.c:smtp_address_isnull:
  202|  92.6k|{
  203|  92.6k|	return (address == NULL || address->localpart == NULL);
  ------------------
  |  Branch (203:10): [True: 0, False: 92.6k]
  |  Branch (203:29): [True: 32.5k, False: 60.1k]
  ------------------
  204|  92.6k|}
smtp-server-cmd-mail.c:smtp_address_is_broken:
  208|  3.89k|{
  209|  3.89k|	return (address != NULL &&
  ------------------
  |  Branch (209:10): [True: 0, False: 3.89k]
  ------------------
  210|  3.89k|		smtp_address_isnull(address) &&
  ------------------
  |  Branch (210:3): [True: 0, False: 0]
  ------------------
  211|  3.89k|		(address->raw != NULL && *address->raw != '\0'));
  ------------------
  |  Branch (211:4): [True: 0, False: 0]
  |  Branch (211:28): [True: 0, False: 0]
  ------------------
  212|  3.89k|}

smtp_command_parser_init:
   77|  6.21k|{
   78|  6.21k|	struct smtp_command_parser *parser;
   79|       |
   80|  6.21k|	parser = i_new(struct smtp_command_parser, 1);
  ------------------
  |  |    8|  6.21k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  6.21k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  6.21k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  6.21k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|  6.21k|	parser->input = input;
   82|  6.21k|	i_stream_ref(input);
   83|       |
   84|  6.21k|	if (limits != NULL)
  ------------------
  |  Branch (84:6): [True: 6.21k, False: 0]
  ------------------
   85|  6.21k|		parser->limits = *limits;
   86|  6.21k|	if (parser->limits.max_parameters_size == 0) {
  ------------------
  |  Branch (86:6): [True: 6.21k, False: 0]
  ------------------
   87|  6.21k|		parser->limits.max_parameters_size =
   88|  6.21k|			SMTP_COMMAND_DEFAULT_MAX_PARAMETERS_SIZE;
  ------------------
  |  |    4|  6.21k|#define SMTP_COMMAND_DEFAULT_MAX_PARAMETERS_SIZE  4*1024
  ------------------
   89|  6.21k|	}
   90|  6.21k|	if (parser->limits.max_auth_size == 0) {
  ------------------
  |  Branch (90:6): [True: 6.21k, False: 0]
  ------------------
   91|  6.21k|		parser->limits.max_auth_size =
   92|  6.21k|			SMTP_COMMAND_DEFAULT_MAX_AUTH_SIZE;
  ------------------
  |  |    5|  6.21k|#define SMTP_COMMAND_DEFAULT_MAX_AUTH_SIZE        8*1024
  ------------------
   93|  6.21k|	}
   94|  6.21k|	if (parser->limits.max_data_size == 0) {
  ------------------
  |  Branch (94:6): [True: 6.21k, False: 0]
  ------------------
   95|  6.21k|		parser->limits.max_data_size =
   96|  6.21k|			SMTP_COMMAND_DEFAULT_MAX_DATA_SIZE;
  ------------------
  |  |    6|  6.21k|#define SMTP_COMMAND_DEFAULT_MAX_DATA_SIZE        40*1024*1024
  ------------------
   97|  6.21k|	}
   98|       |
   99|  6.21k|	return parser;
  100|  6.21k|}
smtp_command_parser_clear:
  103|   123k|{
  104|   123k|	if (parser->auth_response_buffered) {
  ------------------
  |  Branch (104:6): [True: 0, False: 123k]
  ------------------
  105|      0|		if (parser->line_buffer != NULL)
  ------------------
  |  Branch (105:7): [True: 0, False: 0]
  ------------------
  106|      0|			buffer_clear_safe(parser->line_buffer);
  107|      0|		if (parser->state.cmd_params != NULL) {
  ------------------
  |  Branch (107:7): [True: 0, False: 0]
  ------------------
  108|      0|			safe_memset(parser->state.cmd_params, 0,
  109|      0|				    strlen(parser->state.cmd_params));
  110|      0|		}
  111|      0|	}
  112|   123k|	parser->auth_response_buffered = FALSE;
  ------------------
  |  |   11|   123k|#  define FALSE (!1)
  ------------------
  113|   123k|}
smtp_command_parser_deinit:
  116|  6.21k|{
  117|  6.21k|	struct smtp_command_parser *parser = *_parser;
  118|       |
  119|  6.21k|	smtp_command_parser_clear(parser);
  120|       |
  121|  6.21k|	i_stream_unref(&parser->data);
  122|  6.21k|	buffer_free(&parser->line_buffer);
  123|  6.21k|	i_free(parser->state.cmd_name);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  124|  6.21k|	i_free(parser->state.cmd_params);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  125|  6.21k|	i_free(parser->error);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  126|  6.21k|	i_stream_unref(&parser->input);
  127|  6.21k|	i_free(parser);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  128|  6.21k|	*_parser = NULL;
  129|  6.21k|}
smtp_command_parser_pending_data:
  462|   115k|{
  463|   115k|	if (parser->data == NULL)
  ------------------
  |  Branch (463:6): [True: 100k, False: 14.8k]
  ------------------
  464|   100k|		return FALSE;
  ------------------
  |  |   11|   100k|#  define FALSE (!1)
  ------------------
  465|  14.8k|	return i_stream_have_bytes_left(parser->data);
  466|   115k|}
smtp_command_parse_next:
  510|   121k|{
  511|   121k|	int ret;
  512|       |
  513|   121k|	i_assert(!parser->auth_response ||
  ------------------
  |  |  219|   121k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   121k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   121k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   243k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 121k]
  |  |  |  |  |  Branch (202:45): [True: 121k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   121k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   121k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   121k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  514|   121k|		 parser->state.state == SMTP_COMMAND_PARSE_STATE_INIT ||
  515|   121k|		 parser->state.state == SMTP_COMMAND_PARSE_STATE_ERROR);
  516|   121k|	parser->auth_response = FALSE;
  ------------------
  |  |   11|   121k|#  define FALSE (!1)
  ------------------
  517|       |
  518|   121k|	*error_code_r = parser->error_code = SMTP_COMMAND_PARSE_ERROR_NONE;
  519|   121k|	*error_r = NULL;
  520|       |
  521|   121k|	i_free_and_null(parser->error);
  ------------------
  |  |   27|   121k|#define i_free_and_null(mem) i_free(mem)
  |  |  ------------------
  |  |  |  |   19|   121k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  135|   121k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   121k|	STMT_START { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   63|   121k|#  define STMT_START do
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  132|   121k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  |  |  133|   121k|		(mem) = NULL;			\
  |  |  |  |  |  |  |  |  134|   121k|	} STMT_END
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   64|   121k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  522|       |
  523|       |	/* Make sure we finished streaming payload from previous command
  524|       |	   before we continue. */
  525|   121k|	ret = smtp_command_parse_finish_data(parser);
  526|   121k|	if (ret <= 0) {
  ------------------
  |  Branch (526:6): [True: 289, False: 121k]
  ------------------
  527|    289|		if (ret < 0) {
  ------------------
  |  Branch (527:7): [True: 246, False: 43]
  ------------------
  528|    246|			*error_code_r = parser->error_code;
  529|    246|			*error_r = parser->error;
  530|    246|		}
  531|    289|		return ret;
  532|    289|	}
  533|       |
  534|   121k|	ret = smtp_command_parse(parser);
  535|   121k|	if (ret <= 0) {
  ------------------
  |  Branch (535:6): [True: 18.3k, False: 103k]
  ------------------
  536|  18.3k|		if (ret < 0) {
  ------------------
  |  Branch (536:7): [True: 18.1k, False: 120]
  ------------------
  537|  18.1k|			*error_code_r = parser->error_code;
  538|  18.1k|			*error_r = parser->error;
  539|  18.1k|			parser->state.state = SMTP_COMMAND_PARSE_STATE_ERROR;
  540|  18.1k|		}
  541|  18.3k|		return ret;
  542|  18.3k|	}
  543|       |
  544|   121k|	i_assert(parser->state.state == SMTP_COMMAND_PARSE_STATE_INIT);
  ------------------
  |  |  219|   103k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   103k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   103k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   103k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 103k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 103k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   103k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   121k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   121k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  545|   103k|	*cmd_name_r = parser->state.cmd_name;
  546|   103k|	*cmd_params_r = (parser->state.cmd_params == NULL ?
  ------------------
  |  Branch (546:19): [True: 35.9k, False: 67.3k]
  ------------------
  547|  67.3k|			 "" : parser->state.cmd_params);
  548|   103k|	return 1;
  549|   103k|}
smtp_command_parse_data_with_size:
  554|  14.2k|{
  555|  14.2k|	i_assert(parser->data == NULL);
  ------------------
  |  |  219|  14.2k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  14.2k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  14.2k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  14.2k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 14.2k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 14.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  14.2k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  14.2k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  14.2k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  556|  14.2k|	if (size > parser->limits.max_data_size) {
  ------------------
  |  Branch (556:6): [True: 1.44k, False: 12.8k]
  ------------------
  557|       |		/* Not supposed to happen; command should check size */
  558|  1.44k|		parser->data = i_stream_create_error_str(EMSGSIZE,
  559|  1.44k|			"Command data size exceeds maximum "
  560|  1.44k|			"(%"PRIuUOFF_T" > %"PRIuUOFF_T")",
  561|  1.44k|			size, parser->limits.max_data_size);
  562|  12.8k|	} else {
  563|       |		// FIXME: Make exact_size stream type
  564|  12.8k|		struct istream *limit_input =
  565|  12.8k|			i_stream_create_limit(parser->input, size);
  566|  12.8k|		parser->data = i_stream_create_min_sized(limit_input, size);
  567|  12.8k|		i_stream_unref(&limit_input);
  568|  12.8k|	}
  569|  14.2k|	i_stream_ref(parser->data);
  570|  14.2k|	return parser->data;
  571|  14.2k|}
smtp_command_parse_data_with_dot:
  575|  1.55k|{
  576|  1.55k|	struct istream *data;
  577|  1.55k|	i_assert(parser->data == NULL);
  ------------------
  |  |  219|  1.55k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  1.55k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  1.55k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  1.55k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1.55k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1.55k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  1.55k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  1.55k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.55k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  578|       |
  579|  1.55k|	data = i_stream_create_dot(parser->input, ISTREAM_DOT_NO_TRIM |
  580|  1.55k|						  ISTREAM_DOT_STRICT_EOT);
  581|  1.55k|	if (parser->limits.max_data_size != UOFF_T_MAX) {
  ------------------
  |  |  846|  1.55k|#define UOFF_T_MAX ULONG_MAX
  ------------------
  |  Branch (581:6): [True: 1.55k, False: 0]
  ------------------
  582|  1.55k|		parser->data = i_stream_create_failure_at(
  583|  1.55k|			data, parser->limits.max_data_size, EMSGSIZE,
  584|  1.55k|			t_strdup_printf("Command data size exceeds maximum "
  585|  1.55k|					"(> %"PRIuUOFF_T")",
  586|  1.55k|					parser->limits.max_data_size));
  587|  1.55k|		i_stream_unref(&data);
  588|  1.55k|	} else {
  589|      0|		parser->data = data;
  590|      0|	}
  591|  1.55k|	i_stream_ref(parser->data);
  592|  1.55k|	return parser->data;
  593|  1.55k|}
smtp-command-parser.c:smtp_command_parse_finish_data:
  469|   121k|{
  470|   121k|	const unsigned char *data;
  471|   121k|	size_t size;
  472|   121k|	int ret;
  473|       |
  474|   121k|	parser->error_code = SMTP_COMMAND_PARSE_ERROR_NONE;
  475|   121k|	parser->error = NULL;
  476|       |
  477|   121k|	if (parser->data == NULL)
  ------------------
  |  Branch (477:6): [True: 106k, False: 15.2k]
  ------------------
  478|   106k|		return 1;
  479|  15.2k|	if (parser->data->eof) {
  ------------------
  |  Branch (479:6): [True: 11.7k, False: 3.47k]
  ------------------
  480|  11.7k|		i_stream_unref(&parser->data);
  481|  11.7k|		return 1;
  482|  11.7k|	}
  483|       |
  484|  6.82k|	while ((ret = i_stream_read_data(parser->data, &data, &size, 0)) > 0)
  ------------------
  |  Branch (484:9): [True: 3.35k, False: 3.47k]
  ------------------
  485|  3.35k|		i_stream_skip(parser->data, size);
  486|  3.47k|	if (ret == 0 || parser->data->stream_errno != 0) {
  ------------------
  |  Branch (486:6): [True: 43, False: 3.42k]
  |  Branch (486:18): [True: 246, False: 3.18k]
  ------------------
  487|    289|		switch (parser->data->stream_errno) {
  488|     43|		case 0:
  ------------------
  |  Branch (488:3): [True: 43, False: 246]
  ------------------
  489|     43|			return 0;
  490|      0|		case EMSGSIZE:
  ------------------
  |  Branch (490:3): [True: 0, False: 289]
  ------------------
  491|      0|			smtp_command_parser_error(
  492|      0|				parser,	SMTP_COMMAND_PARSE_ERROR_DATA_TOO_LARGE,
  493|      0|				"Command data too large");
  494|      0|			break;
  495|    246|		default:
  ------------------
  |  Branch (495:3): [True: 246, False: 43]
  ------------------
  496|    246|			smtp_command_parser_error(
  497|    246|				parser, SMTP_COMMAND_PARSE_ERROR_BROKEN_STREAM,
  498|    246|				"%s", i_stream_get_disconnect_reason(parser->data));
  499|    289|		}
  500|    246|		return -1;
  501|    289|	}
  502|  3.18k|	i_stream_unref(&parser->data);
  503|  3.18k|	return 1;
  504|  3.47k|}
smtp-command-parser.c:smtp_command_parser_error:
   61|  18.4k|{
   62|  18.4k|	va_list args;
   63|       |
   64|  18.4k|	parser->state.state = SMTP_COMMAND_PARSE_STATE_ERROR;
   65|       |
   66|  18.4k|	i_free(parser->error);
  ------------------
  |  |   19|  18.4k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  18.4k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  18.4k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  18.4k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  18.4k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  18.4k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  18.4k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  18.4k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   67|  18.4k|	parser->error_code = code;
   68|       |
   69|  18.4k|	va_start(args, format);
   70|  18.4k|	parser->error = i_strdup_vprintf(format, args);
   71|  18.4k|	va_end(args);
   72|  18.4k|}
smtp-command-parser.c:smtp_command_parse:
  425|   121k|{
  426|   121k|	const unsigned char *begin;
  427|   121k|	size_t size, old_bytes = 0;
  428|   121k|	int ret;
  429|       |
  430|   126k|	while ((ret = i_stream_read_data(parser->input, &begin, &size,
  ------------------
  |  Branch (430:9): [True: 121k, False: 5.22k]
  ------------------
  431|   126k|					 old_bytes)) > 0) {
  432|   121k|		parser->cur = begin;
  433|   121k|		parser->end = parser->cur + size;
  434|       |
  435|   121k|		ret = smtp_command_parse_line(parser);
  436|   121k|		i_stream_skip(parser->input, parser->cur - begin);
  437|   121k|		if (ret != 0)
  ------------------
  |  Branch (437:7): [True: 116k, False: 4.83k]
  ------------------
  438|   116k|			return ret;
  439|  4.83k|		old_bytes = i_stream_get_data_size(parser->input);
  440|  4.83k|	}
  441|   121k|	i_assert(ret != -2);
  ------------------
  |  |  219|  5.22k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  5.22k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  5.22k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  5.22k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 5.22k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 5.22k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  5.22k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   121k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   121k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  442|       |
  443|  5.22k|	if (ret < 0) {
  ------------------
  |  Branch (443:6): [True: 5.10k, False: 120]
  ------------------
  444|  5.10k|		i_assert(parser->input->eof);
  ------------------
  |  |  219|  5.10k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  5.10k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  5.10k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  5.10k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 5.10k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 5.10k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  5.10k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  5.10k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  5.10k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  445|  5.10k|		if (parser->input->stream_errno == 0) {
  ------------------
  |  Branch (445:7): [True: 5.10k, False: 0]
  ------------------
  446|  5.10k|			if (parser->state.state ==
  ------------------
  |  Branch (446:8): [True: 4.06k, False: 1.04k]
  ------------------
  447|  5.10k|			    SMTP_COMMAND_PARSE_STATE_INIT)
  448|  4.06k|				ret = -2;
  449|  5.10k|			smtp_command_parser_error(
  450|  5.10k|				parser, SMTP_COMMAND_PARSE_ERROR_BROKEN_COMMAND,
  451|  5.10k|				"Premature end of input");
  452|  5.10k|		} else {
  453|      0|			smtp_command_parser_error(
  454|      0|				parser, SMTP_COMMAND_PARSE_ERROR_BROKEN_STREAM,
  455|      0|				"%s", i_stream_get_disconnect_reason(parser->input));
  456|      0|		}
  457|  5.10k|	}
  458|  5.22k|	return ret;
  459|  5.22k|}
smtp-command-parser.c:smtp_command_parse_line:
  309|   121k|{
  310|   121k|	int ret;
  311|       |
  312|       |	/* RFC 5321, Section 4.1.1:
  313|       |
  314|       |	   SMTP commands are character strings terminated by <CRLF>. The
  315|       |	   commands themselves are alphabetic characters terminated by <SP> if
  316|       |	   parameters follow and <CRLF> otherwise. (In the interest of improved
  317|       |	   interoperability, SMTP receivers SHOULD tolerate trailing white space
  318|       |	   before the terminating <CRLF>.)
  319|       |	 */
  320|   170k|	for (;;) {
  321|   170k|		switch (parser->state.state) {
  322|   116k|		case SMTP_COMMAND_PARSE_STATE_INIT:
  ------------------
  |  Branch (322:3): [True: 116k, False: 53.6k]
  ------------------
  323|   116k|			smtp_command_parser_restart(parser);
  324|   116k|			if (parser->auth_response) {
  ------------------
  |  Branch (324:8): [True: 0, False: 116k]
  ------------------
  325|       |				/* Parse AUTH response as bare parameters */
  326|      0|				parser->state.state =
  327|      0|					SMTP_COMMAND_PARSE_STATE_PARAMETERS;
  328|   116k|			} else {
  329|   116k|				parser->state.state =
  330|   116k|					SMTP_COMMAND_PARSE_STATE_COMMAND;
  331|   116k|			}
  332|   116k|			if (parser->cur == parser->end)
  ------------------
  |  Branch (332:8): [True: 74, False: 116k]
  ------------------
  333|     74|				return 0;
  334|   116k|			if (parser->auth_response)
  ------------------
  |  Branch (334:8): [True: 0, False: 116k]
  ------------------
  335|      0|				break;
  336|       |			/* fall through */
  337|   116k|		case SMTP_COMMAND_PARSE_STATE_COMMAND:
  ------------------
  |  Branch (337:3): [True: 42, False: 170k]
  ------------------
  338|   116k|			ret = smtp_command_parse_identifier(parser);
  339|   116k|			if (ret <= 0)
  ------------------
  |  Branch (339:8): [True: 1.18k, False: 115k]
  ------------------
  340|  1.18k|				return ret;
  341|   115k|			parser->state.state = SMTP_COMMAND_PARSE_STATE_SP;
  342|   115k|			if (parser->cur == parser->end)
  ------------------
  |  Branch (342:8): [True: 0, False: 115k]
  ------------------
  343|      0|				return 0;
  344|       |			/* fall through */
  345|   115k|		case SMTP_COMMAND_PARSE_STATE_SP:
  ------------------
  |  Branch (345:3): [True: 0, False: 170k]
  ------------------
  346|   115k|			if (*parser->cur == '\r') {
  ------------------
  |  Branch (346:8): [True: 1.27k, False: 114k]
  ------------------
  347|  1.27k|				parser->state.state =
  348|  1.27k|					SMTP_COMMAND_PARSE_STATE_CR;
  349|  1.27k|				break;
  350|   114k|			} else if (*parser->cur == '\n') {
  ------------------
  |  Branch (350:15): [True: 35.5k, False: 78.7k]
  ------------------
  351|  35.5k|				parser->state.state =
  352|  35.5k|					SMTP_COMMAND_PARSE_STATE_LF;
  353|  35.5k|				break;
  354|  78.7k|			} else if (*parser->cur != ' ') {
  ------------------
  |  Branch (354:15): [True: 6.25k, False: 72.5k]
  ------------------
  355|  6.25k|				smtp_command_parser_error(parser,
  356|  6.25k|					SMTP_COMMAND_PARSE_ERROR_BAD_COMMAND,
  357|  6.25k|					"Unexpected character %s in command name",
  358|  6.25k|					_chr_sanitize(*parser->cur));
  359|  6.25k|				return -1;
  360|  6.25k|			}
  361|  72.5k|			parser->cur++;
  362|  72.5k|			parser->state.state =
  363|  72.5k|				SMTP_COMMAND_PARSE_STATE_PARAMETERS;
  364|  72.5k|			if (parser->cur >= parser->end)
  ------------------
  |  Branch (364:8): [True: 38, False: 72.4k]
  ------------------
  365|     38|				return 0;
  366|       |			/* fall through */
  367|  73.6k|		case SMTP_COMMAND_PARSE_STATE_PARAMETERS:
  ------------------
  |  Branch (367:3): [True: 1.11k, False: 169k]
  ------------------
  368|  73.6k|			ret = smtp_command_parse_parameters(parser);
  369|  73.6k|			if (ret <= 0)
  ------------------
  |  Branch (369:8): [True: 4.70k, False: 68.8k]
  ------------------
  370|  4.70k|				return ret;
  371|  68.8k|			parser->state.state = SMTP_COMMAND_PARSE_STATE_CR;
  372|  68.8k|			if (parser->cur == parser->end)
  ------------------
  |  Branch (372:8): [True: 0, False: 68.8k]
  ------------------
  373|      0|				return 0;
  374|       |			/* fall through */
  375|  70.1k|		case SMTP_COMMAND_PARSE_STATE_CR:
  ------------------
  |  Branch (375:3): [True: 1.27k, False: 169k]
  ------------------
  376|  70.1k|			if (*parser->cur == '\r') {
  ------------------
  |  Branch (376:8): [True: 1.44k, False: 68.7k]
  ------------------
  377|  1.44k|				parser->cur++;
  378|  68.7k|			} else if (*parser->cur != '\n') {
  ------------------
  |  Branch (378:15): [True: 1.42k, False: 67.3k]
  ------------------
  379|  1.42k|				smtp_command_parser_error(parser,
  380|  1.42k|					SMTP_COMMAND_PARSE_ERROR_BAD_COMMAND,
  381|  1.42k|					"Unexpected character %s in %s",
  382|  1.42k|					_chr_sanitize(*parser->cur),
  383|  1.42k|					(parser->auth_response ?
  ------------------
  |  Branch (383:7): [True: 0, False: 1.42k]
  ------------------
  384|      0|					 "AUTH response" :
  385|  1.42k|					 "command parameters"));
  386|  1.42k|				return -1;
  387|  1.42k|			}
  388|  68.7k|			parser->state.state = SMTP_COMMAND_PARSE_STATE_LF;
  389|  68.7k|			if (parser->cur == parser->end)
  ------------------
  |  Branch (389:8): [True: 44, False: 68.7k]
  ------------------
  390|     44|				return 0;
  391|       |			/* fall through */
  392|   104k|		case SMTP_COMMAND_PARSE_STATE_LF:
  ------------------
  |  Branch (392:3): [True: 35.6k, False: 134k]
  ------------------
  393|   104k|			if (*parser->cur != '\n') {
  ------------------
  |  Branch (393:8): [True: 1.03k, False: 103k]
  ------------------
  394|  1.03k|				smtp_command_parser_error(parser,
  395|  1.03k|					SMTP_COMMAND_PARSE_ERROR_BAD_COMMAND,
  396|  1.03k|					"Expected LF after CR at end of %s, "
  397|  1.03k|					"but found %s",
  398|  1.03k|					(parser->auth_response ?
  ------------------
  |  Branch (398:7): [True: 0, False: 1.03k]
  ------------------
  399|  1.03k|					 "AUTH response" : "command"),
  400|  1.03k|					_chr_sanitize(*parser->cur));
  401|  1.03k|				return -1;
  402|  1.03k|			}
  403|   103k|			parser->cur++;
  404|   103k|			parser->state.state = SMTP_COMMAND_PARSE_STATE_INIT;
  405|   103k|			return 1;
  406|  15.5k|		case SMTP_COMMAND_PARSE_STATE_ERROR:
  ------------------
  |  Branch (406:3): [True: 15.5k, False: 154k]
  ------------------
  407|       |			/* Skip until end of line */
  408|  25.1M|			while (parser->cur < parser->end &&
  ------------------
  |  Branch (408:11): [True: 25.1M, False: 3.14k]
  ------------------
  409|  25.1M|			       *parser->cur != '\n')
  ------------------
  |  Branch (409:11): [True: 25.1M, False: 12.4k]
  ------------------
  410|  25.1M|				parser->cur++;
  411|  15.5k|			if (parser->cur == parser->end)
  ------------------
  |  Branch (411:8): [True: 3.14k, False: 12.4k]
  ------------------
  412|  3.14k|				return 0;
  413|  12.4k|			parser->cur++;
  414|  12.4k|			parser->state.state = SMTP_COMMAND_PARSE_STATE_INIT;
  415|  12.4k|			break;
  416|      0|		default:
  ------------------
  |  Branch (416:3): [True: 0, False: 170k]
  ------------------
  417|      0|			i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
  418|   170k|		}
  419|   170k|	}
  420|       |
  421|      0|	i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
  422|   121k|}
smtp-command-parser.c:smtp_command_parser_restart:
  132|   116k|{
  133|   116k|	smtp_command_parser_clear(parser);
  134|       |
  135|   116k|	buffer_free(&parser->line_buffer);
  136|   116k|	i_free(parser->state.cmd_name);
  ------------------
  |  |   19|   116k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|   116k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|   116k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   116k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|   116k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|   116k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|   116k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|   116k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  137|   116k|	i_free(parser->state.cmd_params);
  ------------------
  |  |   19|   116k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|   116k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|   116k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   116k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|   116k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|   116k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|   116k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|   116k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  138|       |
  139|   116k|	i_zero(&parser->state);
  ------------------
  |  |  249|   116k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|   116k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|   116k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  140|   116k|}
smtp-command-parser.c:smtp_command_parse_identifier:
  164|   116k|{
  165|   116k|	const unsigned char *p;
  166|       |
  167|       |	/* The commands themselves are alphabetic characters.
  168|       |	 */
  169|   116k|	p = parser->cur + parser->state.poff;
  170|   116k|	i_assert(p <= parser->end);
  ------------------
  |  |  219|   116k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   116k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   116k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   116k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 116k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 116k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   116k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   116k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   116k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  171|   814k|	while (p < parser->end && i_isalpha(*p))
  ------------------
  |  |  105|   814k|#define i_isalpha(x) (isalpha((int) (unsigned char) (x)) != 0)
  |  |  ------------------
  |  |  |  Branch (105:22): [True: 697k, False: 116k]
  |  |  ------------------
  ------------------
  |  Branch (171:9): [True: 814k, False: 276]
  ------------------
  172|   697k|		p++;
  173|   116k|	if ((p - parser->cur) > SMTP_COMMAND_PARSER_MAX_COMMAND_LENGTH) {
  ------------------
  |  |   17|   116k|#define SMTP_COMMAND_PARSER_MAX_COMMAND_LENGTH 32
  ------------------
  |  Branch (173:6): [True: 992, False: 115k]
  ------------------
  174|    992|		smtp_command_parser_error(
  175|    992|			parser, SMTP_COMMAND_PARSE_ERROR_BAD_COMMAND,
  176|    992|			"Command name is too long");
  177|    992|		return -1;
  178|    992|	}
  179|   115k|	parser->state.poff = p - parser->cur;
  180|   115k|	if (p == parser->end)
  ------------------
  |  Branch (180:6): [True: 192, False: 115k]
  ------------------
  181|    192|		return 0;
  182|   115k|	parser->state.cmd_name = i_strdup_until(parser->cur, p);
  183|   115k|	parser->cur = p;
  184|   115k|	parser->state.poff = 0;
  185|   115k|	return 1;
  186|   115k|}
smtp-command-parser.c:_chr_sanitize:
  153|  8.71k|{
  154|  8.71k|	if (c >= 0x20 && c < 0x7F)
  ------------------
  |  Branch (154:6): [True: 4.92k, False: 3.79k]
  |  Branch (154:19): [True: 2.74k, False: 2.18k]
  ------------------
  155|  2.74k|		return t_strdup_printf("`%c'", c);
  156|  5.97k|	if (c == 0x0a)
  ------------------
  |  Branch (156:6): [True: 0, False: 5.97k]
  ------------------
  157|      0|		return "<LF>";
  158|  5.97k|	if (c == 0x0d)
  ------------------
  |  Branch (158:6): [True: 429, False: 5.54k]
  ------------------
  159|    429|		return "<CR>";
  160|  5.54k|	return t_strdup_printf("<0x%02x>", c);
  161|  5.97k|}
smtp-command-parser.c:smtp_command_parse_parameters:
  189|  73.6k|{
  190|  73.6k|	const unsigned char *p, *mp;
  191|  73.6k|	size_t max_size = (parser->auth_response ?
  ------------------
  |  Branch (191:21): [True: 0, False: 73.6k]
  ------------------
  192|      0|			   parser->limits.max_auth_size :
  193|  73.6k|			   parser->limits.max_parameters_size);
  194|  73.6k|	size_t buf_size = (parser->line_buffer == NULL ?
  ------------------
  |  Branch (194:21): [True: 73.6k, False: 0]
  ------------------
  195|  73.6k|			   0 : parser->line_buffer->used);
  196|  73.6k|	int nch = 1;
  197|       |
  198|  73.6k|	i_assert(max_size == 0 || buf_size <= max_size);
  ------------------
  |  |  219|  73.6k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  73.6k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  73.6k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   147k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 73.6k]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 73.6k]
  |  |  |  |  |  Branch (202:45): [True: 73.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  73.6k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  73.6k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  73.6k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  199|  73.6k|	if (max_size > 0 && buf_size == max_size) {
  ------------------
  |  Branch (199:6): [True: 73.6k, False: 0]
  |  Branch (199:22): [True: 0, False: 73.6k]
  ------------------
  200|      0|		smtp_command_parser_error(
  201|      0|			parser, SMTP_COMMAND_PARSE_ERROR_LINE_TOO_LONG,
  202|      0|			"%s line is too long",
  203|      0|			(parser->auth_response ? "AUTH response" : "Command"));
  ------------------
  |  Branch (203:5): [True: 0, False: 0]
  ------------------
  204|      0|		return -1;
  205|      0|	}
  206|       |
  207|       |	/* We assume parameters to match textstr (HT, SP, Printable US-ASCII).
  208|       |	   For command parameters, we also accept valid UTF-8 characters.
  209|       |	 */
  210|  73.6k|	p = parser->cur + parser->state.poff;
  211|  7.51M|	while (p < parser->end) {
  ------------------
  |  Branch (211:9): [True: 7.51M, False: 1.23k]
  ------------------
  212|  7.51M|		unichar_t ch;
  213|       |
  214|  7.51M|		if (parser->auth_response)
  ------------------
  |  Branch (214:7): [True: 0, False: 7.51M]
  ------------------
  215|      0|			ch = *p;
  216|  7.51M|		else {
  217|  7.51M|			nch = uni_utf8_get_char_n(p, (size_t)(parser->end - p),
  218|  7.51M|						  &ch);
  219|  7.51M|		}
  220|  7.51M|		if (nch == 0)
  ------------------
  |  Branch (220:7): [True: 146, False: 7.51M]
  ------------------
  221|    146|			break;
  222|  7.51M|		if (nch < 0) {
  ------------------
  |  Branch (222:7): [True: 2.34k, False: 7.51M]
  ------------------
  223|  2.34k|			smtp_command_parser_error(
  224|  2.34k|				parser, SMTP_COMMAND_PARSE_ERROR_BAD_COMMAND,
  225|  2.34k|				"Invalid UTF-8 character in command parameters");
  226|  2.34k|			return -1;
  227|  2.34k|		}
  228|  7.51M|		if (nch == 1 && !smtp_char_is_textstr((unsigned char)ch))
  ------------------
  |  Branch (228:7): [True: 7.51M, False: 4.12k]
  |  Branch (228:19): [True: 69.8k, False: 7.44M]
  ------------------
  229|  69.8k|			break;
  230|  7.44M|		p += nch;
  231|  7.44M|	}
  232|  71.2k|	if (max_size > 0 && (size_t)(p - parser->cur) > (max_size - buf_size)) {
  ------------------
  |  Branch (232:6): [True: 71.2k, False: 0]
  |  Branch (232:22): [True: 498, False: 70.7k]
  ------------------
  233|    498|		smtp_command_parser_error(
  234|    498|			parser, SMTP_COMMAND_PARSE_ERROR_LINE_TOO_LONG,
  235|    498|			"%s line is too long",
  236|    498|			(parser->auth_response ? "AUTH response" : "Command"));
  ------------------
  |  Branch (236:5): [True: 0, False: 498]
  ------------------
  237|    498|		return -1;
  238|    498|	}
  239|  70.7k|	parser->state.poff = p - parser->cur;
  240|  70.7k|	if (p == parser->end || nch == 0) {
  ------------------
  |  Branch (240:6): [True: 1.18k, False: 69.5k]
  |  Branch (240:26): [True: 145, False: 69.4k]
  ------------------
  241|       |		/* Parsed up to end of what is currently buffered in the input
  242|       |		   stream. */
  243|  1.33k|		unsigned int ch_size = (p == parser->end ?
  ------------------
  |  Branch (243:27): [True: 1.18k, False: 145]
  ------------------
  244|  1.18k|					0 : uni_utf8_char_bytes(*p));
  245|  1.33k|		size_t max_input = i_stream_get_max_buffer_size(parser->input);
  246|       |
  247|       |		/* Move parsed data to parser's line buffer if the input stream
  248|       |		   buffer is full. This can happen when the parser's limits
  249|       |		   exceed the input stream max buffer size. */
  250|  1.33k|		if ((parser->state.poff + ch_size) >= max_input) {
  ------------------
  |  Branch (250:7): [True: 0, False: 1.33k]
  ------------------
  251|      0|			if (parser->line_buffer == NULL) {
  ------------------
  |  Branch (251:8): [True: 0, False: 0]
  ------------------
  252|      0|				buf_size = (max_input < SIZE_MAX / 2 ?
  ------------------
  |  Branch (252:17): [True: 0, False: 0]
  ------------------
  253|      0|					    max_input * 2 : SIZE_MAX);
  254|      0|				buf_size = I_MAX(buf_size, 2048);
  ------------------
  |  |   36|      0|#define I_MAX(a, b)  (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  255|      0|				buf_size = I_MIN(buf_size, max_size);
  ------------------
  |  |   35|      0|#define I_MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  256|       |
  257|      0|				parser->line_buffer = buffer_create_dynamic(
  258|      0|					default_pool, buf_size);
  259|      0|			}
  260|      0|			if (parser->auth_response)
  ------------------
  |  Branch (260:8): [True: 0, False: 0]
  ------------------
  261|      0|				parser->auth_response_buffered = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  262|      0|			buffer_append(parser->line_buffer, parser->cur,
  263|      0|				      (p - parser->cur));
  264|       |
  265|      0|			parser->cur = p;
  266|      0|			parser->state.poff = 0;
  267|      0|		}
  268|  1.33k|		return 0;
  269|  1.33k|	}
  270|       |
  271|       |	/* In the interest of improved interoperability, SMTP receivers SHOULD
  272|       |	   tolerate trailing white space before the terminating <CRLF>.
  273|       |
  274|       |	   WSP =  SP / HTAB ; white space
  275|       |
  276|       |	   --> Trim the end of the buffer
  277|       |	 */
  278|  69.4k|	mp = p;
  279|  69.4k|	if (mp > parser->cur) {
  ------------------
  |  Branch (279:6): [True: 68.3k, False: 1.09k]
  ------------------
  280|   162k|		while (mp > parser->cur && (*(mp-1) == ' ' || *(mp-1) == '\t'))
  ------------------
  |  Branch (280:10): [True: 161k, False: 303]
  |  Branch (280:31): [True: 93.6k, False: 68.2k]
  |  Branch (280:49): [True: 206, False: 68.0k]
  ------------------
  281|  93.8k|			mp--;
  282|  68.3k|	}
  283|       |
  284|  69.4k|	if (!parser->auth_response && mp > parser->cur && *parser->cur == ' ') {
  ------------------
  |  Branch (284:6): [True: 69.4k, False: 0]
  |  Branch (284:32): [True: 68.0k, False: 1.39k]
  |  Branch (284:52): [True: 532, False: 67.4k]
  ------------------
  285|    532|		smtp_command_parser_error(
  286|    532|			parser, SMTP_COMMAND_PARSE_ERROR_BAD_COMMAND,
  287|    532|			"Duplicate space after command name");
  288|    532|		return -1;
  289|    532|	}
  290|       |
  291|  68.8k|	if (parser->auth_response)
  ------------------
  |  Branch (291:6): [True: 0, False: 68.8k]
  ------------------
  292|      0|		parser->auth_response_buffered = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  293|  68.8k|	if (parser->line_buffer == NULL) {
  ------------------
  |  Branch (293:6): [True: 68.8k, False: 0]
  ------------------
  294|       |		/* Buffered only in input stream */
  295|  68.8k|		parser->state.cmd_params = i_strdup_until(parser->cur, mp);
  296|  68.8k|	} else {
  297|       |		/* Buffered also in the parser */
  298|      0|		buffer_append(parser->line_buffer, parser->cur,
  299|      0|			      (mp - parser->cur));
  300|      0|		parser->state.cmd_params =
  301|      0|			buffer_free_without_data(&parser->line_buffer);
  302|      0|	}
  303|  68.8k|	parser->cur = p;
  304|  68.8k|	parser->state.poff = 0;
  305|  68.8k|	return 1;
  306|  69.4k|}

smtp-server-connection.c:smtp_protocol_name:
   23|  6.21k|{
   24|  6.21k|	switch (proto) {
   25|  6.21k|	case SMTP_PROTOCOL_SMTP:
  ------------------
  |  Branch (25:2): [True: 6.21k, False: 0]
  ------------------
   26|  6.21k|		return "smtp";
   27|      0|	case SMTP_PROTOCOL_LMTP:
  ------------------
  |  Branch (27:2): [True: 0, False: 6.21k]
  ------------------
   28|      0|		return "lmtp";
   29|      0|	default:
  ------------------
  |  Branch (29:2): [True: 0, False: 6.21k]
  ------------------
   30|      0|		break;
   31|  6.21k|	}
   32|      0|	i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
   33|  6.21k|}
smtp-server.c:smtp_protocol_name:
   23|  6.21k|{
   24|  6.21k|	switch (proto) {
   25|  6.21k|	case SMTP_PROTOCOL_SMTP:
  ------------------
  |  Branch (25:2): [True: 6.21k, False: 0]
  ------------------
   26|  6.21k|		return "smtp";
   27|      0|	case SMTP_PROTOCOL_LMTP:
  ------------------
  |  Branch (27:2): [True: 0, False: 6.21k]
  ------------------
   28|      0|		return "lmtp";
   29|      0|	default:
  ------------------
  |  Branch (29:2): [True: 0, False: 6.21k]
  ------------------
   30|      0|		break;
   31|  6.21k|	}
   32|      0|	i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
   33|  6.21k|}

smtp_param_parse:
   72|  9.61k|{
   73|  9.61k|	struct smtp_parser parser;
   74|       |
   75|  9.61k|	i_zero(param_r);
  ------------------
  |  |  249|  9.61k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  9.61k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  9.61k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   76|       |
   77|  9.61k|	if (text == NULL || *text == '\0') {
  ------------------
  |  Branch (77:6): [True: 0, False: 9.61k]
  |  Branch (77:22): [True: 358, False: 9.25k]
  ------------------
   78|    358|		if (error_r != NULL)
  ------------------
  |  Branch (78:7): [True: 358, False: 0]
  ------------------
   79|    358|			*error_r = "Parameter is empty";
   80|    358|		return -1;
   81|    358|	}
   82|       |
   83|  9.25k|	smtp_parser_init(&parser, pool, text);
   84|       |
   85|  9.25k|	if (smtp_param_do_parse(&parser, param_r) <= 0) {
  ------------------
  |  Branch (85:6): [True: 2.25k, False: 7.00k]
  ------------------
   86|  2.25k|		if (error_r != NULL)
  ------------------
  |  Branch (86:7): [True: 2.25k, False: 0]
  ------------------
   87|  2.25k|			*error_r = parser.error;
   88|  2.25k|		return -1;
   89|  2.25k|	}
   90|  7.00k|	return 1;
   91|  9.25k|}
smtp_params_copy:
   97|  16.7k|{
   98|  16.7k|	const struct smtp_param *param;
   99|       |
  100|  16.7k|	if (!array_is_created(src))
  ------------------
  |  |  176|  16.7k|	array_is_created_i(&(array)->arr)
  ------------------
  |  Branch (100:6): [True: 16.7k, False: 0]
  ------------------
  101|  16.7k|		return;
  102|       |
  103|      0|	p_array_init(dst, pool, array_count(src));
  ------------------
  |  |   44|      0|	array_create(array, pool, sizeof(**(array)->v), init_count)
  |  |  ------------------
  |  |  |  |  152|      0|	array_create_i(&(array)->arr, pool, element_size, init_count)
  |  |  ------------------
  ------------------
  104|      0|	array_foreach(src, param) {
  ------------------
  |  |   83|      0|	for (const void *elem ## __foreach_end = \
  |  |   84|      0|		(const char *)(elem = *(array)->v) + (array)->arr.buffer->used; \
  |  |   85|      0|	     elem != elem ## __foreach_end; (elem)++)
  |  |  ------------------
  |  |  |  Branch (85:7): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  105|      0|		struct smtp_param param_new;
  106|       |
  107|      0|		param_new.keyword = p_strdup(pool, param->keyword);
  108|      0|		param_new.value = p_strdup(pool, param->value);
  109|      0|		array_push_back(dst, &param_new);
  ------------------
  |  |  282|      0|#define array_push_back(array, item) array_append(array, (item), 1)
  |  |  ------------------
  |  |  |  |  214|      0|	TYPE_CHECKS(void, ARRAY_TYPE_CHECK(array, data), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|	(FALSE ? (return_type)(checks) : (func))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (11:17): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:25): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  215|      0|	array_append_i(&(array)->arr, data, count))
  |  |  ------------------
  ------------------
  110|      0|	}
  111|      0|}
smtp_params_mail_parse:
  491|  12.6k|{
  492|  12.6k|	struct smtp_params_mail_parser pmparser;
  493|  12.6k|	struct smtp_param param;
  494|  12.6k|	const char *const *argv;
  495|  12.6k|	const char *error;
  496|  12.6k|	int ret = 0;
  497|       |
  498|  12.6k|	i_zero(params_r);
  ------------------
  |  |  249|  12.6k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  12.6k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  12.6k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  499|       |
  500|  12.6k|	i_zero(&pmparser);
  ------------------
  |  |  249|  12.6k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  12.6k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  12.6k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  501|  12.6k|	pmparser.pool = pool;
  502|  12.6k|	pmparser.params = params_r;
  503|  12.6k|	pmparser.caps = caps;
  504|       |
  505|  12.6k|	argv = t_strsplit(args, " ");
  506|  14.6k|	for (; *argv != NULL; argv++) {
  ------------------
  |  Branch (506:9): [True: 8.81k, False: 5.86k]
  ------------------
  507|  8.81k|		if (smtp_param_parse(pool_datastack_create(), *argv,
  ------------------
  |  Branch (507:7): [True: 2.41k, False: 6.40k]
  ------------------
  508|  8.81k|				     &param, &error) < 0) {
  509|  2.41k|			*error_r = t_strdup_printf(
  510|  2.41k|				"Invalid MAIL parameter: %s", error);
  511|  2.41k|			*error_code_r = SMTP_PARAM_PARSE_ERROR_BAD_SYNTAX;
  512|  2.41k|			return -1;
  513|  2.41k|		}
  514|       |
  515|       |		/* parse known parameters */
  516|  6.40k|		param.keyword = t_str_ucase(param.keyword);
  517|  6.40k|		if ((caps & SMTP_CAPABILITY_AUTH) != 0 &&
  ------------------
  |  Branch (517:7): [True: 0, False: 6.40k]
  ------------------
  518|  6.40k|		    strcmp(param.keyword, "AUTH") == 0) {
  ------------------
  |  Branch (518:7): [True: 0, False: 0]
  ------------------
  519|      0|			if (smtp_params_mail_parse_auth(
  ------------------
  |  Branch (519:8): [True: 0, False: 0]
  ------------------
  520|      0|				&pmparser, param.value) < 0) {
  521|      0|				ret = -1;
  522|      0|				break;
  523|      0|			}
  524|  6.40k|		} else if (strcmp(param.keyword, "BODY") == 0) {
  ------------------
  |  Branch (524:14): [True: 1.80k, False: 4.60k]
  ------------------
  525|  1.80k|			if (smtp_params_mail_parse_body(&pmparser, param.value,
  ------------------
  |  Branch (525:8): [True: 957, False: 844]
  ------------------
  526|  1.80k|							body_extensions) < 0) {
  527|    957|				ret = -1;
  528|    957|				break;
  529|    957|			}
  530|  4.60k|		} else if ((caps & SMTP_CAPABILITY_DSN) != 0 &&
  ------------------
  |  Branch (530:14): [True: 0, False: 4.60k]
  ------------------
  531|  4.60k|			   strcmp(param.keyword, "ENVID") == 0) {
  ------------------
  |  Branch (531:7): [True: 0, False: 0]
  ------------------
  532|      0|			if (smtp_params_mail_parse_envid(&pmparser,
  ------------------
  |  Branch (532:8): [True: 0, False: 0]
  ------------------
  533|      0|							 param.value) < 0) {
  534|      0|				ret = -1;
  535|      0|				break;
  536|      0|			}
  537|  4.60k|		} else if ((caps & SMTP_CAPABILITY_DSN) != 0 &&
  ------------------
  |  Branch (537:14): [True: 0, False: 4.60k]
  ------------------
  538|  4.60k|			   strcmp(param.keyword, "RET") == 0) {
  ------------------
  |  Branch (538:7): [True: 0, False: 0]
  ------------------
  539|      0|			if (smtp_params_mail_parse_ret(&pmparser,
  ------------------
  |  Branch (539:8): [True: 0, False: 0]
  ------------------
  540|      0|						       param.value) < 0) {
  541|      0|				ret = -1;
  542|      0|				break;
  543|      0|			}
  544|       |#ifdef EXPERIMENTAL_MAIL_UTF8
  545|       |		} else if (strcmp(param.keyword, "SMTPUTF8") == 0) {
  546|       |			if ((caps & SMTP_CAPABILITY_SMTPUTF8) != 0) {
  547|       |				params_r->smtputf8 = TRUE;
  548|       |			} else {
  549|       |				*error_r = "Message requires SMTPUTF8, "
  550|       |					   "but next-hop server does not support that";
  551|       |				*error_code_r = SMTP_PARAM_PARSE_ERROR_NOT_SUPPORTED;
  552|       |				return -1;
  553|       |			}
  554|       |#endif
  555|  4.60k|		} else if ((caps & SMTP_CAPABILITY_SIZE) != 0 &&
  ------------------
  |  Branch (555:14): [True: 4.60k, False: 0]
  ------------------
  556|  4.60k|			   strcmp(param.keyword, "SIZE") == 0) {
  ------------------
  |  Branch (556:7): [True: 2.51k, False: 2.08k]
  ------------------
  557|  2.51k|			if (smtp_params_mail_parse_size(&pmparser,
  ------------------
  |  Branch (557:8): [True: 1.32k, False: 1.19k]
  ------------------
  558|  2.51k|							param.value) < 0) {
  559|  1.32k|				ret = -1;
  560|  1.32k|				break;
  561|  1.32k|			}
  562|  2.51k|		} else if (extensions != NULL &&
  ------------------
  |  Branch (562:14): [True: 0, False: 2.08k]
  ------------------
  563|  2.08k|			   str_array_icase_find(extensions, param.keyword)) {
  ------------------
  |  Branch (563:7): [True: 0, False: 0]
  ------------------
  564|       |			/* add the rest to ext_param for specific
  565|       |			   applications */
  566|      0|			smtp_params_mail_add_extra(params_r, pool,
  567|      0|						   param.keyword, param.value);
  568|  2.08k|		} else {
  569|       |			/* RFC 5321, Section 4.1.1.11:
  570|       |			   If the server SMTP does not recognize or cannot
  571|       |			   implement one or more of the parameters associated
  572|       |			   with a particular MAIL FROM or RCPT TO command, it
  573|       |			   will return code 555. */
  574|  2.08k|			*error_r = "Unsupported parameters";
  575|  2.08k|			*error_code_r = SMTP_PARAM_PARSE_ERROR_NOT_SUPPORTED;
  576|  2.08k|			return -1;
  577|  2.08k|		}
  578|  6.40k|	}
  579|       |
  580|  8.14k|	if (ret < 0) {
  ------------------
  |  Branch (580:6): [True: 2.28k, False: 5.86k]
  ------------------
  581|  2.28k|		*error_r = pmparser.error;
  582|  2.28k|		*error_code_r = pmparser.error_code;
  583|  2.28k|	}
  584|  8.14k|	return ret;
  585|  12.6k|}
smtp_params_mail_copy:
  591|  4.54k|{
  592|  4.54k|	i_zero(dst);
  ------------------
  |  |  249|  4.54k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  4.54k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  4.54k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  593|       |
  594|  4.54k|	if (src == NULL)
  ------------------
  |  Branch (594:6): [True: 0, False: 4.54k]
  ------------------
  595|      0|		return;
  596|       |
  597|  4.54k|	dst->auth = smtp_address_clone(pool, src->auth);
  598|  4.54k|	dst->body.type = src->body.type;
  599|  4.54k|	dst->body.ext = p_strdup(pool, src->body.ext);
  600|  4.54k|	dst->envid = p_strdup(pool, src->envid);
  601|  4.54k|	dst->ret = src->ret;
  602|  4.54k|	dst->size = src->size;
  603|  4.54k|	dst->smtputf8 = src->smtputf8;
  604|       |
  605|  4.54k|	smtp_params_copy(pool, &dst->extra_params, &src->extra_params);
  606|  4.54k|}
smtp_params_mail_add_to_event:
  872|  4.54k|{
  873|  4.54k|	smtp_params_mail_add_auth_to_event(params, event);
  874|  4.54k|	smtp_params_mail_add_body_to_event(params, event);
  875|  4.54k|	smtp_params_mail_add_envid_to_event(params, event);
  876|  4.54k|	smtp_params_mail_add_ret_to_event(params, event);
  877|  4.54k|	smtp_params_mail_add_size_to_event(params, event);
  878|  4.54k|}
smtp_params_rcpt_parse:
 1105|  12.9k|{
 1106|  12.9k|	struct smtp_params_rcpt_parser prparser;
 1107|  12.9k|	struct smtp_param param;
 1108|  12.9k|	const char *const *argv;
 1109|  12.9k|	const char *error;
 1110|  12.9k|	int ret = 0;
 1111|       |
 1112|  12.9k|	i_zero(params_r);
  ------------------
  |  |  249|  12.9k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  12.9k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  12.9k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1113|       |
 1114|  12.9k|	i_zero(&prparser);
  ------------------
  |  |  249|  12.9k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  12.9k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  12.9k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1115|  12.9k|	prparser.pool = pool;
 1116|  12.9k|	prparser.params = params_r;
 1117|  12.9k|	prparser.flags = flags;
 1118|  12.9k|	prparser.caps = caps;
 1119|       |
 1120|  12.9k|	argv = t_strsplit(args, " ");
 1121|  12.9k|	for (; *argv != NULL; argv++) {
  ------------------
  |  Branch (1121:9): [True: 800, False: 12.1k]
  ------------------
 1122|    800|		if (smtp_param_parse(pool_datastack_create(), *argv,
  ------------------
  |  Branch (1122:7): [True: 200, False: 600]
  ------------------
 1123|    800|				     &param, &error) < 0) {
 1124|    200|			*error_r = t_strdup_printf(
 1125|    200|				"Invalid RCPT parameter: %s", error);
 1126|    200|			*error_code_r = SMTP_PARAM_PARSE_ERROR_BAD_SYNTAX;
 1127|    200|			return -1;
 1128|    200|		}
 1129|       |
 1130|       |		/* parse known parameters */
 1131|    600|		param.keyword = t_str_ucase(param.keyword);
 1132|    600|		if ((caps & SMTP_CAPABILITY_DSN) != 0 &&
  ------------------
  |  Branch (1132:7): [True: 0, False: 600]
  ------------------
 1133|    600|		     strcmp(param.keyword, "NOTIFY") == 0) {
  ------------------
  |  Branch (1133:8): [True: 0, False: 0]
  ------------------
 1134|      0|			if (smtp_params_rcpt_parse_notify
  ------------------
  |  Branch (1134:8): [True: 0, False: 0]
  ------------------
 1135|      0|				(&prparser, param.value) < 0) {
 1136|      0|				ret = -1;
 1137|      0|				break;
 1138|      0|			}
 1139|    600|		} else if (((caps & SMTP_CAPABILITY_DSN) != 0 ||
  ------------------
  |  Branch (1139:15): [True: 0, False: 600]
  ------------------
 1140|    600|			    (caps & SMTP_CAPABILITY__ORCPT) != 0) &&
  ------------------
  |  Branch (1140:8): [True: 0, False: 600]
  ------------------
 1141|    600|			   strcmp(param.keyword, "ORCPT") == 0) {
  ------------------
  |  Branch (1141:7): [True: 0, False: 0]
  ------------------
 1142|      0|			if (smtp_params_rcpt_parse_orcpt
  ------------------
  |  Branch (1142:8): [True: 0, False: 0]
  ------------------
 1143|      0|				(&prparser, param.value) < 0) {
 1144|      0|				ret = -1;
 1145|      0|				break;
 1146|      0|			}
 1147|    600|		} else if (extensions != NULL &&
  ------------------
  |  Branch (1147:14): [True: 0, False: 600]
  ------------------
 1148|    600|			   str_array_icase_find(extensions, param.keyword)) {
  ------------------
  |  Branch (1148:7): [True: 0, False: 0]
  ------------------
 1149|       |			/* add the rest to ext_param for specific applications
 1150|       |			 */
 1151|      0|			smtp_params_rcpt_add_extra(params_r, pool,
 1152|      0|						   param.keyword, param.value);
 1153|    600|		} else {
 1154|       |			/* RFC 5321, Section 4.1.1.11:
 1155|       |			   If the server SMTP does not recognize or cannot
 1156|       |			   implement one or more of the parameters associated
 1157|       |			   with a particular MAIL FROM or RCPT TO command, it
 1158|       |			   will return code 555. */
 1159|    600|			*error_r = "Unsupported parameters";
 1160|    600|			*error_code_r = SMTP_PARAM_PARSE_ERROR_NOT_SUPPORTED;
 1161|    600|			return -1;
 1162|    600|		}
 1163|    600|	}
 1164|       |
 1165|  12.1k|	if (ret < 0) {
  ------------------
  |  Branch (1165:6): [True: 0, False: 12.1k]
  ------------------
 1166|      0|		*error_r = prparser.error;
 1167|      0|		*error_code_r = prparser.error_code;
 1168|      0|	}
 1169|  12.1k|	return ret;
 1170|  12.9k|}
smtp_params_rcpt_copy:
 1176|  12.1k|{
 1177|  12.1k|	i_zero(dst);
  ------------------
  |  |  249|  12.1k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  12.1k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  12.1k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1178|       |
 1179|  12.1k|	if (src == NULL)
  ------------------
  |  Branch (1179:6): [True: 0, False: 12.1k]
  ------------------
 1180|      0|		return;
 1181|       |
 1182|  12.1k|	dst->notify = src->notify;
 1183|  12.1k|	dst->orcpt.addr_type = p_strdup(pool, src->orcpt.addr_type);
 1184|  12.1k|	dst->orcpt.addr_raw = p_strdup(pool, src->orcpt.addr_raw);
 1185|  12.1k|	dst->orcpt.addr = smtp_address_clone(pool, src->orcpt.addr);
 1186|       |
 1187|  12.1k|	smtp_params_copy(pool, &dst->extra_params, &src->extra_params);
 1188|  12.1k|}
smtp_params_rcpt_add_to_event:
 1398|  12.1k|{
 1399|  12.1k|	smtp_params_rcpt_add_notify_to_event(params, event);
 1400|  12.1k|	smtp_params_rcpt_add_orcpt_to_event(params, event);
 1401|  12.1k|}
smtp-params.c:smtp_param_do_parse:
   24|  9.25k|{
   25|  9.25k|	const unsigned char *pbegin = parser->cur;
   26|       |
   27|       |	/* esmtp-param    = esmtp-keyword ["=" esmtp-value]
   28|       |	   esmtp-keyword  = (ALPHA / DIGIT) *(ALPHA / DIGIT / "-")
   29|       |	   esmtp-value    = 1*(%d33-60 / %d62-126)
   30|       |	                  ; any CHAR excluding "=", SP, and control
   31|       |	                  ; characters.  If this string is an email address,
   32|       |	                  ; i.e., a Mailbox, then the "xtext" syntax [32]
   33|       |	                  ; SHOULD be used.
   34|       |	 */
   35|       |
   36|  9.25k|	if (parser->cur >= parser->end || !i_isalnum(*parser->cur)) {
  ------------------
  |  |  104|  9.25k|#define i_isalnum(x) (isalnum((int) (unsigned char) (x)) != 0)
  ------------------
  |  Branch (36:6): [True: 0, False: 9.25k]
  |  Branch (36:36): [True: 1.01k, False: 8.24k]
  ------------------
   37|  1.01k|		parser->error = "Unexpected character in parameter keyword";
   38|  1.01k|		return -1;
   39|  1.01k|	}
   40|  8.24k|	parser->cur++;
   41|       |
   42|  25.2k|	while (parser->cur < parser->end &&
  ------------------
  |  Branch (42:9): [True: 21.4k, False: 3.76k]
  ------------------
   43|  25.2k|	       (i_isalnum(*parser->cur) || *parser->cur == '-'))
  ------------------
  |  |  104|  42.9k|#define i_isalnum(x) (isalnum((int) (unsigned char) (x)) != 0)
  |  |  ------------------
  |  |  |  Branch (104:22): [True: 16.7k, False: 4.66k]
  |  |  ------------------
  ------------------
  |  Branch (43:37): [True: 192, False: 4.47k]
  ------------------
   44|  16.9k|		parser->cur++;
   45|  8.24k|	param_r->keyword = t_strndup(pbegin, parser->cur - pbegin);
   46|       |
   47|  8.24k|	if (parser->cur >= parser->end) {
  ------------------
  |  Branch (47:6): [True: 3.76k, False: 4.47k]
  ------------------
   48|  3.76k|		param_r->value = NULL;
   49|  3.76k|		return 1;
   50|  3.76k|	}
   51|  4.47k|	if (*parser->cur != '=') {
  ------------------
  |  Branch (51:6): [True: 1.03k, False: 3.44k]
  ------------------
   52|  1.03k|		parser->error = "Unexpected character in parameter keyword";
   53|  1.03k|		return -1;
   54|  1.03k|	}
   55|  3.44k|	parser->cur++;
   56|       |
   57|  3.44k|	pbegin = parser->cur;
   58|  14.4k|	while (parser->cur < parser->end &&
  ------------------
  |  Branch (58:9): [True: 11.2k, False: 3.23k]
  ------------------
   59|  14.4k|	       smtp_char_is_esmtp_value(*parser->cur))
  ------------------
  |  Branch (59:9): [True: 11.0k, False: 206]
  ------------------
   60|  11.0k|		parser->cur++;
   61|       |
   62|  3.44k|	if (parser->cur < parser->end) {
  ------------------
  |  Branch (62:6): [True: 206, False: 3.23k]
  ------------------
   63|    206|		parser->error = "Unexpected character in parameter value";
   64|    206|		return -1;
   65|    206|	}
   66|  3.23k|	param_r->value = t_strndup(pbegin, parser->cur - pbegin);
   67|  3.23k|	return 1;
   68|  3.44k|}
smtp-params.c:smtp_params_mail_parse_body:
  321|  1.80k|{
  322|  1.80k|	struct smtp_params_mail *params = pmparser->params;
  323|  1.80k|	enum smtp_capability caps = pmparser->caps;
  324|       |
  325|       |	/* BODY=<type>: RFC 6152 */
  326|       |
  327|       |	/* cannot specify this multiple times */
  328|  1.80k|	if (params->body.type != SMTP_PARAM_MAIL_BODY_TYPE_UNSPECIFIED) {
  ------------------
  |  Branch (328:6): [True: 284, False: 1.51k]
  ------------------
  329|    284|		pmparser->error = "Duplicate BODY= parameter";
  330|    284|		pmparser->error_code = SMTP_PARAM_PARSE_ERROR_BAD_SYNTAX;
  331|    284|		return -1;
  332|    284|	}
  333|       |	/* value required */
  334|  1.51k|	if (value == NULL) {
  ------------------
  |  Branch (334:6): [True: 219, False: 1.29k]
  ------------------
  335|    219|		pmparser->error = "Missing BODY= parameter value";
  336|    219|		pmparser->error_code = SMTP_PARAM_PARSE_ERROR_BAD_SYNTAX;
  337|    219|		return -1;
  338|    219|	}
  339|       |
  340|  1.29k|	value = t_str_ucase(value);
  341|  1.29k|	params->body.ext = NULL;
  342|       |	/* =7BIT: RFC 6152 */
  343|  1.29k|	if (strcmp(value, "7BIT") == 0) {
  ------------------
  |  Branch (343:6): [True: 541, False: 757]
  ------------------
  344|    541|		params->body.type = SMTP_PARAM_MAIL_BODY_TYPE_7BIT;
  345|       |	/* =8BITMIME: RFC 6152 */
  346|    757|	} else if ((caps & SMTP_CAPABILITY_8BITMIME) != 0 &&
  ------------------
  |  Branch (346:13): [True: 757, False: 0]
  ------------------
  347|    757|		   strcmp(value, "8BITMIME") == 0) {
  ------------------
  |  Branch (347:6): [True: 303, False: 454]
  ------------------
  348|    303|		params->body.type = SMTP_PARAM_MAIL_BODY_TYPE_8BITMIME;
  349|       |	/* =BINARYMIME: RFC 3030 */
  350|    454|	} else if ((caps & SMTP_CAPABILITY_BINARYMIME) != 0 &&
  ------------------
  |  Branch (350:13): [True: 0, False: 454]
  ------------------
  351|    454|		   (caps & SMTP_CAPABILITY_CHUNKING) != 0 &&
  ------------------
  |  Branch (351:6): [True: 0, False: 0]
  ------------------
  352|    454|		   strcmp(value, "BINARYMIME") == 0) {
  ------------------
  |  Branch (352:6): [True: 0, False: 0]
  ------------------
  353|      0|		params->body.type = SMTP_PARAM_MAIL_BODY_TYPE_BINARYMIME;
  354|       |	/* =?? */
  355|    454|	} else if (extensions != NULL &&
  ------------------
  |  Branch (355:13): [True: 0, False: 454]
  ------------------
  356|    454|		   str_array_icase_find(extensions, value)) {
  ------------------
  |  Branch (356:6): [True: 0, False: 0]
  ------------------
  357|      0|		params->body.type = SMTP_PARAM_MAIL_BODY_TYPE_EXTENSION;
  358|      0|		params->body.ext = p_strdup(pmparser->pool, value);
  359|    454|	} else {
  360|    454|		pmparser->error = "Unsupported mail BODY type";
  361|    454|		pmparser->error_code = SMTP_PARAM_PARSE_ERROR_NOT_SUPPORTED;
  362|    454|		return -1;
  363|    454|	}
  364|    844|	return 0;
  365|  1.29k|}
smtp-params.c:smtp_params_mail_parse_size:
  457|  2.51k|{
  458|  2.51k|	struct smtp_params_mail *params = pmparser->params;
  459|       |
  460|       |	/* SIZE=<size-value>: RFC 1870 */
  461|       |
  462|       |	/* cannot specify this multiple times */
  463|  2.51k|	if (params->size != 0) {
  ------------------
  |  Branch (463:6): [True: 320, False: 2.19k]
  ------------------
  464|    320|		pmparser->error = "Duplicate SIZE= parameter";
  465|    320|		pmparser->error_code = SMTP_PARAM_PARSE_ERROR_BAD_SYNTAX;
  466|    320|		return -1;
  467|    320|	}
  468|       |	/* value required */
  469|  2.19k|	if (value == NULL) {
  ------------------
  |  Branch (469:6): [True: 350, False: 1.84k]
  ------------------
  470|    350|		pmparser->error = "Missing SIZE= parameter value";
  471|    350|		pmparser->error_code = SMTP_PARAM_PARSE_ERROR_BAD_SYNTAX;
  472|    350|		return -1;
  473|    350|	}
  474|       |
  475|       |	/* size-value ::= 1*20DIGIT */
  476|  1.84k|	if (str_to_uoff(value, &params->size) < 0) {
  ------------------
  |  Branch (476:6): [True: 658, False: 1.19k]
  ------------------
  477|    658|		pmparser->error = "Unsupported SIZE parameter value";
  478|    658|		pmparser->error_code = SMTP_PARAM_PARSE_ERROR_NOT_SUPPORTED;
  479|    658|		return -1;
  480|    658|	}
  481|  1.19k|	return 0;
  482|  1.84k|}
smtp-params.c:smtp_params_mail_add_auth_to_event:
  795|  4.54k|{
  796|       |	/* AUTH: RFC 4954 */
  797|  4.54k|	if (params->auth == NULL)
  ------------------
  |  Branch (797:6): [True: 4.54k, False: 0]
  ------------------
  798|  4.54k|		return;
  799|       |
  800|      0|	event_add_str(event, "mail_param_auth",
  801|      0|		      smtp_address_encode(params->auth));
  802|      0|}
smtp-params.c:smtp_params_mail_add_body_to_event:
  807|  4.54k|{
  808|       |	/* BODY: RFC 6152 */
  809|  4.54k|	switch (params->body.type) {
  810|  4.35k|	case SMTP_PARAM_MAIL_BODY_TYPE_UNSPECIFIED:
  ------------------
  |  Branch (810:2): [True: 4.35k, False: 193]
  ------------------
  811|  4.35k|		break;
  812|     73|	case SMTP_PARAM_MAIL_BODY_TYPE_7BIT:
  ------------------
  |  Branch (812:2): [True: 73, False: 4.47k]
  ------------------
  813|     73|		event_add_str(event, "mail_param_body", "7BIT");
  814|     73|		break;
  815|    120|	case SMTP_PARAM_MAIL_BODY_TYPE_8BITMIME:
  ------------------
  |  Branch (815:2): [True: 120, False: 4.42k]
  ------------------
  816|    120|		event_add_str(event, "mail_param_body", "8BITMIME");
  817|    120|		break;
  818|      0|	case SMTP_PARAM_MAIL_BODY_TYPE_BINARYMIME:
  ------------------
  |  Branch (818:2): [True: 0, False: 4.54k]
  ------------------
  819|      0|		event_add_str(event, "mail_param_body", "BINARYMIME");
  820|      0|		break;
  821|      0|	case SMTP_PARAM_MAIL_BODY_TYPE_EXTENSION:
  ------------------
  |  Branch (821:2): [True: 0, False: 4.54k]
  ------------------
  822|      0|		event_add_str(event, "mail_param_body", params->body.ext);
  823|      0|		break;
  824|      0|	default:
  ------------------
  |  Branch (824:2): [True: 0, False: 4.54k]
  ------------------
  825|      0|		i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
  826|  4.54k|	}
  827|  4.54k|}
smtp-params.c:smtp_params_mail_add_envid_to_event:
  832|  4.54k|{
  833|       |	/* ENVID: RFC 3461, Section 4.4 */
  834|  4.54k|	if (params->envid == NULL)
  ------------------
  |  Branch (834:6): [True: 4.54k, False: 0]
  ------------------
  835|  4.54k|		return;
  836|       |
  837|      0|	event_add_str(event, "mail_param_envid", params->envid);
  838|      0|}
smtp-params.c:smtp_params_mail_add_ret_to_event:
  843|  4.54k|{
  844|       |	/* RET: RFC 3461, Section 4.3 */
  845|  4.54k|	switch (params->ret) {
  846|  4.54k|	case SMTP_PARAM_MAIL_RET_UNSPECIFIED:
  ------------------
  |  Branch (846:2): [True: 4.54k, False: 0]
  ------------------
  847|  4.54k|		break;
  848|      0|	case SMTP_PARAM_MAIL_RET_HDRS:
  ------------------
  |  Branch (848:2): [True: 0, False: 4.54k]
  ------------------
  849|      0|		event_add_str(event, "mail_param_ret", "HDRS");
  850|      0|		break;
  851|      0|	case SMTP_PARAM_MAIL_RET_FULL:
  ------------------
  |  Branch (851:2): [True: 0, False: 4.54k]
  ------------------
  852|      0|		event_add_str(event, "mail_param_ret", "FULL");
  853|      0|		break;
  854|      0|	default:
  ------------------
  |  Branch (854:2): [True: 0, False: 4.54k]
  ------------------
  855|      0|		i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
  856|  4.54k|	}
  857|  4.54k|}
smtp-params.c:smtp_params_mail_add_size_to_event:
  862|  4.54k|{
  863|       |	/* SIZE: RFC 1870 */
  864|  4.54k|	if (params->size == 0)
  ------------------
  |  Branch (864:6): [True: 4.35k, False: 191]
  ------------------
  865|  4.35k|		return;
  866|       |
  867|    191|	event_add_int(event, "mail_param_size", params->size);
  868|    191|}
smtp-params.c:smtp_params_rcpt_add_notify_to_event:
 1350|  12.1k|{
 1351|       |	/* NOTIFY: RFC 3461, Section 4.1 */
 1352|  12.1k|	if (params->notify == SMTP_PARAM_RCPT_NOTIFY_UNSPECIFIED)
  ------------------
  |  Branch (1352:6): [True: 12.1k, False: 0]
  ------------------
 1353|  12.1k|		return;
 1354|      0|	if ((params->notify & SMTP_PARAM_RCPT_NOTIFY_NEVER) != 0) {
  ------------------
  |  Branch (1354:6): [True: 0, False: 0]
  ------------------
 1355|      0|		i_assert(params->notify ==
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1356|      0|			 SMTP_PARAM_RCPT_NOTIFY_NEVER);
 1357|      0|		event_add_str(event, "rcpt_param_notify", "NEVER");
 1358|      0|	} else {
 1359|      0|		string_t *str = t_str_new(32);
 1360|      0|		if ((params->notify & SMTP_PARAM_RCPT_NOTIFY_SUCCESS) != 0)
  ------------------
  |  Branch (1360:7): [True: 0, False: 0]
  ------------------
 1361|      0|			str_append(str, "SUCCESS");
 1362|      0|		if ((params->notify & SMTP_PARAM_RCPT_NOTIFY_FAILURE) != 0) {
  ------------------
  |  Branch (1362:7): [True: 0, False: 0]
  ------------------
 1363|      0|			if (str_len(str) > 0)
  ------------------
  |  Branch (1363:8): [True: 0, False: 0]
  ------------------
 1364|      0|				str_append_c(str, ',');
  ------------------
  |  |   54|      0|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|      0|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|      0|			(unsigned char)(chr), (chr)))
  ------------------
 1365|      0|			str_append(str, "FAILURE");
 1366|      0|		}
 1367|      0|		if ((params->notify & SMTP_PARAM_RCPT_NOTIFY_DELAY) != 0) {
  ------------------
  |  Branch (1367:7): [True: 0, False: 0]
  ------------------
 1368|      0|			if (str_len(str) > 0)
  ------------------
  |  Branch (1368:8): [True: 0, False: 0]
  ------------------
 1369|      0|				str_append_c(str, ',');
  ------------------
  |  |   54|      0|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|      0|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|      0|			(unsigned char)(chr), (chr)))
  ------------------
 1370|      0|			str_append(str, "DELAY");
 1371|      0|		}
 1372|      0|		event_add_str(event, "rcpt_param_notify", str_c(str));
 1373|      0|	}
 1374|      0|}
smtp-params.c:smtp_params_rcpt_add_orcpt_to_event:
 1379|  12.1k|{
 1380|       |	/* ORCPT: RFC 3461, Section 4.2 */
 1381|  12.1k|	if (params->orcpt.addr_type == NULL)
  ------------------
  |  Branch (1381:6): [True: 12.1k, False: 0]
  ------------------
 1382|  12.1k|		return;
 1383|       |
 1384|      0|	event_add_str(event, "rcpt_param_orcpt_type",
 1385|      0|		      params->orcpt.addr_type);
 1386|      0|	if (strcasecmp(params->orcpt.addr_type, "rfc822") == 0) {
  ------------------
  |  Branch (1386:6): [True: 0, False: 0]
  ------------------
 1387|      0|		event_add_str(event, "rcpt_param_orcpt",
 1388|      0|			      smtp_address_encode(params->orcpt.addr));
 1389|      0|	} else {
 1390|      0|		i_assert(params->orcpt.addr_raw != NULL);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1391|      0|		event_add_str(event, "rcpt_param_orcpt",
 1392|      0|			      params->orcpt.addr_raw);
 1393|      0|	}
 1394|      0|}

smtp_parser_init:
  122|  54.5k|{
  123|  54.5k|	parser->pool = pool;
  124|  54.5k|	parser->begin = parser->cur = (const unsigned char *)data;
  125|  54.5k|	parser->end = parser->begin + strlen(data);
  126|  54.5k|	parser->error = NULL;
  127|  54.5k|}
smtp_parser_parse_domain:
  165|  28.6k|{
  166|  28.6k|	string_t *value = NULL;
  167|       |
  168|       |	/* Domain     = sub-domain *("." sub-domain)
  169|       |	   sub-domain = Let-dig [Ldh-str]
  170|       |	   Let-dig    = ALPHA / DIGIT
  171|       |	   Ldh-str    = *( ALPHA / DIGIT / "-" ) Let-dig
  172|       |
  173|       |	   NOTE: A more generic syntax is accepted to be lenient towards
  174|       |	         systems that don't adhere to the standards. It allows
  175|       |	         '-' and '_' to occur anywhere in a sub-domain.
  176|       |	 */
  177|       |
  178|       |	/* Let-dig (first) (nope) */
  179|  28.6k|	if (parser->cur >= parser->end ||
  ------------------
  |  Branch (179:6): [True: 740, False: 27.8k]
  ------------------
  180|  28.6k|		(!i_isalnum(*parser->cur) && *parser->cur != '-' &&
  ------------------
  |  |  104|  55.7k|#define i_isalnum(x) (isalnum((int) (unsigned char) (x)) != 0)
  ------------------
  |  Branch (180:4): [True: 7.66k, False: 20.2k]
  |  Branch (180:32): [True: 6.24k, False: 1.42k]
  ------------------
  181|  27.8k|			*parser->cur != '_'))
  ------------------
  |  Branch (181:4): [True: 5.87k, False: 365]
  ------------------
  182|  6.61k|		return 0;
  183|       |
  184|  22.0k|	if (value_r != NULL)
  ------------------
  |  Branch (184:6): [True: 19.6k, False: 2.38k]
  ------------------
  185|  19.6k|		value = t_str_new(256);
  186|       |
  187|  23.5k|	for (;;) {
  188|       |		/* Let-dig (nope) */
  189|  23.5k|		if (parser->cur >= parser->end || *parser->cur == '.') {
  ------------------
  |  Branch (189:7): [True: 125, False: 23.3k]
  |  Branch (189:37): [True: 80, False: 23.3k]
  ------------------
  190|    205|			parser->error = "Empty sub-domain";
  191|    205|			return -1;
  192|    205|		}
  193|  23.3k|		if (!i_isalnum(*parser->cur) && *parser->cur != '-' &&
  ------------------
  |  |  104|  46.6k|#define i_isalnum(x) (isalnum((int) (unsigned char) (x)) != 0)
  ------------------
  |  Branch (193:7): [True: 2.53k, False: 20.7k]
  |  Branch (193:35): [True: 916, False: 1.61k]
  ------------------
  194|  23.3k|			*parser->cur != '_') {
  ------------------
  |  Branch (194:4): [True: 89, False: 827]
  ------------------
  195|     89|			parser->error = "Invalid character in domain";
  196|     89|			return -1;
  197|     89|		}
  198|  23.2k|		if (value_r != NULL)
  ------------------
  |  Branch (198:7): [True: 20.5k, False: 2.63k]
  ------------------
  199|  20.5k|			str_append_c(value, *parser->cur);
  ------------------
  |  |   54|  20.5k|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|  20.5k|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|  20.5k|			(unsigned char)(chr), (chr)))
  ------------------
  200|  23.2k|		parser->cur++;
  201|       |
  202|       |		/* Ldh-str (nope) */
  203|   163k|		while (parser->cur < parser->end) {
  ------------------
  |  Branch (203:10): [True: 161k, False: 2.52k]
  ------------------
  204|   161k|			if (!i_isalnum(*parser->cur) && *parser->cur != '-' &&
  ------------------
  |  |  104|   322k|#define i_isalnum(x) (isalnum((int) (unsigned char) (x)) != 0)
  ------------------
  |  Branch (204:8): [True: 36.0k, False: 125k]
  |  Branch (204:36): [True: 21.8k, False: 14.1k]
  ------------------
  205|   161k|				*parser->cur != '_')
  ------------------
  |  Branch (205:5): [True: 20.7k, False: 1.19k]
  ------------------
  206|  20.7k|				break;
  207|       |
  208|   140k|			if (value_r != NULL)
  ------------------
  |  Branch (208:8): [True: 140k, False: 541]
  ------------------
  209|   140k|				str_append_c(value, *parser->cur);
  ------------------
  |  |   54|   140k|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|   140k|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|   140k|			(unsigned char)(chr), (chr)))
  ------------------
  210|   140k|			parser->cur++;
  211|   140k|		}
  212|       |
  213|       |		/* *("." sub-domain) */
  214|  23.2k|		if (parser->cur >= parser->end || *parser->cur != '.')
  ------------------
  |  Branch (214:7): [True: 2.52k, False: 20.7k]
  |  Branch (214:37): [True: 19.2k, False: 1.50k]
  ------------------
  215|  21.7k|			break;
  216|       |
  217|  1.50k|		if (value_r != NULL)
  ------------------
  |  Branch (217:7): [True: 1.23k, False: 268]
  ------------------
  218|  1.23k|			str_append_c(value, '.');
  ------------------
  |  |   54|  1.23k|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|  1.23k|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|  1.23k|			(unsigned char)(chr), (chr)))
  ------------------
  219|  1.50k|		parser->cur++;
  220|  1.50k|	}
  221|       |
  222|  21.7k|	if (value_r != NULL)
  ------------------
  |  Branch (222:6): [True: 19.3k, False: 2.36k]
  ------------------
  223|  19.3k|		*value_r = str_c(value);
  224|  21.7k|	return 1;
  225|  22.0k|}
smtp_parser_parse_address_literal:
  292|  5.91k|{
  293|  5.91k|	const unsigned char *pblock;
  294|  5.91k|	struct in_addr ip4;
  295|  5.91k|	bool ipv6 = FALSE;
  ------------------
  |  |   11|  5.91k|#  define FALSE (!1)
  ------------------
  296|  5.91k|	string_t *value = NULL, *tagbuf;
  297|  5.91k|	int ret;
  298|       |
  299|       |	/* address-literal         = "[" ( IPv4-address-literal /
  300|       |	                            IPv6-address-literal /
  301|       |	                            General-address-literal ) "]"
  302|       |	                           ; See Section 4.1.3
  303|       |
  304|       |	   IPv6-address-literal    = "IPv6:" IPv6-addr
  305|       |	   General-address-literal = Standardized-tag ":" 1*dcontent
  306|       |	   Standardized-tag        = Ldh-str
  307|       |	                           ; Standardized-tag MUST be specified in a
  308|       |	                           ; Standards-Track RFC and registered with
  309|       |	                           ; IANA
  310|       |	   dcontent                = %d33-90 / ; Printable US-ASCII
  311|       |	                             %d94-126 ; excl. "[", "\", "]"
  312|       |	 */
  313|       |
  314|       |	/* "[" */
  315|  5.91k|	if (parser->cur >= parser->end || *parser->cur != '[')
  ------------------
  |  Branch (315:6): [True: 363, False: 5.55k]
  |  Branch (315:36): [True: 808, False: 4.74k]
  ------------------
  316|  1.17k|		return 0;
  317|  4.74k|	parser->cur++;
  318|       |
  319|  4.74k|	if (value_r != NULL) {
  ------------------
  |  Branch (319:6): [True: 4.74k, False: 0]
  ------------------
  320|  4.74k|		value = t_str_new(128);
  321|  4.74k|		str_append_c(value, '[');
  ------------------
  |  |   54|  4.74k|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|  4.74k|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|  4.74k|			(unsigned char)(chr), (chr)))
  ------------------
  322|  4.74k|	}
  323|  4.74k|	if (ip_r != NULL)
  ------------------
  |  Branch (323:6): [True: 0, False: 4.74k]
  ------------------
  324|      0|		i_zero(ip_r);
  ------------------
  |  |  249|      0|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  325|       |
  326|       |	/* IPv4-address-literal / ... */
  327|  4.74k|	i_zero(&ip4);
  ------------------
  |  |  249|  4.74k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  4.74k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  4.74k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  328|  4.74k|	if ((ret=smtp_parser_parse_ipv4_address(parser, value, &ip4)) != 0) {
  ------------------
  |  Branch (328:6): [True: 1.15k, False: 3.59k]
  ------------------
  329|  1.15k|		if (ret < 0) {
  ------------------
  |  Branch (329:7): [True: 671, False: 481]
  ------------------
  330|    671|			parser->error = "Invalid IPv4 address literal";
  331|    671|			return -1;
  332|    671|		}
  333|    481|		if (ip_r != NULL) {
  ------------------
  |  Branch (333:7): [True: 0, False: 481]
  ------------------
  334|      0|			ip_r->family = AF_INET;
  335|      0|			ip_r->u.ip4 = ip4;
  336|      0|		}
  337|       |
  338|       |	/* ... / IPv6-address-literal / General-address-literal */
  339|  3.59k|	} else {
  340|       |		/* IPv6-address-literal    = "IPv6:" IPv6-addr
  341|       |		   General-address-literal = Standardized-tag ":" 1*dcontent
  342|       |		   Standardized-tag        = Ldh-str
  343|       |		 */
  344|  3.59k|		if (value_r != NULL) {
  ------------------
  |  Branch (344:7): [True: 3.59k, False: 0]
  ------------------
  345|  3.59k|			tagbuf = value;
  346|  3.59k|		} else {
  347|      0|			tagbuf = t_str_new(16);
  348|      0|			str_append_c(tagbuf, '[');
  ------------------
  |  |   54|      0|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|      0|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|      0|			(unsigned char)(chr), (chr)))
  ------------------
  349|      0|		}
  350|  3.59k|		if (smtp_parser_parse_ldh_str(parser, tagbuf) <= 0 ||
  ------------------
  |  Branch (350:7): [True: 910, False: 2.68k]
  ------------------
  351|  3.59k|			parser->cur >= parser->end || *parser->cur != ':') {
  ------------------
  |  Branch (351:4): [True: 120, False: 2.56k]
  |  Branch (351:34): [True: 114, False: 2.44k]
  ------------------
  352|  1.14k|			parser->error = "Invalid address literal";
  353|  1.14k|			return -1;
  354|  1.14k|		}
  355|  2.44k|		if (strcasecmp(str_c(tagbuf)+1, "IPv6") == 0)
  ------------------
  |  Branch (355:7): [True: 2.06k, False: 389]
  ------------------
  356|  2.06k|			ipv6 = TRUE;
  ------------------
  |  |   15|  2.06k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  2.06k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  357|    389|		else if (value_r == NULL) {
  ------------------
  |  Branch (357:12): [True: 0, False: 389]
  ------------------
  358|      0|			parser->error = t_strdup_printf(
  359|      0|				"Unsupported %s address literal",
  360|      0|				str_c(tagbuf)+1);
  361|      0|			return -1;
  362|      0|		}
  363|  2.44k|		parser->cur++;
  364|  2.44k|		if (value_r != NULL)
  ------------------
  |  Branch (364:7): [True: 2.44k, False: 0]
  ------------------
  365|  2.44k|			str_append_c(value, ':');
  ------------------
  |  |   54|  2.44k|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|  2.44k|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|  2.44k|			(unsigned char)(chr), (chr)))
  ------------------
  366|       |
  367|       |		/* 1*dcontent */
  368|  2.44k|		pblock = parser->cur;
  369|  71.5k|		while (parser->cur < parser->end &&
  ------------------
  |  Branch (369:10): [True: 69.4k, False: 2.05k]
  ------------------
  370|  71.5k|			smtp_char_is_dcontent(*parser->cur))
  ------------------
  |  Branch (370:4): [True: 69.0k, False: 391]
  ------------------
  371|  69.0k|			parser->cur++;
  372|       |
  373|  2.44k|		if (parser->cur == pblock) {
  ------------------
  |  Branch (373:7): [True: 165, False: 2.28k]
  ------------------
  374|    165|			parser->error = "Empty address literal";
  375|    165|			return -1;
  376|    165|		}
  377|  2.28k|		if (value_r != NULL)
  ------------------
  |  Branch (377:7): [True: 2.28k, False: 0]
  ------------------
  378|  2.28k|			str_append_data(value, pblock, parser->cur - pblock);
  379|       |
  380|  2.28k|		if (ipv6) {
  ------------------
  |  Branch (380:7): [True: 1.99k, False: 290]
  ------------------
  381|  1.99k|			struct ip_addr ip;
  382|  1.99k|			if (net_addr2ip(t_strndup(pblock, parser->cur - pblock),
  ------------------
  |  Branch (382:8): [True: 1.31k, False: 682]
  ------------------
  383|  1.99k|					&ip) < 0) {
  384|  1.31k|				parser->error = "Invalid IPv6 address literal";
  385|  1.31k|				return -1;
  386|  1.31k|			}
  387|    682|			if (ip_r != NULL)
  ------------------
  |  Branch (387:8): [True: 0, False: 682]
  ------------------
  388|      0|				*ip_r = ip;
  389|    682|		}
  390|  2.28k|	}
  391|       |
  392|       |	/* ']' */
  393|  1.45k|	if (parser->cur >= parser->end) {
  ------------------
  |  Branch (393:6): [True: 1.12k, False: 331]
  ------------------
  394|  1.12k|		parser->error = "Missing ']' at end of address literal";
  395|  1.12k|		return -1;
  396|  1.12k|	} else if (*parser->cur != ']') {
  ------------------
  |  Branch (396:13): [True: 105, False: 226]
  ------------------
  397|    105|		parser->error = "Invalid character in address literal";
  398|    105|		return -1;
  399|    105|	}
  400|       |
  401|    226|	parser->cur++;
  402|    226|	if (value_r != NULL) {
  ------------------
  |  Branch (402:6): [True: 226, False: 0]
  ------------------
  403|    226|		str_append_c(value, ']');
  ------------------
  |  |   54|    226|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|    226|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|    226|			(unsigned char)(chr), (chr)))
  ------------------
  404|    226|		*value_r = str_c(value);
  405|    226|	}
  406|    226|	return 1;
  407|  1.45k|}
smtp_parser_parse_quoted_string:
  411|  36.1k|{
  412|  36.1k|	string_t *value = NULL;
  413|  36.1k|	const unsigned char *pbegin;
  414|       |
  415|       |	/* Quoted-string    = DQUOTE *QcontentSMTP DQUOTE
  416|       |	   QcontentSMTP     = qtextSMTP / quoted-pairSMTP
  417|       |	   quoted-pairSMTP  = %d92 %d32-126
  418|       |	                    ; i.e., backslash followed by any ASCII
  419|       |	                    ; graphic (including itself) or SPace
  420|       |	   qtextSMTP        = %d32-33 / %d35-91 / %d93-126
  421|       |	                    ; i.e., within a quoted string, any
  422|       |	                    ; ASCII graphic or space is permitted
  423|       |	                    ; without blackslash-quoting except
  424|       |	                    ; double-quote and the backslash itself.
  425|       |	 */
  426|       |
  427|       |	/* DQUOTE */
  428|  36.1k|	if (parser->cur >= parser->end || *parser->cur != '"')
  ------------------
  |  Branch (428:6): [True: 980, False: 35.1k]
  |  Branch (428:36): [True: 24.3k, False: 10.8k]
  ------------------
  429|  25.2k|		return 0;
  430|  10.8k|	parser->cur++;
  431|       |
  432|  10.8k|	if (value_r != NULL)
  ------------------
  |  Branch (432:6): [True: 10.8k, False: 0]
  ------------------
  433|  10.8k|		value = t_str_new(256);
  434|       |
  435|       |	/* *QcontentSMTP */
  436|  13.8k|	while (parser->cur < parser->end) {
  ------------------
  |  Branch (436:9): [True: 12.9k, False: 916]
  ------------------
  437|  12.9k|		pbegin = parser->cur;
  438|  1.26M|		while (parser->cur < parser->end &&
  ------------------
  |  Branch (438:10): [True: 1.26M, False: 444]
  ------------------
  439|  1.26M|			smtp_char_is_qtext(*parser->cur)) {
  ------------------
  |  Branch (439:4): [True: 1.25M, False: 12.4k]
  ------------------
  440|       |			/* qtextSMTP */
  441|  1.25M|			parser->cur++;
  442|  1.25M|		}
  443|       |
  444|  12.9k|		if (value_r != NULL)
  ------------------
  |  Branch (444:7): [True: 12.9k, False: 0]
  ------------------
  445|  12.9k|			str_append_data(value, pbegin, parser->cur - pbegin);
  446|       |
  447|  12.9k|		if (parser->cur >= parser->end || *parser->cur != '\\')
  ------------------
  |  Branch (447:7): [True: 444, False: 12.4k]
  |  Branch (447:37): [True: 8.66k, False: 3.80k]
  ------------------
  448|  9.10k|			break;
  449|  3.80k|		parser->cur++;
  450|       |
  451|       |		/* quoted-pairSMTP */
  452|  3.80k|		if (parser->cur >= parser->end ||
  ------------------
  |  Branch (452:7): [True: 244, False: 3.56k]
  ------------------
  453|  3.80k|			!smtp_char_is_qpair(*parser->cur)) {
  ------------------
  |  Branch (453:4): [True: 563, False: 2.99k]
  ------------------
  454|    807|			parser->error =
  455|    807|				"Invalid character after '\\' in quoted string";
  456|    807|			return -1;
  457|    807|		}
  458|       |
  459|  2.99k|		if (value_r != NULL)
  ------------------
  |  Branch (459:7): [True: 2.99k, False: 0]
  ------------------
  460|  2.99k|			str_append_c(value, *parser->cur);
  ------------------
  |  |   54|  2.99k|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|  2.99k|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|  2.99k|			(unsigned char)(chr), (chr)))
  ------------------
  461|  2.99k|		parser->cur++;
  462|  2.99k|	}
  463|       |
  464|       |	/* DQUOTE */
  465|  10.0k|	if (parser->cur >= parser->end)  {
  ------------------
  |  Branch (465:6): [True: 1.36k, False: 8.66k]
  ------------------
  466|  1.36k|		parser->error = "Premature end of quoted string";
  467|  1.36k|		return -1;
  468|  1.36k|	}
  469|  8.66k|	if (*parser->cur != '"') {
  ------------------
  |  Branch (469:6): [True: 385, False: 8.27k]
  ------------------
  470|    385|		parser->error = "Invalid character in quoted string";
  471|    385|		return -1;
  472|    385|	}
  473|  8.27k|	parser->cur++;
  474|  8.27k|	if (value_r != NULL)
  ------------------
  |  Branch (474:6): [True: 8.27k, False: 0]
  ------------------
  475|  8.27k|		*value_r = str_c(value);
  476|  8.27k|	return 1;
  477|  8.66k|}
smtp_parser_parse_atom:
  495|    739|{
  496|    739|	const unsigned char *pbegin = parser->cur;
  497|    739|	int ret;
  498|       |
  499|    739|	if ((ret=smtp_parser_skip_atom(parser)) <= 0)
  ------------------
  |  Branch (499:6): [True: 208, False: 531]
  ------------------
  500|    208|		return ret;
  501|       |
  502|    531|	if (value_r != NULL)
  ------------------
  |  Branch (502:6): [True: 531, False: 0]
  ------------------
  503|    531|		*value_r = t_strndup(pbegin, parser->cur - pbegin);
  504|    531|	return 1;
  505|    739|}
smtp_parser_parse_string:
  509|  3.02k|{
  510|  3.02k|	int ret;
  511|       |
  512|       |	/* String = Atom / Quoted-string */
  513|       |
  514|  3.02k|	if ((ret=smtp_parser_parse_quoted_string(parser, value_r)) != 0)
  ------------------
  |  Branch (514:6): [True: 2.28k, False: 739]
  ------------------
  515|  2.28k|		return ret;
  516|    739|	return smtp_parser_parse_atom(parser, value_r);
  517|  3.02k|}
smtp-parser.c:smtp_parser_parse_ipv4_address:
  261|  4.74k|{
  262|  4.74k|	uint8_t octet;
  263|  4.74k|	uint32_t ip = 0;
  264|  4.74k|	int ret;
  265|  4.74k|	int i;
  266|       |
  267|       |	/* IPv4-address-literal    = Snum 3("."  Snum) */
  268|  4.74k|	if ((ret = smtp_parser_parse_snum(parser, literal, &octet)) <= 0)
  ------------------
  |  Branch (268:6): [True: 3.73k, False: 1.00k]
  ------------------
  269|  3.73k|		return ret;
  270|  1.00k|	ip = octet;
  271|       |
  272|  1.93k|	for (i = 0; i < 3 && parser->cur < parser->end; i++) {
  ------------------
  |  Branch (272:14): [True: 1.73k, False: 199]
  |  Branch (272:23): [True: 1.45k, False: 282]
  ------------------
  273|  1.45k|		if (*parser->cur != '.')
  ------------------
  |  Branch (273:7): [True: 114, False: 1.34k]
  ------------------
  274|    114|			return -1;
  275|       |
  276|  1.34k|		if (literal != NULL)
  ------------------
  |  Branch (276:7): [True: 1.34k, False: 0]
  ------------------
  277|  1.34k|			str_append_c(literal, '.');
  ------------------
  |  |   54|  1.34k|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|  1.34k|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|  1.34k|			(unsigned char)(chr), (chr)))
  ------------------
  278|  1.34k|		parser->cur++;
  279|       |
  280|  1.34k|		if (smtp_parser_parse_snum(parser, literal, &octet) <= 0)
  ------------------
  |  Branch (280:7): [True: 414, False: 928]
  ------------------
  281|    414|			return -1;
  282|    928|		ip = (ip << 8) + octet;
  283|    928|	}
  284|       |
  285|    481|	if (ip4_r != NULL)
  ------------------
  |  Branch (285:6): [True: 481, False: 0]
  ------------------
  286|    481|		ip4_r->s_addr = htonl(ip);
  287|    481|	return 1;
  288|  1.00k|}
smtp-parser.c:smtp_parser_parse_snum:
  230|  6.08k|{
  231|  6.08k|	const unsigned char *pbegin = parser->cur;
  232|  6.08k|	uint8_t octet = 0;
  233|       |
  234|       |	/* Snum                    = 1*3DIGIT
  235|       |	                           ; representing a decimal integer
  236|       |	                           ; value in the range 0 through 255
  237|       |	 */
  238|       |
  239|  6.08k|	if (*parser->cur < '0' || *parser->cur > '9')
  ------------------
  |  Branch (239:6): [True: 1.06k, False: 5.02k]
  |  Branch (239:28): [True: 2.78k, False: 2.24k]
  ------------------
  240|  3.84k|		return 0;
  241|  4.22k|	do {
  242|  4.22k|		if (octet >= ((uint8_t)-1 / 10)) {
  ------------------
  |  Branch (242:7): [True: 615, False: 3.61k]
  ------------------
  243|    615|			if (octet > (uint8_t)-1 / 10)
  ------------------
  |  Branch (243:8): [True: 167, False: 448]
  ------------------
  244|    167|				return -1;
  245|    448|			if ((uint8_t)(*parser->cur - '0') > ((uint8_t)-1 % 10))
  ------------------
  |  Branch (245:8): [True: 137, False: 311]
  ------------------
  246|    137|				return -1;
  247|    448|		}
  248|  3.92k|		octet = octet * 10 + (*parser->cur - '0');
  249|  3.92k|		parser->cur++;
  250|  3.92k|	} while (*parser->cur >= '0' && *parser->cur <= '9');
  ------------------
  |  Branch (250:11): [True: 2.08k, False: 1.84k]
  |  Branch (250:34): [True: 1.98k, False: 94]
  ------------------
  251|       |
  252|  1.93k|	if (literal != NULL)
  ------------------
  |  Branch (252:6): [True: 1.93k, False: 0]
  ------------------
  253|  1.93k|		str_append_data(literal, pbegin, parser->cur - pbegin);
  254|  1.93k|	*octet_r = octet;
  255|  1.93k|	return 1;
  256|  2.24k|}
smtp-parser.c:smtp_parser_parse_ldh_str:
  136|  3.59k|{
  137|  3.59k|	const unsigned char *pbegin = parser->cur, *palnum;
  138|       |
  139|       |	/* Ldh-str = *( ALPHA / DIGIT / "-" ) Let-dig
  140|       |	   Let-dig = ALPHA / DIGIT
  141|       |	 */
  142|       |
  143|       |	/* Ldh-str */
  144|  3.59k|	palnum = NULL;
  145|  39.2k|	while (parser->cur < parser->end) {
  ------------------
  |  Branch (145:9): [True: 38.2k, False: 950]
  ------------------
  146|  38.2k|		if (i_isalnum(*parser->cur))
  ------------------
  |  |  104|  38.2k|#define i_isalnum(x) (isalnum((int) (unsigned char) (x)) != 0)
  |  |  ------------------
  |  |  |  Branch (104:22): [True: 31.8k, False: 6.46k]
  |  |  ------------------
  ------------------
  147|  31.8k|			palnum = parser->cur;
  148|  6.46k|		else if (*parser->cur != '-')
  ------------------
  |  Branch (148:12): [True: 2.64k, False: 3.81k]
  ------------------
  149|  2.64k|			break;
  150|  35.6k|		parser->cur++;
  151|  35.6k|	}
  152|  3.59k|	if (parser->cur == pbegin || palnum == NULL) {
  ------------------
  |  Branch (152:6): [True: 837, False: 2.75k]
  |  Branch (152:31): [True: 73, False: 2.68k]
  ------------------
  153|    910|		parser->cur = pbegin;
  154|    910|		return 0;
  155|    910|	}
  156|       |
  157|  2.68k|	parser->cur = palnum+1;
  158|  2.68k|	if (out != NULL)
  ------------------
  |  Branch (158:6): [True: 2.68k, False: 0]
  ------------------
  159|  2.68k|		str_append_data(out, pbegin, parser->cur - pbegin);
  160|  2.68k|	return 1;
  161|  3.59k|}
smtp-parser.c:smtp_parser_skip_atom:
  481|    739|{
  482|       |	/* Atom = 1*atext */
  483|       |
  484|    739|	if (parser->cur >= parser->end || !smtp_char_is_atext(*parser->cur))
  ------------------
  |  Branch (484:6): [True: 0, False: 739]
  |  Branch (484:36): [True: 208, False: 531]
  ------------------
  485|    208|		return 0;
  486|    531|	parser->cur++;
  487|       |
  488|  20.3k|	while (parser->cur < parser->end && smtp_char_is_atext(*parser->cur))
  ------------------
  |  Branch (488:9): [True: 19.7k, False: 524]
  |  Branch (488:38): [True: 19.7k, False: 7]
  ------------------
  489|  19.7k|		parser->cur++;
  490|    531|	return 1;
  491|    739|}

smtp-address.c:smtp_char_is_atext:
   25|  2.94M|smtp_char_is_atext(unsigned char ch) {
   26|  2.94M|	return (smtp_char_lookup[ch] & smtp_atext_char_mask) != 0;
   27|  2.94M|}
smtp-address.c:smtp_char_is_qpair:
   53|  61.4k|smtp_char_is_qpair(unsigned char ch) {
   54|  61.4k|	return (smtp_char_lookup[ch] & smtp_qpair_char_mask) != 0;
   55|  61.4k|}
smtp-address.c:smtp_char_is_qtext:
   33|  61.4k|smtp_char_is_qtext(unsigned char ch) {
   34|  61.4k|	return (smtp_char_lookup[ch] & smtp_qtext_char_mask) != 0;
   35|  61.4k|}
smtp-params.c:smtp_char_is_esmtp_value:
   41|  11.2k|smtp_char_is_esmtp_value(unsigned char ch) {
   42|  11.2k|	return (smtp_char_lookup[ch] & smtp_esmtp_value_char_mask) != 0;
   43|  11.2k|}
smtp-command-parser.c:smtp_char_is_textstr:
   37|  7.51M|smtp_char_is_textstr(unsigned char ch) {
   38|  7.51M|	return (smtp_char_lookup[ch] & smtp_textstr_char_mask) != 0;
   39|  7.51M|}
smtp-parser.c:smtp_char_is_dcontent:
   29|  69.4k|smtp_char_is_dcontent(unsigned char ch) {
   30|  69.4k|	return (smtp_char_lookup[ch] & smtp_dcontent_char_mask) != 0;
   31|  69.4k|}
smtp-parser.c:smtp_char_is_qtext:
   33|  1.26M|smtp_char_is_qtext(unsigned char ch) {
   34|  1.26M|	return (smtp_char_lookup[ch] & smtp_qtext_char_mask) != 0;
   35|  1.26M|}
smtp-parser.c:smtp_char_is_qpair:
   53|  3.56k|smtp_char_is_qpair(unsigned char ch) {
   54|  3.56k|	return (smtp_char_lookup[ch] & smtp_qpair_char_mask) != 0;
   55|  3.56k|}
smtp-parser.c:smtp_char_is_atext:
   25|  20.5k|smtp_char_is_atext(unsigned char ch) {
   26|  20.5k|	return (smtp_char_lookup[ch] & smtp_atext_char_mask) != 0;
   27|  20.5k|}

smtp_reply_parse_enhanced_code:
   95|    227|{
   96|    227|	const char *p = text;
   97|    227|	unsigned int digits, x, y, z;
   98|       |
   99|    227|	i_zero(enh_code_r);
  ------------------
  |  |  249|    227|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|    227|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|    227|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  100|       |
  101|       |	/* status-code ::= class "." subject "." detail
  102|       |	   class       ::= "2" / "4" / "5"
  103|       |	   subject     ::= 1*3digit
  104|       |	   detail      ::= 1*3digit
  105|       |	*/
  106|       |
  107|       |	/* class */
  108|    227|	if (p[1] != '.' || (p[0] != '2' && p[0] != '4' && p[0] != '5'))
  ------------------
  |  Branch (108:6): [True: 0, False: 227]
  |  Branch (108:22): [True: 227, False: 0]
  |  Branch (108:37): [True: 0, False: 227]
  |  Branch (108:52): [True: 0, False: 0]
  ------------------
  109|      0|		return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  110|    227|	x = p[0] - '0';
  111|    227|	p += 2;
  112|       |
  113|       |	/* subject */
  114|    227|	digits = 0;
  115|    227|	y = 0;
  116|    454|	while (*p != '\0' && i_isdigit(*p) && digits++ < 3) {
  ------------------
  |  |  109|    908|#define i_isdigit(x) (isdigit((int) (unsigned char) (x)) != 0)
  |  |  ------------------
  |  |  |  Branch (109:22): [True: 227, False: 227]
  |  |  ------------------
  ------------------
  |  Branch (116:9): [True: 454, False: 0]
  |  Branch (116:40): [True: 227, False: 0]
  ------------------
  117|    227|		y = y*10 + (*p - '0');
  118|    227|		p++;
  119|    227|	}
  120|    227|	if (digits == 0 || *p != '.')
  ------------------
  |  Branch (120:6): [True: 0, False: 227]
  |  Branch (120:21): [True: 0, False: 227]
  ------------------
  121|      0|		return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  122|    227|	p++;
  123|       |
  124|       |	/* detail */
  125|    227|	digits = 0;
  126|    227|	z = 0;
  127|    454|	while (*p != '\0' && i_isdigit(*p) && digits++ < 3) {
  ------------------
  |  |  109|    681|#define i_isdigit(x) (isdigit((int) (unsigned char) (x)) != 0)
  |  |  ------------------
  |  |  |  Branch (109:22): [True: 227, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (127:9): [True: 227, False: 227]
  |  Branch (127:40): [True: 227, False: 0]
  ------------------
  128|    227|		z = z*10 + (*p - '0');
  129|    227|		p++;
  130|    227|	}
  131|    227|	if (digits == 0 || (pos_r == NULL && *p != '\0'))
  ------------------
  |  Branch (131:6): [True: 0, False: 227]
  |  Branch (131:22): [True: 227, False: 0]
  |  Branch (131:39): [True: 0, False: 227]
  ------------------
  132|      0|		return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  133|       |
  134|    227|	if (pos_r != NULL) {
  ------------------
  |  Branch (134:6): [True: 0, False: 227]
  ------------------
  135|       |		/* code is syntactically valid; strip code from textstring */
  136|      0|		*pos_r = p;
  137|      0|	}
  138|       |
  139|    227|	enh_code_r->x = x;
  140|    227|	enh_code_r->y = y;
  141|    227|	enh_code_r->z = z;
  142|    227|	return TRUE;
  ------------------
  |  |   15|    227|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|    227|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  143|    227|}

smtp_reply_get_enh_code:
   34|    227|{
   35|    227|	if (reply->enhanced_code.x < 2)
  ------------------
  |  Branch (35:6): [True: 0, False: 227]
  ------------------
   36|      0|		return NULL;
   37|    227|	if (reply->enhanced_code.x >= 6)
  ------------------
  |  Branch (37:6): [True: 0, False: 227]
  ------------------
   38|      0|		return NULL;
   39|       |
   40|    227|	return t_strdup_printf("%u.%u.%u",
   41|    227|		reply->enhanced_code.x, reply->enhanced_code.y, reply->enhanced_code.z);
   42|    227|}
smtp_reply_write:
   66|    227|{
   67|    227|	const char *prefix, *enh_code;
   68|    227|	const char *const *lines;
   69|       |
   70|    227|	i_assert(reply->status < 560);
  ------------------
  |  |  219|    227|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    227|#  define STMT_START do
  |  |  ------------------
  |  |  220|    227|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    227|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 227]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 227]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    227|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    227|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    227|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   71|    227|	i_assert(reply->enhanced_code.x < 6);
  ------------------
  |  |  219|    227|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    227|#  define STMT_START do
  |  |  ------------------
  |  |  220|    227|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    227|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 227]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 227]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    227|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    227|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    227|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   72|       |
   73|    227|	prefix = t_strdup_printf("%03u", reply->status);
   74|    227|	enh_code = smtp_reply_get_enh_code(reply);
   75|       |
   76|    227|	if (reply->text_lines == NULL || *reply->text_lines == NULL) {
  ------------------
  |  Branch (76:6): [True: 0, False: 227]
  |  Branch (76:35): [True: 0, False: 227]
  ------------------
   77|      0|		str_append(out, prefix);
   78|      0|		if (enh_code != NULL) {
  ------------------
  |  Branch (78:7): [True: 0, False: 0]
  ------------------
   79|      0|			str_append_c(out, ' ');
  ------------------
  |  |   54|      0|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|      0|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|      0|			(unsigned char)(chr), (chr)))
  ------------------
   80|      0|			str_append(out, enh_code);
   81|      0|		}
   82|      0|		str_append(out, " \r\n");
   83|      0|		return;
   84|      0|	}
   85|       |
   86|    227|	lines = reply->text_lines;
   87|    454|	while (*lines != NULL) {
  ------------------
  |  Branch (87:9): [True: 227, False: 227]
  ------------------
   88|    227|		str_append(out, prefix);
   89|    227|		if (*(lines+1) == NULL)
  ------------------
  |  Branch (89:7): [True: 227, False: 0]
  ------------------
   90|    227|			str_append_c(out, ' ');
  ------------------
  |  |   54|    227|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|    227|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|    227|			(unsigned char)(chr), (chr)))
  ------------------
   91|      0|		else
   92|      0|			str_append_c(out, '-');
  ------------------
  |  |   54|      0|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|      0|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|      0|			(unsigned char)(chr), (chr)))
  ------------------
   93|    227|		if (enh_code != NULL) {
  ------------------
  |  Branch (93:7): [True: 227, False: 0]
  ------------------
   94|    227|			str_append(out, enh_code);
   95|    227|			str_append_c(out, ' ');
  ------------------
  |  |   54|    227|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|    227|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|    227|			(unsigned char)(chr), (chr)))
  ------------------
   96|    227|		}
   97|    227|		str_append(out, *lines);
   98|    227|		str_append(out, "\r\n");
   99|    227|		lines++;
  100|    227|	}
  101|    227|}

smtp_server_cmd_auth:
  187|  1.30k|{
  188|  1.30k|	struct smtp_server_connection *conn = cmd->conn;
  189|  1.30k|	struct smtp_server_command *command = cmd->cmd;
  190|  1.30k|	struct smtp_server_cmd_auth *auth_data;
  191|  1.30k|	const char *sasl_mech, *initial_response;
  192|  1.30k|	const char *const *argv;
  193|  1.30k|	int ret = 1;
  194|       |
  195|  1.30k|	if ((conn->set.capabilities & SMTP_CAPABILITY_AUTH) == 0) {
  ------------------
  |  Branch (195:6): [True: 1.30k, False: 0]
  ------------------
  196|  1.30k|		smtp_server_reply(cmd,
  197|  1.30k|			502, "5.5.1", "Unsupported command");
  198|  1.30k|		return;
  199|  1.30k|	}
  200|       |
  201|       |	/* RFC 4954, Section 8:
  202|       |
  203|       |	   auth-command     = "AUTH" SP sasl-mech [SP initial-response]
  204|       |	                      *(CRLF [base64]) [CRLF cancel-response]
  205|       |	                      CRLF
  206|       |	                      ;; <sasl-mech> is defined in [SASL]
  207|       |
  208|       |	   initial-response = base64 / "="
  209|       |	 */
  210|      0|	argv = t_strsplit(params, " ");
  211|      0|	initial_response = sasl_mech = NULL;
  212|      0|	if (argv[0] == NULL) {
  ------------------
  |  Branch (212:6): [True: 0, False: 0]
  ------------------
  213|      0|		smtp_server_reply(cmd,
  214|      0|			501, "5.5.4", "Missing SASL mechanism parameter");
  215|      0|		ret = -1;
  216|      0|	} else {
  217|      0|		sasl_mech = argv[0];
  218|       |
  219|      0|		if (argv[1] != NULL) {
  ------------------
  |  Branch (219:7): [True: 0, False: 0]
  ------------------
  220|      0|			if (argv[2] != NULL) {
  ------------------
  |  Branch (220:8): [True: 0, False: 0]
  ------------------
  221|      0|				smtp_server_reply(cmd,
  222|      0|					501, "5.5.4", "Invalid parameters");
  223|      0|				ret = -1;
  224|      0|			} else {
  225|      0|				initial_response = argv[1];
  226|      0|			}
  227|      0|		}
  228|      0|	}
  229|      0|	if (ret < 0)
  ------------------
  |  Branch (229:6): [True: 0, False: 0]
  ------------------
  230|      0|		return;
  231|       |
  232|       |	/* check protocol state */
  233|      0|	if (!cmd_auth_check_state(cmd))
  ------------------
  |  Branch (233:6): [True: 0, False: 0]
  ------------------
  234|      0|		return;
  235|       |
  236|      0|	smtp_server_command_input_lock(cmd);
  237|       |
  238|      0|	auth_data = p_new(cmd->pool, struct smtp_server_cmd_auth, 1);
  ------------------
  |  |   97|      0|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|      0|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|      0|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  239|      0|	auth_data->sasl_mech = p_strdup(cmd->pool, sasl_mech);
  240|      0|	auth_data->initial_response = p_strdup(cmd->pool, initial_response);
  241|       |
  242|      0|	smtp_server_command_add_hook(command, SMTP_SERVER_COMMAND_HOOK_NEXT,
  ------------------
  |  |  588|      0|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|      0|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|      0|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|      0|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|      0|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|      0|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
  243|      0|				     cmd_auth_start, auth_data);
  244|      0|	smtp_server_command_add_hook(command, SMTP_SERVER_COMMAND_HOOK_COMPLETED,
  ------------------
  |  |  588|      0|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|      0|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|      0|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|      0|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|      0|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|      0|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
  245|      0|				     cmd_auth_completed, auth_data);
  246|      0|}

smtp_server_cmd_data_check_size:
   35|  30.6k|{
   36|  30.6k|	struct smtp_server_connection *conn = cmd->conn;
   37|  30.6k|	const struct smtp_server_settings *set = &conn->set;
   38|       |
   39|  30.6k|	i_assert(conn->state.state == SMTP_SERVER_STATE_DATA);
  ------------------
  |  |  219|  30.6k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  30.6k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  30.6k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  30.6k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 30.6k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 30.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  30.6k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  30.6k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  30.6k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   40|       |
   41|  30.6k|	if (conn->state.data_input == NULL)
  ------------------
  |  Branch (41:6): [True: 0, False: 30.6k]
  ------------------
   42|      0|		return TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   43|  30.6k|	if (set->max_message_size == 0)
  ------------------
  |  Branch (43:6): [True: 30.6k, False: 0]
  ------------------
   44|  30.6k|		return TRUE;
  ------------------
  |  |   15|  30.6k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  30.6k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   45|      0|	if (conn->state.data_input->v_offset <= set->max_message_size)
  ------------------
  |  Branch (45:6): [True: 0, False: 0]
  ------------------
   46|      0|		return TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   47|       |
   48|      0|	smtp_server_cmd_data_size_limit_exceeded(cmd);
   49|      0|	return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
   50|      0|}
smtp_server_connection_data_check_state:
   53|  37.5k|{
   54|  37.5k|	struct smtp_server_connection *conn = cmd->conn;
   55|  37.5k|	struct smtp_server_command *command = cmd->cmd;
   56|  37.5k|	struct cmd_data_context *data_cmd = command->data;
   57|       |
   58|  37.5k|	if (conn->state.data_chunks > 0 && conn->state.data_failed) {
  ------------------
  |  Branch (58:6): [True: 33.4k, False: 4.17k]
  |  Branch (58:37): [True: 3.88k, False: 29.5k]
  ------------------
   59|       |		// FIXME: should it even reply anything? RFC is unclear.
   60|  3.88k|		smtp_server_command_fail(command, 503, "5.5.0",
   61|  3.88k|			"Previous data chunk failed, issue RSET first");
   62|  3.88k|		return FALSE;
  ------------------
  |  |   11|  3.88k|#  define FALSE (!1)
  ------------------
   63|  3.88k|	}
   64|       |
   65|       |	/* check valid MAIL */
   66|  33.7k|	if (conn->state.trans == NULL
  ------------------
  |  Branch (66:6): [True: 1.70k, False: 32.0k]
  ------------------
   67|  33.7k|		&& conn->state.pending_mail_cmds == 0) {
  ------------------
  |  Branch (67:6): [True: 995, False: 708]
  ------------------
   68|    995|		smtp_server_command_fail(command,
   69|    995|			503, "5.5.0", "MAIL needed first");
   70|    995|		return FALSE;
  ------------------
  |  |   11|    995|#  define FALSE (!1)
  ------------------
   71|    995|	}
   72|  32.7k|	if (conn->state.trans != NULL &&
  ------------------
  |  Branch (72:6): [True: 32.0k, False: 708]
  ------------------
   73|  32.7k|	    (conn->state.trans->params.body.type ==
  ------------------
  |  Branch (73:6): [True: 0, False: 32.0k]
  ------------------
   74|  32.0k|		SMTP_PARAM_MAIL_BODY_TYPE_BINARYMIME) &&
   75|  32.7k|	    !data_cmd->chunking) {
  ------------------
  |  Branch (75:6): [True: 0, False: 0]
  ------------------
   76|       |		/* RFC 3030, Section 3:
   77|       |		   BINARYMIME cannot be used with the DATA command. If a DATA
   78|       |		   command is issued after a MAIL command containing the
   79|       |		   body-value of "BINARYMIME", a 503 "Bad sequence of commands"
   80|       |		   response MUST be sent. The resulting state from this error
   81|       |		   condition is indeterminate and the transaction MUST be reset
   82|       |		   with the RSET command. */
   83|      0|		smtp_server_command_fail(command,
   84|      0|			503, "5.5.0", "DATA cannot be used with BINARYMIME");
   85|      0|		return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
   86|      0|	}
   87|       |
   88|       |	/* Can only decide whether we have valid recipients once there are no
   89|       |	   pending RCPT commands */
   90|  32.7k|	if (conn->state.pending_rcpt_cmds > 0)
  ------------------
  |  Branch (90:6): [True: 1.12k, False: 31.5k]
  ------------------
   91|  1.12k|		return TRUE;
  ------------------
  |  |   15|  1.12k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  1.12k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   92|       |
   93|       |	/* special handling for LMTP */
   94|  31.5k|	if (conn->set.protocol == SMTP_PROTOCOL_LMTP) {
  ------------------
  |  Branch (94:6): [True: 0, False: 31.5k]
  ------------------
   95|       |		/* check valid RCPT (at least one) */
   96|      0|		if (conn->state.trans == NULL ||
  ------------------
  |  Branch (96:7): [True: 0, False: 0]
  ------------------
   97|      0|		    !smtp_server_transaction_has_rcpt(conn->state.trans)) {
  ------------------
  |  Branch (97:7): [True: 0, False: 0]
  ------------------
   98|      0|			if (data_cmd->chunk_size > 0 && data_cmd->chunk_last) {
  ------------------
  |  Branch (98:8): [True: 0, False: 0]
  |  Branch (98:36): [True: 0, False: 0]
  ------------------
   99|       |				/* RFC 2033, Section 4.3:
  100|       |				   If there were no previously successful RCPT
  101|       |				   commands in the mail transaction, then the
  102|       |				   BDAT LAST command returns zero replies.
  103|       |				 */
  104|      0|				smtp_server_command_abort(&command);
  105|      0|			} else {
  106|       |				/* RFC 2033, Section 4.2:
  107|       |				   The additional restriction is that when there
  108|       |				   have been no successful RCPT commands in the
  109|       |				   mail transaction, the DATA command MUST fail
  110|       |				   with a 503 reply code.
  111|       |				*/
  112|      0|				smtp_server_command_fail(command,
  113|      0|					503, "5.5.0", "No valid recipients");
  114|      0|			}
  115|      0|			return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  116|      0|		}
  117|       |
  118|  31.5k|	} else {
  119|       |		/* check valid RCPT (at least one) */
  120|  31.5k|		if (conn->state.trans == NULL ||
  ------------------
  |  Branch (120:7): [True: 107, False: 31.4k]
  ------------------
  121|  31.5k|			!smtp_server_transaction_has_rcpt(conn->state.trans)) {
  ------------------
  |  Branch (121:4): [True: 719, False: 30.7k]
  ------------------
  122|    826|			smtp_server_command_fail(command,
  123|    826|				554, "5.5.0", "No valid recipients");
  124|    826|			return FALSE;
  ------------------
  |  |   11|    826|#  define FALSE (!1)
  ------------------
  125|    826|		}
  126|  31.5k|	}
  127|  30.7k|	return TRUE;
  ------------------
  |  |   15|  30.7k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  30.7k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  128|  31.5k|}
smtp_server_cmd_data:
  511|  3.80k|{
  512|  3.80k|	struct smtp_server_connection *conn = cmd->conn;
  513|  3.80k|	struct smtp_server_command *command = cmd->cmd;
  514|  3.80k|	struct cmd_data_context *data_cmd;
  515|       |
  516|       |	/* data = "DATA" CRLF */
  517|  3.80k|	if (*params != '\0') {
  ------------------
  |  Branch (517:6): [True: 204, False: 3.60k]
  ------------------
  518|    204|		smtp_server_reply(cmd,
  519|    204|			501, "5.5.4", "Invalid parameters");
  520|    204|		return;
  521|    204|	}
  522|       |
  523|  3.60k|	smtp_server_command_input_lock(cmd);
  524|       |
  525|  3.60k|	data_cmd = p_new(cmd->pool, struct cmd_data_context, 1);
  ------------------
  |  |   97|  3.60k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|  3.60k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|  3.60k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|  3.60k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  3.60k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  526|  3.60k|	data_cmd->chunk_first = TRUE;
  ------------------
  |  |   15|  3.60k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  3.60k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  527|  3.60k|	data_cmd->chunk_last = TRUE;
  ------------------
  |  |   15|  3.60k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  3.60k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  528|  3.60k|	data_cmd->client_input = TRUE;
  ------------------
  |  |   15|  3.60k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  3.60k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  529|  3.60k|	command->data = data_cmd;
  530|       |
  531|  3.60k|	smtp_server_command_add_hook(command, SMTP_SERVER_COMMAND_HOOK_NEXT,
  ------------------
  |  |  588|  3.60k|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|  3.60k|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|  3.60k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  3.60k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  3.60k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  3.60k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|  3.60k|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|  3.60k|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
  532|  3.60k|				     cmd_data_start, data_cmd);
  533|  3.60k|	smtp_server_command_add_hook(command, SMTP_SERVER_COMMAND_HOOK_REPLIED_ONE,
  ------------------
  |  |  588|  3.60k|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|  3.60k|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|  3.60k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  3.60k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  3.60k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  3.60k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|  3.60k|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|  3.60k|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
  534|  3.60k|				     cmd_data_replied_one, data_cmd);
  535|  3.60k|	smtp_server_command_add_hook(command, SMTP_SERVER_COMMAND_HOOK_REPLIED,
  ------------------
  |  |  588|  3.60k|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|  3.60k|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|  3.60k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  3.60k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  3.60k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  3.60k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|  3.60k|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|  3.60k|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
  536|  3.60k|				     cmd_data_replied, data_cmd);
  537|  3.60k|	smtp_server_command_add_hook(command, SMTP_SERVER_COMMAND_HOOK_DESTROY,
  ------------------
  |  |  588|  3.60k|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|  3.60k|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|  3.60k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  3.60k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  3.60k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  3.60k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|  3.60k|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|  3.60k|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
  538|  3.60k|				     cmd_data_destroy, data_cmd);
  539|       |
  540|  3.60k|	conn->state.pending_data_cmds++;
  541|  3.60k|}
smtp_server_connection_data_chunk_init:
  546|  17.4k|{
  547|  17.4k|	struct smtp_server_connection *conn = cmd->conn;
  548|  17.4k|	struct smtp_server_command *command = cmd->cmd;
  549|  17.4k|	struct cmd_data_context *data_cmd;
  550|       |
  551|  17.4k|	data_cmd = p_new(cmd->pool, struct cmd_data_context, 1);
  ------------------
  |  |   97|  17.4k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|  17.4k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|  17.4k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|  17.4k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  17.4k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  552|  17.4k|	data_cmd->chunking = TRUE;
  ------------------
  |  |   15|  17.4k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  17.4k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  553|  17.4k|	data_cmd->chunk_first = (conn->state.data_chunks++ == 0);
  554|  17.4k|	command->data = data_cmd;
  555|       |
  556|  17.4k|	smtp_server_command_add_hook(command, SMTP_SERVER_COMMAND_HOOK_REPLIED,
  ------------------
  |  |  588|  17.4k|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|  17.4k|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|  17.4k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  17.4k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  17.4k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  17.4k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|  17.4k|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|  17.4k|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
  557|  17.4k|				     cmd_data_chunk_replied, data_cmd);
  558|  17.4k|	smtp_server_command_add_hook(command, SMTP_SERVER_COMMAND_HOOK_DESTROY,
  ------------------
  |  |  588|  17.4k|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|  17.4k|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|  17.4k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  17.4k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  17.4k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  17.4k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|  17.4k|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|  17.4k|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
  559|  17.4k|				     cmd_data_destroy, data_cmd);
  560|       |
  561|  17.4k|	conn->state.pending_data_cmds++;
  562|       |
  563|  17.4k|	if (!conn->state.data_failed && conn->state.data_chain == NULL) {
  ------------------
  |  Branch (563:6): [True: 11.5k, False: 5.93k]
  |  Branch (563:34): [True: 2.61k, False: 8.93k]
  ------------------
  564|  2.61k|		i_assert(data_cmd->chunk_first);
  ------------------
  |  |  219|  2.61k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  2.61k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  2.61k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  2.61k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 2.61k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 2.61k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  2.61k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  2.61k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  2.61k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  565|  2.61k|		i_assert(conn->state.data_chain_input == NULL);
  ------------------
  |  |  219|  2.61k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  2.61k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  2.61k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  2.61k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 2.61k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 2.61k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  2.61k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  2.61k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  2.61k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  566|  2.61k|		conn->state.data_chain_input =
  567|  2.61k|			i_stream_create_chain(&conn->state.data_chain,
  568|  2.61k|					      IO_BLOCK_SIZE);
  ------------------
  |  |  169|  2.61k|#  define IO_BLOCK_SIZE 8192
  ------------------
  569|  2.61k|	}
  570|  17.4k|}
smtp_server_connection_data_chunk_add:
  575|  13.8k|{
  576|  13.8k|	struct smtp_server_connection *conn = cmd->conn;
  577|  13.8k|	struct smtp_server_transaction *trans = conn->state.trans;
  578|  13.8k|	const struct smtp_server_settings *set = &conn->set;
  579|  13.8k|	struct smtp_server_command *command = cmd->cmd;
  580|  13.8k|	struct cmd_data_context *data_cmd = command->data;
  581|  13.8k|	uoff_t new_size;
  582|       |
  583|  13.8k|	i_assert(chunk != NULL);
  ------------------
  |  |  219|  13.8k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  13.8k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  13.8k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  13.8k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 13.8k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 13.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  13.8k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  13.8k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  13.8k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  584|  13.8k|	i_assert(data_cmd != NULL);
  ------------------
  |  |  219|  13.8k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  13.8k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  13.8k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  13.8k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 13.8k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 13.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  13.8k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  13.8k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  13.8k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  585|       |
  586|  13.8k|	if (trans != NULL)
  ------------------
  |  Branch (586:6): [True: 9.44k, False: 4.37k]
  ------------------
  587|  9.44k|		smtp_server_transaction_data_command(trans, cmd);
  588|       |
  589|  13.8k|	if (!smtp_server_connection_data_check_state(cmd))
  ------------------
  |  Branch (589:6): [True: 4.28k, False: 9.53k]
  ------------------
  590|  4.28k|		return -1;
  591|       |
  592|       |	/* check message size increase early */
  593|  9.53k|	new_size = conn->state.data_size + chunk_size;
  594|  9.53k|	if (new_size < conn->state.data_size ||
  ------------------
  |  Branch (594:6): [True: 70, False: 9.46k]
  ------------------
  595|  9.53k|	    (set->max_message_size > 0 && new_size > set->max_message_size)) {
  ------------------
  |  Branch (595:7): [True: 0, False: 9.46k]
  |  Branch (595:36): [True: 0, False: 0]
  ------------------
  596|     70|		smtp_server_cmd_data_size_limit_exceeded(cmd);
  597|     70|		return -1;
  598|     70|	}
  599|  9.46k|	conn->state.data_size = new_size;
  600|       |
  601|  9.46k|	if (chunk_last) {
  ------------------
  |  Branch (601:6): [True: 89, False: 9.37k]
  ------------------
  602|     89|		smtp_server_command_remove_hook(
  ------------------
  |  |  596|     89|	smtp_server_command_remove_hook((_cmd), (_type), \
  |  |  597|     89|		(smtp_server_cmd_func_t *)(_func));
  ------------------
  603|     89|			command, SMTP_SERVER_COMMAND_HOOK_REPLIED,
  604|     89|			cmd_data_chunk_replied);
  605|     89|		smtp_server_command_add_hook(
  ------------------
  |  |  588|     89|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|     89|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|     89|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|     89|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|     89|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|     89|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|     89|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|     89|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
  606|     89|			command, SMTP_SERVER_COMMAND_HOOK_REPLIED,
  607|     89|			cmd_data_replied, data_cmd);
  608|     89|	}
  609|       |
  610|  9.46k|	data_cmd->chunk_input = chunk;
  611|  9.46k|	data_cmd->chunk_size = chunk_size;
  612|  9.46k|	data_cmd->chunk_last = chunk_last;
  613|  9.46k|	data_cmd->client_input = client_input;
  614|  9.46k|	i_stream_ref(chunk);
  615|       |
  616|  9.46k|	cmd_data_start_input(cmd, data_cmd, conn->state.data_chain_input);
  617|  9.46k|	i_stream_unref(&conn->state.data_chain_input);
  618|  9.46k|	return 0;
  619|  9.53k|}
smtp_server_cmd_bdat:
  625|  17.4k|{
  626|  17.4k|	struct smtp_server_connection *conn = cmd->conn;
  627|  17.4k|	struct istream *input = NULL;
  628|  17.4k|	uoff_t size = 0;
  629|  17.4k|	const char *const *argv;
  630|  17.4k|	bool chunk_last = FALSE;
  ------------------
  |  |   11|  17.4k|#  define FALSE (!1)
  ------------------
  631|  17.4k|	int ret = 1;
  632|       |
  633|  17.4k|	if ((conn->set.capabilities & SMTP_CAPABILITY_CHUNKING) == 0) {
  ------------------
  |  Branch (633:6): [True: 0, False: 17.4k]
  ------------------
  634|      0|		smtp_server_reply(cmd,
  635|      0|			502, "5.5.1", "Unsupported command");
  636|      0|		return;
  637|      0|	}
  638|       |
  639|  17.4k|	smtp_server_connection_data_chunk_init(cmd);
  640|       |
  641|       |	/* bdat-cmd   = "BDAT" SP chunk-size [ SP end-marker ] CR LF
  642|       |	   chunk-size = 1*DIGIT
  643|       |	   end-marker = "LAST"
  644|       |	 */
  645|  17.4k|	argv = t_strsplit(params, " ");
  646|  17.4k|	if (argv[0] == NULL || str_to_uoff(argv[0], &size) < 0) {
  ------------------
  |  Branch (646:6): [True: 1.47k, False: 15.9k]
  |  Branch (646:25): [True: 1.26k, False: 14.7k]
  ------------------
  647|  2.74k|		smtp_server_reply(cmd,
  648|  2.74k|			501, "5.5.4", "Invalid chunk size parameter");
  649|  2.74k|		size = 0;
  650|  2.74k|		ret = -1;
  651|  14.7k|	} else if (argv[1] != NULL) {
  ------------------
  |  Branch (651:13): [True: 1.20k, False: 13.5k]
  ------------------
  652|  1.20k|		if (argv[2] != NULL) {
  ------------------
  |  Branch (652:7): [True: 269, False: 932]
  ------------------
  653|    269|			smtp_server_reply(cmd,
  654|    269|				501, "5.5.4", "Invalid parameters");
  655|    269|			ret = -1;
  656|    932|		} else if (strcasecmp(argv[1], "LAST") != 0) {
  ------------------
  |  Branch (656:14): [True: 637, False: 295]
  ------------------
  657|    637|			smtp_server_reply(cmd,
  658|    637|				501, "5.5.4", "Invalid end marker parameter");
  659|    637|			ret = -1;
  660|    637|		} else {
  661|    295|			chunk_last = TRUE;
  ------------------
  |  |   15|    295|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|    295|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  662|    295|		}
  663|  1.20k|	}
  664|       |
  665|  17.4k|	if (ret > 0 || (size > 0 && !conn->disconnected)) {
  ------------------
  |  Branch (665:6): [True: 13.8k, False: 3.65k]
  |  Branch (665:18): [True: 456, False: 3.19k]
  |  Branch (665:30): [True: 453, False: 3]
  ------------------
  666|       |		/* Read/skip data even in case of error, as long as size is
  667|       |		   known and connection is still usable. */
  668|  14.2k|		input = smtp_command_parse_data_with_size(conn->smtp_parser,
  669|  14.2k|							  size);
  670|  14.2k|	}
  671|       |
  672|  17.4k|	if (ret < 0) {
  ------------------
  |  Branch (672:6): [True: 3.65k, False: 13.8k]
  ------------------
  673|  3.65k|		i_stream_unref(&input);
  674|  3.65k|		return;
  675|  3.65k|	}
  676|       |
  677|  13.8k|	(void)smtp_server_connection_data_chunk_add(cmd,
  678|  13.8k|		input, size, chunk_last, TRUE);
  ------------------
  |  |   15|  13.8k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  13.8k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  679|  13.8k|	i_stream_unref(&input);
  680|  13.8k|}
smtp-server-cmd-data.c:smtp_server_cmd_data_size_limit_exceeded:
   27|     70|{
   28|     70|	struct smtp_server_command *command = cmd->cmd;
   29|       |
   30|     70|	smtp_server_command_fail(command, 552, "5.2.3",
   31|     70|				 "Message size exceeds administrative limit");
   32|     70|}
smtp-server-cmd-data.c:cmd_data_start:
  475|  3.59k|{
  476|  3.59k|	struct smtp_server_connection *conn = cmd->conn;
  477|  3.59k|	struct smtp_server_transaction *trans = conn->state.trans;
  478|  3.59k|	struct istream *dot_input;
  479|       |
  480|       |	/* called when all previous commands were finished */
  481|  3.59k|	i_assert(conn->state.pending_mail_cmds == 0 &&
  ------------------
  |  |  219|  3.59k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  3.59k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  3.59k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  7.18k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 3.59k]
  |  |  |  |  |  Branch (202:45): [True: 3.59k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 3.59k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  3.59k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  3.59k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  3.59k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  482|  3.59k|		conn->state.pending_rcpt_cmds == 0);
  483|       |
  484|  3.59k|	if (trans != NULL)
  ------------------
  |  Branch (484:6): [True: 3.15k, False: 438]
  ------------------
  485|  3.15k|		smtp_server_transaction_data_command(trans, cmd);
  486|       |
  487|       |	/* check whether we have had successful mail and rcpt commands */
  488|  3.59k|	if (!smtp_server_connection_data_check_state(cmd))
  ------------------
  |  Branch (488:6): [True: 1.41k, False: 2.17k]
  ------------------
  489|  1.41k|		return;
  490|       |
  491|       |	/* don't allow classic DATA when CHUNKING sequence was started before */
  492|  2.17k|	if (conn->state.data_chunks > 0) {
  ------------------
  |  Branch (492:6): [True: 623, False: 1.55k]
  ------------------
  493|    623|		smtp_server_command_fail(cmd->cmd,
  494|    623|			503, "5.5.0", "Bad sequence of commands");
  495|    623|		return;
  496|    623|	}
  497|       |
  498|  1.55k|	smtp_server_connection_set_state(conn, SMTP_SERVER_STATE_DATA, NULL);
  499|       |
  500|       |	/* confirm initial success to client */
  501|  1.55k|	smtp_server_connection_reply_immediate(conn, 354, "OK");
  502|       |
  503|       |	/* start reading message data from client */
  504|  1.55k|	dot_input = smtp_command_parse_data_with_dot(conn->smtp_parser);
  505|  1.55k|	cmd_data_start_input(cmd, data_cmd, dot_input);
  506|  1.55k|	i_stream_unref(&dot_input);
  507|  1.55k|}
smtp-server-cmd-data.c:cmd_data_replied_one:
  154|  3.19k|{
  155|  3.19k|	struct smtp_server_connection *conn = cmd->conn;
  156|  3.19k|	struct smtp_server_transaction *trans = conn->state.trans;
  157|  3.19k|	struct smtp_server_recipient *rcpt;
  158|       |
  159|  3.19k|	if (trans == NULL || !array_is_created(&trans->rcpt_to))
  ------------------
  |  |  176|  2.76k|	array_is_created_i(&(array)->arr)
  ------------------
  |  Branch (159:6): [True: 438, False: 2.76k]
  |  Branch (159:23): [True: 712, False: 2.04k]
  ------------------
  160|  1.15k|		return;
  161|       |
  162|  2.04k|	array_foreach_elem(&trans->rcpt_to, rcpt)
  ------------------
  |  |  111|  2.04k|	for (const void *_foreach_end = \
  |  |  112|  2.04k|		CONST_PTR_OFFSET(*(array)->v, (array)->arr.buffer->used), \
  |  |  ------------------
  |  |  |  |   27|  2.04k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  |  |  113|  2.04k|	     *_foreach_ptr = CONST_PTR_OFFSET(*(array)->v, ARRAY_TYPE_CHECK(array, &elem) + \
  |  |  ------------------
  |  |  |  |   27|  8.19k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  114|  2.04k|		COMPILE_ERROR_IF_TRUE(sizeof(elem) > sizeof(void *))) \
  |  |  115|  2.04k|		     ;							\
  |  |  116|  8.45k|	     (_foreach_ptr != _foreach_end &&		\
  |  |  ------------------
  |  |  |  Branch (116:8): [True: 6.40k, False: 2.04k]
  |  |  ------------------
  |  |  117|  8.45k|	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   84|  6.40k|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  |  |  ------------------
  |  |               	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   15|  6.40k|#  define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  6.40k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (117:7): [True: 6.40k, False: 0]
  |  |  ------------------
  |  |  118|  2.04k|		;							\
  |  |  119|  6.40k|	     _foreach_ptr = CONST_PTR_OFFSET(_foreach_ptr, sizeof(elem)))
  |  |  ------------------
  |  |  |  |   27|  6.40k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  ------------------
  163|  6.40k|		smtp_server_recipient_data_replied(rcpt);
  164|  2.04k|}
smtp-server-cmd-data.c:cmd_data_replied:
  169|  3.28k|{
  170|  3.28k|	struct smtp_server_connection *conn = cmd->conn;
  171|  3.28k|	struct smtp_server_command *command = cmd->cmd;
  172|       |
  173|  3.28k|        i_assert(conn->state.pending_data_cmds > 0);
  ------------------
  |  |  219|  3.28k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  3.28k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  3.28k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  3.28k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 3.28k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 3.28k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  3.28k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  3.28k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  3.28k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  174|  3.28k|        conn->state.pending_data_cmds--;
  175|       |
  176|  3.28k|	smtp_server_command_input_lock(cmd);
  177|  3.28k|	if (!smtp_server_command_replied_success(command))
  ------------------
  |  Branch (177:6): [True: 2.03k, False: 1.24k]
  ------------------
  178|  2.03k|		smtp_server_command_input_unlock(cmd);
  179|  3.28k|}
smtp-server-cmd-data.c:cmd_data_destroy:
  133|  21.0k|{
  134|  21.0k|	struct smtp_server_connection *conn = cmd->conn;
  135|  21.0k|	struct smtp_server_command *command = cmd->cmd;
  136|       |
  137|  21.0k|	i_assert(data_cmd != NULL);
  ------------------
  |  |  219|  21.0k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  21.0k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  21.0k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  21.0k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 21.0k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 21.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  21.0k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  21.0k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  21.0k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  138|       |
  139|  21.0k|	if (data_cmd->main_input == conn->state.data_input &&
  ------------------
  |  Branch (139:6): [True: 17.9k, False: 3.15k]
  ------------------
  140|  21.0k|	    (data_cmd->chunk_last ||
  ------------------
  |  Branch (140:7): [True: 1.39k, False: 16.5k]
  ------------------
  141|  17.9k|	     !smtp_server_command_replied_success(command))) {
  ------------------
  |  Branch (141:7): [True: 7.65k, False: 8.87k]
  ------------------
  142|       |		/* clean up */
  143|  9.04k|		i_stream_destroy(&conn->state.data_input);
  144|  9.04k|		i_stream_destroy(&conn->state.data_chain_input);
  145|  9.04k|		conn->state.data_chain = NULL;
  146|  9.04k|	}
  147|       |
  148|  21.0k|	i_stream_unref(&data_cmd->chunk_input);
  149|  21.0k|}
smtp-server-cmd-data.c:cmd_data_chunk_replied:
  200|  17.1k|{
  201|  17.1k|	struct smtp_server_connection *conn = cmd->conn;
  202|  17.1k|	struct smtp_server_command *command = cmd->cmd;
  203|       |
  204|  17.1k|	i_assert(data_cmd != NULL);
  ------------------
  |  |  219|  17.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  17.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  17.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  17.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 17.1k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 17.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  17.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  17.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  17.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|       |
  206|  17.1k|        i_assert(conn->state.pending_data_cmds > 0);
  ------------------
  |  |  219|  17.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  17.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  17.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  17.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 17.1k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 17.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  17.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  17.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  17.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  207|  17.1k|        conn->state.pending_data_cmds--;
  208|       |
  209|  17.1k|	i_assert(smtp_server_command_is_replied(command));
  ------------------
  |  |  219|  17.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  17.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  17.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  17.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 17.1k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 17.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  17.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  17.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  17.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|  17.1k|	if (!smtp_server_command_replied_success(command) &&
  ------------------
  |  Branch (210:6): [True: 8.00k, False: 9.16k]
  ------------------
  211|  17.1k|	    conn->state.pending_data_cmds == 0)
  ------------------
  |  Branch (211:6): [True: 8.00k, False: 0]
  ------------------
  212|  8.00k|		conn->state.data_failed = TRUE;
  ------------------
  |  |   15|  8.00k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  8.00k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  213|  17.1k|}
smtp-server-cmd-data.c:cmd_data_start_input:
  434|  11.0k|{
  435|  11.0k|	struct smtp_server_connection *conn = cmd->conn;
  436|  11.0k|	struct smtp_server_command *command = cmd->cmd;
  437|       |
  438|  11.0k|	i_assert(data_cmd != NULL);
  ------------------
  |  |  219|  11.0k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  11.0k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  11.0k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  11.0k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 11.0k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 11.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  11.0k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  11.0k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  11.0k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  439|       |
  440|  11.0k|	if (input != NULL) {
  ------------------
  |  Branch (440:6): [True: 2.20k, False: 8.81k]
  ------------------
  441|  2.20k|		i_assert(conn->state.data_input == NULL);
  ------------------
  |  |  219|  2.20k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  2.20k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  2.20k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  2.20k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 2.20k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 2.20k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  2.20k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  2.20k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  2.20k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  442|  2.20k|		conn->state.data_input = input;
  443|  2.20k|		i_stream_ref(input);
  444|  2.20k|	}
  445|  11.0k|	data_cmd->main_input = conn->state.data_input;
  446|       |
  447|  11.0k|	if (data_cmd->client_input)
  ------------------
  |  Branch (447:6): [True: 11.0k, False: 0]
  ------------------
  448|  11.0k|		smtp_server_command_input_lock(cmd);
  449|       |
  450|  11.0k|	if (data_cmd->chunk_last) {
  ------------------
  |  Branch (450:6): [True: 1.64k, False: 9.37k]
  ------------------
  451|  1.64k|		smtp_server_command_add_hook(
  ------------------
  |  |  588|  1.64k|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|  1.64k|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|  1.64k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  1.64k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  1.64k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  1.64k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|  1.64k|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|  1.64k|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
  452|  1.64k|			command, SMTP_SERVER_COMMAND_HOOK_COMPLETED,
  453|  1.64k|			cmd_data_completed, data_cmd);
  454|  9.37k|	} else {
  455|  9.37k|		smtp_server_command_add_hook(
  ------------------
  |  |  588|  9.37k|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|  9.37k|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|  9.37k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  9.37k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  9.37k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  9.37k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|  9.37k|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|  9.37k|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
  456|  9.37k|			command, SMTP_SERVER_COMMAND_HOOK_COMPLETED,
  457|  9.37k|			cmd_data_chunk_completed, data_cmd);
  458|  9.37k|	}
  459|       |
  460|  11.0k|	if (conn->state.pending_mail_cmds == 0 &&
  ------------------
  |  Branch (460:6): [True: 10.4k, False: 601]
  ------------------
  461|  11.0k|		conn->state.pending_rcpt_cmds == 0) {
  ------------------
  |  Branch (461:3): [True: 9.89k, False: 522]
  ------------------
  462|  9.89k|		cmd_data_next(cmd, data_cmd);
  463|  9.89k|	} else {
  464|  1.12k|		smtp_server_command_add_hook(
  ------------------
  |  |  588|  1.12k|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|  1.12k|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|  1.12k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  1.12k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  1.12k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  1.12k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|  1.12k|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|  1.12k|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
  465|  1.12k|			command, SMTP_SERVER_COMMAND_HOOK_NEXT,
  466|  1.12k|			cmd_data_next, data_cmd);
  467|  1.12k|	}
  468|  11.0k|}
smtp-server-cmd-data.c:cmd_data_completed:
  184|  1.24k|{
  185|  1.24k|	struct smtp_server_connection *conn = cmd->conn;
  186|       |
  187|  1.24k|	i_assert(data_cmd != NULL);
  ------------------
  |  |  219|  1.24k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  1.24k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  1.24k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  1.24k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1.24k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  1.24k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  1.24k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.24k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  188|  1.24k|	i_stream_unref(&data_cmd->chunk_input);
  189|       |
  190|  1.24k|	i_assert(conn->state.trans != NULL);
  ------------------
  |  |  219|  1.24k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  1.24k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  1.24k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  1.24k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1.24k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  1.24k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  1.24k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.24k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|  1.24k|	smtp_server_transaction_finished(conn->state.trans, cmd);
  192|       |
  193|       |	/* reset state */
  194|  1.24k|	smtp_server_connection_reset_state(conn);
  195|  1.24k|}
smtp-server-cmd-data.c:cmd_data_chunk_completed:
  218|  8.87k|{
  219|  8.87k|	struct smtp_server_connection *conn = cmd->conn;
  220|  8.87k|	struct smtp_server_command *command = cmd->cmd;
  221|       |
  222|  8.87k|	if (!smtp_server_command_replied_success(command))
  ------------------
  |  Branch (222:6): [True: 0, False: 8.87k]
  ------------------
  223|      0|		conn->state.data_failed = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  224|  8.87k|}
smtp-server-cmd-data.c:cmd_data_next:
  346|  11.0k|{
  347|  11.0k|	struct smtp_server_connection *conn = cmd->conn;
  348|  11.0k|	struct smtp_server_transaction *trans = conn->state.trans;
  349|  11.0k|	const struct smtp_server_callbacks *callbacks = conn->callbacks;
  350|  11.0k|	struct smtp_server_command *command = cmd->cmd;
  351|       |
  352|       |	/* this command is next to send a reply */
  353|       |
  354|  11.0k|	i_assert(data_cmd != NULL);
  ------------------
  |  |  219|  11.0k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  11.0k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  11.0k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  11.0k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 11.0k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 11.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  11.0k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  11.0k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  11.0k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  355|  11.0k|	i_assert(trans != NULL);
  ------------------
  |  |  219|  11.0k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  11.0k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  11.0k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  11.0k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 11.0k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 11.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  11.0k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  11.0k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  11.0k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  356|       |
  357|       |	/* DATA command stops the pipeline, so if it is next to reply, nothing
  358|       |	   else can be pending. */
  359|  11.0k|	i_assert(conn->state.pending_mail_cmds == 0 &&
  ------------------
  |  |  219|  11.0k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  11.0k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  11.0k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  22.0k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 11.0k]
  |  |  |  |  |  Branch (202:45): [True: 11.0k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 11.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  11.0k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  11.0k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  11.0k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  360|  11.0k|		 conn->state.pending_rcpt_cmds == 0);
  361|       |
  362|  11.0k|	e_debug(cmd->event, "Command is next to be replied");
  ------------------
  |  |   61|  11.0k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  11.0k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  11.0k|	struct event *_tmp_event = (_event); \
  |  |   63|  11.0k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  11.0k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  11.0k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 11.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  11.0k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  11.0k|	else \
  |  |   66|  11.0k|		event_send_abort(_tmp_event); \
  |  |   67|  11.0k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  11.0k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  363|       |
  364|  11.0k|	smtp_server_transaction_data_command(trans, cmd);
  365|       |
  366|       |	/* check whether we have had successful mail and rcpt commands */
  367|  11.0k|	if (!smtp_server_connection_data_check_state(cmd))
  ------------------
  |  Branch (367:6): [True: 0, False: 11.0k]
  ------------------
  368|      0|		return;
  369|       |
  370|  11.0k|	if (data_cmd->chunk_last) {
  ------------------
  |  Branch (370:6): [True: 1.64k, False: 9.37k]
  ------------------
  371|       |		/* LMTP 'DATA' and 'BDAT LAST' commands need to send more than
  372|       |		   one reply per recipient */
  373|  1.64k|		if (HAS_ALL_BITS(trans->flags,
  ------------------
  |  |   18|  1.64k|#define HAS_ALL_BITS(val,bits) ((~(val) & (bits)) == 0)
  |  |  ------------------
  |  |  |  Branch (18:32): [True: 0, False: 1.64k]
  |  |  ------------------
  ------------------
  374|  1.64k|				 SMTP_SERVER_TRANSACTION_FLAG_REPLY_PER_RCPT)) {
  375|      0|			smtp_server_command_set_reply_count(command,
  376|      0|				array_count(&trans->rcpt_to));
  ------------------
  |  |  200|      0|	array_count_i(&(array)->arr)
  ------------------
  377|      0|		}
  378|  1.64k|	}
  379|       |
  380|  11.0k|	smtp_server_connection_set_state(conn, SMTP_SERVER_STATE_DATA, NULL);
  381|       |
  382|       |	/* chain data streams in the correct order */
  383|  11.0k|	if (conn->state.data_chain != NULL) {
  ------------------
  |  Branch (383:6): [True: 9.46k, False: 1.55k]
  ------------------
  384|  9.46k|		i_assert(data_cmd->chunk_input != NULL);
  ------------------
  |  |  219|  9.46k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  9.46k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  9.46k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  9.46k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 9.46k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 9.46k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  9.46k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  9.46k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  9.46k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  385|  9.46k|		i_stream_chain_append(conn->state.data_chain,
  386|  9.46k|				      data_cmd->chunk_input);
  387|  9.46k|		if (data_cmd->chunk_last) {
  ------------------
  |  Branch (387:7): [True: 89, False: 9.37k]
  ------------------
  388|     89|			e_debug(cmd->event, "Seen the last chunk");
  ------------------
  |  |   61|     89|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|     89|#  define STMT_START do
  |  |  ------------------
  |  |   62|     89|	struct event *_tmp_event = (_event); \
  |  |   63|     89|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|     89|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|     89|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 89]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|     89|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|     89|	else \
  |  |   66|     89|		event_send_abort(_tmp_event); \
  |  |   67|     89|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|     89|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  389|     89|			i_stream_chain_append_eof(conn->state.data_chain);
  390|     89|		}
  391|  9.46k|	}
  392|       |
  393|  11.0k|	if (data_cmd->chunk_first) {
  ------------------
  |  Branch (393:6): [True: 2.20k, False: 8.81k]
  ------------------
  394|  2.20k|		struct smtp_server_command *cmd_temp = command;
  395|       |
  396|  2.20k|		e_debug(cmd->event, "First chunk");
  ------------------
  |  |   61|  2.20k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  2.20k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  2.20k|	struct event *_tmp_event = (_event); \
  |  |   63|  2.20k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  2.20k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  2.20k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 2.20k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  2.20k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  2.20k|	else \
  |  |   66|  2.20k|		event_send_abort(_tmp_event); \
  |  |   67|  2.20k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  2.20k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  397|       |
  398|  2.20k|		smtp_server_command_ref(cmd_temp);
  399|  2.20k|		i_assert(callbacks != NULL &&
  ------------------
  |  |  219|  2.20k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  2.20k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  2.20k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  4.40k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 2.20k]
  |  |  |  |  |  Branch (202:45): [True: 2.20k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 2.20k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  2.20k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  2.20k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  2.20k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  400|  2.20k|			 callbacks->conn_cmd_data_begin != NULL);
  401|  2.20k|		i_assert(conn->state.data_input != NULL);
  ------------------
  |  |  219|  2.20k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  2.20k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  2.20k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  2.20k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 2.20k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 2.20k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  2.20k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  2.20k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  2.20k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  402|  2.20k|		struct event_reason *reason =
  403|  2.20k|			smtp_server_connection_reason_begin(conn, "cmd_data");
  404|  2.20k|		int ret = callbacks->conn_cmd_data_begin(conn->context,
  405|  2.20k|			cmd, conn->state.trans, conn->state.data_input);
  406|  2.20k|		event_reason_end(&reason);
  407|  2.20k|		if (ret < 0) {
  ------------------
  |  Branch (407:7): [True: 0, False: 2.20k]
  ------------------
  408|      0|			i_assert(smtp_server_command_is_replied(cmd_temp));
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  409|       |			/* command failed */
  410|      0|			smtp_server_command_unref(&cmd_temp);
  411|      0|			return;
  412|      0|		}
  413|  2.20k|		if (!smtp_server_command_unref(&cmd_temp))
  ------------------
  |  Branch (413:7): [True: 0, False: 2.20k]
  ------------------
  414|      0|			return;
  415|  2.20k|	}
  416|       |
  417|  11.0k|	if (smtp_server_command_is_replied(command)) {
  ------------------
  |  Branch (417:6): [True: 0, False: 11.0k]
  ------------------
  418|      0|		smtp_server_command_input_unlock(cmd);
  419|  11.0k|	} else {
  420|  11.0k|		if (data_cmd->client_input) {
  ------------------
  |  Branch (420:7): [True: 11.0k, False: 0]
  ------------------
  421|       |			/* using input from client connection;
  422|       |			   capture I/O event */
  423|  11.0k|			smtp_server_connection_timeout_start(conn);
  424|  11.0k|			smtp_server_command_input_capture(cmd, cmd_data_input);
  425|  11.0k|		}
  426|       |
  427|  11.0k|		(void)cmd_data_handle_input(cmd);
  428|  11.0k|	}
  429|  11.0k|}
smtp-server-cmd-data.c:cmd_data_input:
  338|    210|{
  339|    210|	smtp_server_connection_timeout_reset(cmd->conn);
  340|    210|	(void)cmd_data_handle_input(cmd);
  341|    210|}
smtp-server-cmd-data.c:cmd_data_handle_input:
  317|  11.2k|{
  318|  11.2k|	struct smtp_server_connection *conn = cmd->conn;
  319|  11.2k|	struct smtp_server_command *command = cmd->cmd;
  320|  11.2k|	int ret;
  321|       |
  322|  11.2k|	if (!smtp_server_cmd_data_check_size(cmd))
  ------------------
  |  Branch (322:6): [True: 0, False: 11.2k]
  ------------------
  323|      0|		return -1;
  324|       |
  325|  11.2k|	smtp_server_connection_ref(conn);
  326|  11.2k|	smtp_server_command_ref(command);
  327|       |
  328|       |	/* continue reading from client */
  329|  11.2k|	ret = cmd_data_do_handle_input(cmd);
  330|       |
  331|  11.2k|	smtp_server_command_unref(&command);
  332|  11.2k|	smtp_server_connection_unref(&conn);
  333|       |
  334|  11.2k|	return ret;
  335|  11.2k|}
smtp-server-cmd-data.c:cmd_data_do_handle_input:
  267|  11.2k|{
  268|  11.2k|	struct smtp_server_connection *conn = cmd->conn;
  269|  11.2k|	const struct smtp_server_callbacks *callbacks = conn->callbacks;
  270|  11.2k|	struct smtp_server_command *command = cmd->cmd;
  271|  11.2k|	struct cmd_data_context *data_cmd = command->data;
  272|  11.2k|	int ret;
  273|       |
  274|  11.2k|	i_assert(data_cmd != NULL);
  ------------------
  |  |  219|  11.2k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  11.2k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  11.2k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  11.2k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 11.2k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 11.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  11.2k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  11.2k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  11.2k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  275|       |
  276|  11.2k|	i_assert(callbacks != NULL &&
  ------------------
  |  |  219|  11.2k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  11.2k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  11.2k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  22.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 11.2k]
  |  |  |  |  |  Branch (202:45): [True: 11.2k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 11.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  11.2k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  11.2k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  11.2k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  277|  11.2k|		 callbacks->conn_cmd_data_continue != NULL);
  278|  11.2k|	struct event_reason *reason =
  279|  11.2k|		smtp_server_connection_reason_begin(conn, "cmd_data");
  280|  11.2k|	ret = callbacks->conn_cmd_data_continue(conn->context,
  281|  11.2k|		cmd, conn->state.trans);
  282|  11.2k|	event_reason_end(&reason);
  283|  11.2k|	if (ret >= 0) {
  ------------------
  |  Branch (283:6): [True: 10.6k, False: 608]
  ------------------
  284|  10.6k|		if (!smtp_server_cmd_data_check_size(cmd)) {
  ------------------
  |  Branch (284:7): [True: 0, False: 10.6k]
  ------------------
  285|      0|			return -1;
  286|  10.6k|		} else if (!i_stream_have_bytes_left(conn->state.data_input)) {
  ------------------
  |  Branch (286:14): [True: 1.24k, False: 9.37k]
  ------------------
  287|  1.24k|			e_debug(cmd->event, "End of data");
  ------------------
  |  |   61|  1.24k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  1.24k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  1.24k|	struct event *_tmp_event = (_event); \
  |  |   63|  1.24k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  1.24k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  1.24k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 1.24k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  1.24k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  1.24k|	else \
  |  |   66|  1.24k|		event_send_abort(_tmp_event); \
  |  |   67|  1.24k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.24k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  288|  1.24k|			smtp_server_transaction_received(
  289|  1.24k|				conn->state.trans,
  290|  1.24k|				conn->state.data_input->v_offset);
  291|  1.24k|			smtp_server_command_input_lock(cmd);
  292|  1.24k|			smtp_server_connection_timeout_stop(conn);
  293|  9.37k|		} else if (!data_cmd->chunk_last &&
  ------------------
  |  Branch (293:14): [True: 9.29k, False: 81]
  ------------------
  294|  9.37k|			!i_stream_have_bytes_left(data_cmd->chunk_input)) {
  ------------------
  |  Branch (294:4): [True: 9.16k, False: 132]
  ------------------
  295|  9.16k|			e_debug(cmd->event, "End of chunk");
  ------------------
  |  |   61|  9.16k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  9.16k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  9.16k|	struct event *_tmp_event = (_event); \
  |  |   63|  9.16k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  9.16k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  9.16k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 9.16k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  9.16k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  9.16k|	else \
  |  |   66|  9.16k|		event_send_abort(_tmp_event); \
  |  |   67|  9.16k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  9.16k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  296|  9.16k|			cmd_data_chunk_finish(cmd);
  297|  9.16k|		} else if (i_stream_get_data_size(
  ------------------
  |  Branch (297:14): [True: 0, False: 213]
  ------------------
  298|    213|			conn->state.data_input) > 0) {
  299|      0|			e_debug(cmd->event, "Not all client data read");
  ------------------
  |  |   61|      0|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |   62|      0|	struct event *_tmp_event = (_event); \
  |  |   63|      0|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|      0|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|      0|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|      0|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|      0|	else \
  |  |   66|      0|		event_send_abort(_tmp_event); \
  |  |   67|      0|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  300|      0|			smtp_server_connection_timeout_stop(cmd->conn);
  301|    213|		} else {
  302|    213|			smtp_server_connection_timeout_start(cmd->conn);
  303|    213|		}
  304|  10.6k|	} else {
  305|    608|		if (conn->state.data_input->stream_errno != 0) {
  ------------------
  |  Branch (305:7): [True: 608, False: 0]
  ------------------
  306|    608|			cmd_data_input_error(cmd);
  307|    608|			return -1;
  308|    608|		}
  309|       |		/* command is waiting for external event or it failed */
  310|    608|		i_assert(smtp_server_command_is_replied(command));
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    608|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    608|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  311|      0|	}
  312|       |
  313|  10.6k|	return 1;
  314|  11.2k|}
smtp-server-cmd-data.c:cmd_data_chunk_finish:
  228|  9.16k|{
  229|  9.16k|	struct smtp_server_command *command = cmd->cmd;
  230|  9.16k|	struct cmd_data_context *data_cmd = command->data;
  231|       |
  232|  9.16k|	smtp_server_command_input_lock(cmd);
  233|  9.16k|	i_stream_unref(&data_cmd->chunk_input);
  234|       |
  235|       |	/* re-check transaction state (for BDAT/B... command) */
  236|  9.16k|	if (!smtp_server_connection_data_check_state(cmd))
  ------------------
  |  Branch (236:6): [True: 0, False: 9.16k]
  ------------------
  237|      0|		return;
  238|       |
  239|  9.16k|	smtp_server_reply(cmd, 250, "2.0.0",
  240|  9.16k|		"Added %"PRIuUOFF_T" octets", data_cmd->chunk_size);
  241|  9.16k|}
smtp-server-cmd-data.c:cmd_data_input_error:
  244|    608|{
  245|    608|	struct smtp_server_connection *conn = cmd->conn;
  246|    608|	struct smtp_server_command *command = cmd->cmd;
  247|    608|	struct cmd_data_context *data_cmd = command->data;
  248|    608|	struct istream *data_input = conn->state.data_input;
  249|    608|	const char *error;
  250|       |
  251|    608|	conn->state.data_failed = TRUE;
  ------------------
  |  |   15|    608|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|    608|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  252|       |
  253|    608|	if (!data_cmd->client_input) {
  ------------------
  |  Branch (253:6): [True: 0, False: 608]
  ------------------
  254|      0|		if (!smtp_server_command_is_replied(command)) {
  ------------------
  |  Branch (254:7): [True: 0, False: 0]
  ------------------
  255|      0|			smtp_server_command_fail(command,
  256|      0|				400, "4.0.0", "Failed to add data");
  257|      0|		}
  258|      0|		return;
  259|      0|	}
  260|       |
  261|    608|	error = i_stream_get_disconnect_reason(data_input);
  262|    608|	e_debug(conn->event, "Connection lost during data transfer: %s", error);
  ------------------
  |  |   61|    608|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|    608|#  define STMT_START do
  |  |  ------------------
  |  |   62|    608|	struct event *_tmp_event = (_event); \
  |  |   63|    608|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|    608|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|    608|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 608]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|    608|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|    608|	else \
  |  |   66|    608|		event_send_abort(_tmp_event); \
  |  |   67|    608|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|    608|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  263|    608|	smtp_server_connection_close(&conn, error);
  264|    608|}

smtp_server_cmd_ehlo:
  117|  6.88k|{
  118|       |	/* ehlo = "EHLO" SP ( Domain / address-literal ) CRLF */
  119|       |
  120|  6.88k|	smtp_server_cmd_helo_run(cmd, params, FALSE);
  ------------------
  |  |   11|  6.88k|#  define FALSE (!1)
  ------------------
  121|  6.88k|}
smtp_server_cmd_helo:
  124|  1.02k|{
  125|       |	/* helo = "HELO" SP Domain CRLF */
  126|       |
  127|  1.02k|	smtp_server_cmd_helo_run(cmd, params, TRUE);
  ------------------
  |  |   15|  1.02k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  1.02k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  128|  1.02k|}
smtp_server_cmd_ehlo_reply_create:
  132|  7.24k|{
  133|  7.24k|	static struct {
  134|  7.24k|		const char *name;
  135|  7.24k|		void (*add)(struct smtp_server_reply *reply);
  136|  7.24k|	} standard_caps[] = {
  137|       |		/* Sorted alphabetically */
  138|  7.24k|		{ "8BITMIME", smtp_server_reply_ehlo_add_8bitmime },
  139|  7.24k|		{ "BINARYMIME", smtp_server_reply_ehlo_add_binarymime },
  140|  7.24k|		{ "CHUNKING", smtp_server_reply_ehlo_add_chunking },
  141|  7.24k|		{ "DSN", smtp_server_reply_ehlo_add_dsn },
  142|  7.24k|		{ "ENHANCEDSTATUSCODES",
  143|  7.24k|		  smtp_server_reply_ehlo_add_enhancedstatuscodes },
  144|  7.24k|		{ "PIPELINING", smtp_server_reply_ehlo_add_pipelining },
  145|  7.24k|		{ "SIZE", smtp_server_reply_ehlo_add_size },
  146|       |#ifdef EXPERIMENTAL_MAIL_UTF8
  147|       |		{ "SMTPUTF8", smtp_server_reply_ehlo_add_smtputf8 },
  148|       |#endif
  149|  7.24k|		{ "STARTTLS", smtp_server_reply_ehlo_add_starttls },
  150|  7.24k|		{ "VRFY", smtp_server_reply_ehlo_add_vrfy },
  151|  7.24k|		{ "XCLIENT", smtp_server_reply_ehlo_add_xclient }
  152|  7.24k|	};
  153|  7.24k|	const unsigned int standard_caps_count = N_ELEMENTS(standard_caps);
  ------------------
  |  |   19|  7.24k|	(sizeof(arr) / sizeof((arr)[0]))
  ------------------
  154|  7.24k|	struct smtp_server_connection *conn = cmd->conn;
  155|  7.24k|	struct smtp_server_command *command = cmd->cmd;
  156|  7.24k|	struct smtp_server_cmd_helo *helo_data = command->data;
  157|  7.24k|	const struct smtp_capability_extra *extra_caps = NULL;
  158|  7.24k|	unsigned int extra_caps_count, i, j;
  159|  7.24k|	struct smtp_server_reply *reply;
  160|       |
  161|  7.24k|	reply = smtp_server_reply_create_ehlo(cmd->cmd);
  162|       |
  163|  7.24k|	if (helo_data->helo.old_smtp) {
  ------------------
  |  Branch (163:6): [True: 792, False: 6.45k]
  ------------------
  164|    792|		i_assert(cmd->cmd->reg->func == smtp_server_cmd_helo);
  ------------------
  |  |  219|    792|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    792|#  define STMT_START do
  |  |  ------------------
  |  |  220|    792|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    792|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 792]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 792]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    792|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    792|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    792|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  165|    792|		return reply;
  166|    792|	}
  167|  7.24k|	i_assert(cmd->cmd->reg->func == smtp_server_cmd_ehlo);
  ------------------
  |  |  219|  6.45k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.45k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.45k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.45k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.45k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.45k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  7.24k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  7.24k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  168|       |
  169|  6.45k|	extra_caps_count = 0;
  170|  6.45k|	if (array_is_created(&conn->extra_capabilities)) {
  ------------------
  |  |  176|  6.45k|	array_is_created_i(&(array)->arr)
  |  |  ------------------
  |  |  |  Branch (176:2): [True: 0, False: 6.45k]
  |  |  ------------------
  ------------------
  171|      0|		extra_caps = array_get(&conn->extra_capabilities,
  ------------------
  |  |  255|      0|	ARRAY_TYPE_CAST_CONST(array)array_get_i(&(array)->arr, count)
  |  |  ------------------
  |  |  |  |   52|      0|	(typeof(*(array)->v))
  |  |  ------------------
  ------------------
  172|      0|				       &extra_caps_count);
  173|      0|	}
  174|       |
  175|  6.45k|	i = j = 0;
  176|  71.0k|	while (i < standard_caps_count || j < extra_caps_count) {
  ------------------
  |  Branch (176:9): [True: 64.5k, False: 6.45k]
  |  Branch (176:36): [True: 0, False: 6.45k]
  ------------------
  177|  64.5k|		if (i < standard_caps_count &&
  ------------------
  |  Branch (177:7): [True: 64.5k, False: 0]
  ------------------
  178|  64.5k|		    (j >= extra_caps_count ||
  ------------------
  |  Branch (178:8): [True: 64.5k, False: 0]
  ------------------
  179|  64.5k|		     strcasecmp(standard_caps[i].name,
  ------------------
  |  Branch (179:8): [True: 0, False: 0]
  ------------------
  180|  64.5k|				extra_caps[j].name) < 0)) {
  181|  64.5k|			standard_caps[i].add(reply);
  182|  64.5k|			i++;
  183|  64.5k|		} else {
  184|      0|			smtp_server_reply_ehlo_add_params(
  185|      0|				reply, extra_caps[j].name,
  186|      0|				extra_caps[j].params);
  187|      0|			j++;
  188|      0|		}
  189|  64.5k|	}
  190|  6.45k|	return reply;
  191|  6.45k|}
smtp_server_cmd_ehlo_reply_default:
  194|  7.24k|{
  195|  7.24k|	struct smtp_server_reply *reply;
  196|       |
  197|  7.24k|	reply = smtp_server_cmd_ehlo_reply_create(cmd);
  198|  7.24k|	smtp_server_reply_submit(reply);
  199|  7.24k|}
smtp-server-cmd-helo.c:smtp_server_cmd_helo_run:
   52|  7.90k|{
   53|  7.90k|	struct smtp_server_connection *conn = cmd->conn;
   54|  7.90k|	const struct smtp_server_callbacks *callbacks = conn->callbacks;
   55|  7.90k|	struct smtp_server_cmd_helo *helo_data;
   56|  7.90k|	struct smtp_server_command *command = cmd->cmd;
   57|  7.90k|	bool first = (conn->pending_helo == NULL && conn->helo.domain == NULL);
  ------------------
  |  Branch (57:16): [True: 7.90k, False: 0]
  |  Branch (57:46): [True: 5.70k, False: 2.19k]
  ------------------
   58|  7.90k|	const char *domain = NULL;
   59|  7.90k|	int ret;
   60|       |
   61|       |	/* Parse domain argument */
   62|       |
   63|  7.90k|	if (*params == '\0') {
  ------------------
  |  Branch (63:6): [True: 659, False: 7.24k]
  ------------------
   64|    659|		smtp_server_reply(cmd, 501, "", "Missing hostname");
   65|    659|		return;
   66|    659|	}
   67|  7.24k|	ret = smtp_helo_domain_parse(params, !old_smtp, &domain);
   68|       |
   69|  7.24k|	smtp_server_command_pipeline_block(cmd);
   70|  7.24k|	if (conn->state.state == SMTP_SERVER_STATE_GREETING) {
  ------------------
  |  Branch (70:6): [True: 1.32k, False: 5.92k]
  ------------------
   71|  1.32k|		smtp_server_connection_set_state(conn, SMTP_SERVER_STATE_HELO,
   72|  1.32k|						 NULL);
   73|  1.32k|	}
   74|       |
   75|  7.24k|	helo_data = p_new(cmd->pool, struct smtp_server_cmd_helo, 1);
  ------------------
  |  |   97|  7.24k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|  7.24k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|  7.24k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|  7.24k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  7.24k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   76|  7.24k|	helo_data->helo.domain = p_strdup(cmd->pool, domain);
   77|  7.24k|	helo_data->helo.domain_valid = ( ret >= 0 );
   78|  7.24k|	helo_data->helo.old_smtp = old_smtp;
   79|  7.24k|	helo_data->first = first;
   80|  7.24k|	command->data = helo_data;
   81|       |
   82|  7.24k|	if (null_strcmp(conn->helo.domain, domain) != 0 ||
  ------------------
  |  Branch (82:6): [True: 1.24k, False: 6.00k]
  ------------------
   83|  7.24k|	    conn->helo.old_smtp != old_smtp)
  ------------------
  |  Branch (83:6): [True: 130, False: 5.87k]
  ------------------
   84|  1.37k|		helo_data->changed = TRUE; /* Preliminary assessment */
  ------------------
  |  |   15|  1.37k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  1.37k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   85|       |
   86|  7.24k|	if (conn->pending_helo == NULL)
  ------------------
  |  Branch (86:6): [True: 7.24k, False: 0]
  ------------------
   87|  7.24k|		conn->pending_helo = &helo_data->helo;
   88|       |
   89|  7.24k|	smtp_server_command_add_hook(
  ------------------
  |  |  588|  7.24k|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|  7.24k|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|  7.24k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  7.24k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  7.24k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  7.24k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|  7.24k|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|  7.24k|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
   90|  7.24k|		command, SMTP_SERVER_COMMAND_HOOK_NEXT,
   91|  7.24k|		cmd_helo_next, helo_data);
   92|  7.24k|	smtp_server_command_add_hook(
  ------------------
  |  |  588|  7.24k|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|  7.24k|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|  7.24k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  7.24k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  7.24k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  7.24k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|  7.24k|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|  7.24k|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
   93|  7.24k|		command, SMTP_SERVER_COMMAND_HOOK_COMPLETED,
   94|  7.24k|		cmd_helo_completed, helo_data);
   95|       |
   96|  7.24k|	smtp_server_command_ref(command);
   97|  7.24k|	if (callbacks != NULL && callbacks->conn_cmd_helo != NULL) {
  ------------------
  |  Branch (97:6): [True: 7.24k, False: 0]
  |  Branch (97:27): [True: 0, False: 7.24k]
  ------------------
   98|       |		/* Specific implementation of EHLO command */
   99|      0|		ret = callbacks->conn_cmd_helo(conn->context, cmd, helo_data);
  100|      0|		if (ret <= 0) {
  ------------------
  |  Branch (100:7): [True: 0, False: 0]
  ------------------
  101|      0|			i_assert(ret == 0 ||
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  102|      0|				 smtp_server_command_is_replied(command));
  103|       |			/* Command is waiting for external event or it failed */
  104|      0|			smtp_server_command_unref(&command);
  105|      0|			return;
  106|      0|		}
  107|      0|	}
  108|       |
  109|  7.24k|	if (!smtp_server_command_is_replied(command)) {
  ------------------
  |  Branch (109:6): [True: 7.24k, False: 0]
  ------------------
  110|       |		/* Submit default EHLO reply if none is provided */
  111|  7.24k|		smtp_server_cmd_ehlo_reply_default(cmd);
  112|  7.24k|	}
  113|  7.24k|	smtp_server_command_unref(&command);
  114|  7.24k|}
smtp-server-cmd-helo.c:cmd_helo_next:
   41|  7.24k|{
   42|  7.24k|	struct smtp_server_connection *conn = cmd->conn;
   43|       |
   44|  7.24k|	if (null_strcmp(conn->helo.domain, data->helo.domain) != 0 ||
  ------------------
  |  Branch (44:6): [True: 1.24k, False: 6.00k]
  ------------------
   45|  7.24k|	    conn->helo.old_smtp != data->helo.old_smtp)
  ------------------
  |  Branch (45:6): [True: 130, False: 5.87k]
  ------------------
   46|  1.37k|		data->changed = TRUE; /* Definitive assessment */
  ------------------
  |  |   15|  1.37k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  1.37k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   47|  7.24k|}
smtp-server-cmd-helo.c:cmd_helo_completed:
   15|  7.24k|{
   16|  7.24k|	struct smtp_server_connection *conn = cmd->conn;
   17|  7.24k|	struct smtp_server_command *command = cmd->cmd;
   18|       |
   19|  7.24k|	i_assert(smtp_server_command_is_replied(command));
  ------------------
  |  |  219|  7.24k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  7.24k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  7.24k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  7.24k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 7.24k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 7.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  7.24k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  7.24k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  7.24k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   20|  7.24k|	if (!smtp_server_command_replied_success(command)) {
  ------------------
  |  Branch (20:6): [True: 0, False: 7.24k]
  ------------------
   21|       |		/* Failure */
   22|      0|		return;
   23|      0|	}
   24|       |
   25|  7.24k|	if (conn->pending_helo == &data->helo)
  ------------------
  |  Branch (25:6): [True: 7.24k, False: 0]
  ------------------
   26|  7.24k|		conn->pending_helo = NULL;
   27|       |
   28|       |	/* Success */
   29|  7.24k|	smtp_server_connection_reset_state(conn);
   30|       |
   31|  7.24k|	i_free(conn->helo_domain);
  ------------------
  |  |   19|  7.24k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  7.24k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  7.24k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  7.24k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  7.24k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  7.24k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  7.24k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  7.24k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   32|  7.24k|	conn->helo_domain = i_strdup(data->helo.domain);
   33|  7.24k|	conn->helo.domain = conn->helo_domain;
   34|  7.24k|	conn->helo.domain_valid = data->helo.domain_valid;
   35|  7.24k|	conn->helo.old_smtp = data->helo.old_smtp;
   36|  7.24k|}

smtp_server_cmd_mail:
   73|  18.8k|{
   74|  18.8k|	struct smtp_server_connection *conn = cmd->conn;
   75|  18.8k|	const struct smtp_server_settings *set = &conn->set;
   76|  18.8k|	enum smtp_capability caps = set->capabilities;
   77|  18.8k|	const struct smtp_server_callbacks *callbacks = conn->callbacks;
   78|  18.8k|	struct smtp_server_command *command = cmd->cmd;
   79|  18.8k|	struct smtp_server_cmd_mail *mail_data;
   80|  18.8k|	enum smtp_address_parse_flags path_parse_flags;
   81|  18.8k|	const char *const *param_extensions = NULL;
   82|  18.8k|	struct smtp_address *path = NULL;
   83|  18.8k|	enum smtp_param_parse_error pperror;
   84|  18.8k|	const char *error;
   85|  18.8k|	int ret;
   86|       |
   87|       |	/* mail         = "MAIL FROM:" Reverse-path [SP Mail-parameters] CRLF
   88|       |	   Reverse-path = Path / "<>"
   89|       |	 */
   90|       |
   91|       |	/* Check transaction state as far as possible */
   92|  18.8k|	if (!cmd_mail_check_state(cmd))
  ------------------
  |  Branch (92:6): [True: 719, False: 18.1k]
  ------------------
   93|    719|		return;
   94|       |
   95|       |	/* Reverse-path */
   96|  18.1k|	if (params == NULL || !str_begins_icase(params, "FROM:", &params)) {
  ------------------
  |  |  128|  18.1k|	(!__builtin_constant_p(n) ? (str_begins_icase)((h), (n), (suffix_r)) : \
  |  |  ------------------
  |  |  |  Branch (128:3): [Folded - Ignored]
  |  |  ------------------
  |  |  129|  18.1k|	 (strncasecmp((h), (n), strlen(n)) != 0 ? FALSE : \
  |  |  ------------------
  |  |  |  |   11|    743|#  define FALSE (!1)
  |  |  ------------------
  |  |  |  Branch (129:4): [True: 743, False: 17.3k]
  |  |  ------------------
  |  |  130|  18.1k|	  str_begins_builtin_success((h), strlen(n), suffix_r)))
  ------------------
  |  Branch (96:6): [True: 0, False: 18.1k]
  |  Branch (96:24): [True: 743, False: 17.3k]
  ------------------
   97|    743|		smtp_server_reply(cmd, 501, "5.5.4", "Invalid parameters");
   98|    743|		return;
   99|    743|	}
  100|  17.3k|	if (params[0] != ' ' && params[0] != '\t') {
  ------------------
  |  Branch (100:6): [True: 17.1k, False: 208]
  |  Branch (100:26): [True: 16.8k, False: 343]
  ------------------
  101|       |		/* no whitespace */
  102|  16.8k|	} else if ((set->workarounds &
  ------------------
  |  Branch (102:13): [True: 0, False: 551]
  ------------------
  103|    551|		    SMTP_SERVER_WORKAROUND_WHITESPACE_BEFORE_PATH) != 0) {
  104|      0|		while (*params == ' ' || *params == '\t')
  ------------------
  |  Branch (104:10): [True: 0, False: 0]
  |  Branch (104:28): [True: 0, False: 0]
  ------------------
  105|      0|			params++;
  106|    551|	} else {
  107|    551|		smtp_server_reply(cmd, 501, "5.5.4",
  108|    551|				  "Invalid FROM: "
  109|    551|				  "Unexpected whitespace before path");
  110|    551|		return;
  111|    551|	}
  112|  16.8k|	path_parse_flags =
  113|  16.8k|		SMTP_ADDRESS_PARSE_FLAG_ALLOW_EMPTY |
  114|  16.8k|		SMTP_ADDRESS_PARSE_FLAG_PRESERVE_RAW;
  115|  16.8k|	if (*params != '\0' &&
  ------------------
  |  Branch (115:6): [True: 16.4k, False: 360]
  ------------------
  116|  16.8k|	    (set->workarounds & SMTP_SERVER_WORKAROUND_MAILBOX_FOR_PATH) != 0)
  ------------------
  |  Branch (116:6): [True: 0, False: 16.4k]
  ------------------
  117|      0|		path_parse_flags |= SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL;
  118|  16.8k|	if (set->mail_path_allow_broken) {
  ------------------
  |  Branch (118:6): [True: 0, False: 16.8k]
  ------------------
  119|      0|		path_parse_flags |=
  120|      0|			SMTP_ADDRESS_PARSE_FLAG_ALLOW_BAD_LOCALPART |
  121|      0|			SMTP_ADDRESS_PARSE_FLAG_IGNORE_BROKEN;
  122|      0|	}
  123|  16.8k|	ret = smtp_address_parse_path_full(pool_datastack_create(), params,
  124|  16.8k|					   path_parse_flags, &path, &error,
  125|  16.8k|					   &params);
  126|  16.8k|	if (ret < 0 && !smtp_address_is_broken(path)) {
  ------------------
  |  Branch (126:6): [True: 3.89k, False: 12.9k]
  |  Branch (126:17): [True: 3.89k, False: 0]
  ------------------
  127|  3.89k|		smtp_server_reply(cmd, 501, "5.5.4",
  128|  3.89k|				  "Invalid FROM: %s", error);
  129|  3.89k|		return;
  130|  3.89k|	}
  131|  12.9k|	if (*params == ' ')
  ------------------
  |  Branch (131:6): [True: 7.43k, False: 5.49k]
  ------------------
  132|  7.43k|		params++;
  133|  5.49k|	else if (*params != '\0') {
  ------------------
  |  Branch (133:11): [True: 284, False: 5.21k]
  ------------------
  134|    284|		smtp_server_reply(
  135|    284|			cmd, 501, "5.5.4",
  136|    284|			"Invalid FROM: Invalid character in path");
  137|    284|		return;
  138|    284|	}
  139|  12.6k|	if (ret < 0) {
  ------------------
  |  Branch (139:6): [True: 0, False: 12.6k]
  ------------------
  140|      0|		i_assert(set->mail_path_allow_broken);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  141|      0|		e_debug(conn->event, "Invalid FROM: %s "
  ------------------
  |  |   61|      0|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |   62|      0|	struct event *_tmp_event = (_event); \
  |  |   63|      0|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|      0|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|      0|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|      0|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|      0|	else \
  |  |   66|      0|		event_send_abort(_tmp_event); \
  |  |   67|      0|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  142|      0|			"(proceeding with <> as sender)", error);
  143|      0|	}
  144|       |
  145|  12.6k|	mail_data = p_new(cmd->pool, struct smtp_server_cmd_mail, 1);
  ------------------
  |  |   97|  12.6k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|  12.6k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|  12.6k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|  12.6k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  12.6k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  146|       |
  147|  12.6k|	if (conn->set.protocol == SMTP_PROTOCOL_LMTP)
  ------------------
  |  Branch (147:6): [True: 0, False: 12.6k]
  ------------------
  148|      0|		mail_data->flags |= SMTP_SERVER_TRANSACTION_FLAG_REPLY_PER_RCPT;
  149|       |
  150|       |	/* [SP Mail-parameters] */
  151|  12.6k|	if (array_is_created(&conn->mail_param_extensions))
  ------------------
  |  |  176|  12.6k|	array_is_created_i(&(array)->arr)
  |  |  ------------------
  |  |  |  Branch (176:2): [True: 0, False: 12.6k]
  |  |  ------------------
  ------------------
  152|      0|		param_extensions = array_front(&conn->mail_param_extensions);
  ------------------
  |  |  277|      0|#define array_front(array) array_idx(array, 0)
  |  |  ------------------
  |  |  |  |  287|      0|	ARRAY_TYPE_CAST_CONST(array)array_idx_i(&(array)->arr, idx)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|	(typeof(*(array)->v))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|  12.6k|	if (smtp_params_mail_parse(cmd->pool, params, caps, param_extensions,
  ------------------
  |  Branch (153:6): [True: 6.77k, False: 5.86k]
  ------------------
  154|  12.6k|				   NULL, &mail_data->params, &pperror,
  155|  12.6k|				   &error) < 0) {
  156|  6.77k|		switch (pperror) {
  157|  3.58k|		case SMTP_PARAM_PARSE_ERROR_BAD_SYNTAX:
  ------------------
  |  Branch (157:3): [True: 3.58k, False: 3.19k]
  ------------------
  158|  3.58k|			smtp_server_reply(cmd, 501, "5.5.4", "%s", error);
  159|  3.58k|			break;
  160|  3.19k|		case SMTP_PARAM_PARSE_ERROR_NOT_SUPPORTED:
  ------------------
  |  Branch (160:3): [True: 3.19k, False: 3.58k]
  ------------------
  161|  3.19k|			smtp_server_reply(cmd, 555, "5.5.4", "%s", error);
  162|  3.19k|			break;
  163|      0|		default:
  ------------------
  |  Branch (163:3): [True: 0, False: 6.77k]
  ------------------
  164|      0|			i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
  165|  6.77k|		}
  166|  6.77k|		return;
  167|  6.77k|	}
  168|       |
  169|  5.86k|	if ((caps & SMTP_CAPABILITY_SIZE) != 0 && set->max_message_size > 0 &&
  ------------------
  |  Branch (169:6): [True: 5.86k, False: 0]
  |  Branch (169:44): [True: 0, False: 5.86k]
  ------------------
  170|  5.86k|	    mail_data->params.size > set->max_message_size) {
  ------------------
  |  Branch (170:6): [True: 0, False: 0]
  ------------------
  171|      0|		smtp_server_reply(cmd, 552, "5.2.3",
  172|      0|			"Message size exceeds administrative limit");
  173|      0|		return;
  174|      0|	}
  175|       |
  176|  5.86k|	mail_data->path = smtp_address_clone(cmd->pool, path);
  177|  5.86k|	mail_data->timestamp = ioloop_timeval;
  178|       |
  179|  5.86k|	smtp_server_command_add_hook(command, SMTP_SERVER_COMMAND_HOOK_NEXT,
  ------------------
  |  |  588|  5.86k|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|  5.86k|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|  5.86k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  5.86k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  5.86k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  5.86k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|  5.86k|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|  5.86k|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
  180|  5.86k|				     cmd_mail_recheck, mail_data);
  181|  5.86k|	smtp_server_command_add_hook(command, SMTP_SERVER_COMMAND_HOOK_COMPLETED,
  ------------------
  |  |  588|  5.86k|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|  5.86k|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|  5.86k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  5.86k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  5.86k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  5.86k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|  5.86k|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|  5.86k|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
  182|  5.86k|				     cmd_mail_completed, mail_data);
  183|       |
  184|  5.86k|	smtp_server_connection_set_state(conn, SMTP_SERVER_STATE_MAIL_FROM,
  185|  5.86k|					 smtp_address_encode(mail_data->path));
  186|  5.86k|	conn->state.pending_mail_cmds++;
  187|       |
  188|  5.86k|	smtp_server_command_ref(command);
  189|  5.86k|	if (callbacks != NULL && callbacks->conn_cmd_mail != NULL) {
  ------------------
  |  Branch (189:6): [True: 5.86k, False: 0]
  |  Branch (189:27): [True: 0, False: 5.86k]
  ------------------
  190|       |		/* Specific implementation of MAIL command */
  191|      0|		struct event_reason *reason =
  192|      0|			smtp_server_connection_reason_begin(conn, "cmd_mail");
  193|      0|		ret = callbacks->conn_cmd_mail(conn->context, cmd, mail_data);
  194|      0|		event_reason_end(&reason);
  195|      0|		if (ret <= 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 0]
  ------------------
  196|      0|			i_assert(ret == 0 ||
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|      0|				 smtp_server_command_is_replied(command));
  198|       |			/* Command is waiting for external event or it failed */
  199|      0|			smtp_server_command_unref(&command);
  200|      0|			return;
  201|      0|		}
  202|      0|	}
  203|  5.86k|	if (!smtp_server_command_is_replied(command)) {
  ------------------
  |  Branch (203:6): [True: 5.86k, False: 0]
  ------------------
  204|       |		/* Set generic MAIL success reply if none is provided */
  205|  5.86k|		smtp_server_cmd_mail_reply_success(cmd);
  206|  5.86k|	}
  207|  5.86k|	smtp_server_command_unref(&command);
  208|  5.86k|}
smtp_server_cmd_mail_reply_success:
  211|  5.86k|{
  212|  5.86k|	i_assert(cmd->cmd->reg->func == smtp_server_cmd_mail);
  ------------------
  |  |  219|  5.86k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  5.86k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  5.86k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  5.86k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 5.86k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 5.86k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  5.86k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  5.86k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  5.86k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  213|       |
  214|  5.86k|	smtp_server_reply(cmd, 250, "2.1.0", "OK");
  215|  5.86k|}
smtp-server-cmd-mail.c:cmd_mail_check_state:
   15|  24.6k|{
   16|  24.6k|	struct smtp_server_connection *conn = cmd->conn;
   17|  24.6k|	struct smtp_server_command *command = cmd->cmd;
   18|       |
   19|  24.6k|	if (smtp_server_command_is_replied(command) &&
  ------------------
  |  Branch (19:6): [True: 5.79k, False: 18.8k]
  ------------------
   20|  24.6k|	    !smtp_server_command_replied_success(command) &&
  ------------------
  |  Branch (20:6): [True: 0, False: 5.79k]
  ------------------
   21|  24.6k|	    !smtp_server_command_reply_is_forwarded(command))
  ------------------
  |  Branch (21:6): [True: 0, False: 0]
  ------------------
   22|      0|		return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
   23|       |
   24|  24.6k|	if (conn->state.trans != NULL) {
  ------------------
  |  Branch (24:6): [True: 1.95k, False: 22.6k]
  ------------------
   25|  1.95k|		smtp_server_reply(cmd, 503, "5.5.0", "MAIL already given");
   26|  1.95k|		return FALSE;
  ------------------
  |  |   11|  1.95k|#  define FALSE (!1)
  ------------------
   27|  1.95k|	}
   28|  22.6k|	return TRUE;
  ------------------
  |  |   15|  22.6k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  22.6k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   29|  24.6k|}
smtp-server-cmd-mail.c:cmd_mail_recheck:
   57|  5.79k|{
   58|  5.79k|	struct smtp_server_connection *conn = cmd->conn;
   59|       |
   60|       |	/* All preceding commands have finished and now the transaction state
   61|       |	   is clear. This provides the opportunity to re-check the transaction
   62|       |	   state */
   63|  5.79k|	if (!cmd_mail_check_state(cmd))
  ------------------
  |  Branch (63:6): [True: 1.23k, False: 4.56k]
  ------------------
   64|  1.23k|		return;
   65|       |
   66|       |	/* Advance state */
   67|  4.56k|	smtp_server_connection_set_state(conn, SMTP_SERVER_STATE_MAIL_FROM,
   68|  4.56k|					 smtp_address_encode(data->path));
   69|  4.56k|}
smtp-server-cmd-mail.c:cmd_mail_completed:
   34|  5.77k|{
   35|  5.77k|	struct smtp_server_connection *conn = cmd->conn;
   36|  5.77k|	struct smtp_server_command *command = cmd->cmd;
   37|       |
   38|  5.77k|	i_assert(conn->state.pending_mail_cmds > 0);
  ------------------
  |  |  219|  5.77k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  5.77k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  5.77k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  5.77k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 5.77k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 5.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  5.77k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  5.77k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  5.77k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   39|  5.77k|	conn->state.pending_mail_cmds--;
   40|       |
   41|  5.77k|	i_assert(smtp_server_command_is_replied(command));
  ------------------
  |  |  219|  5.77k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  5.77k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  5.77k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  5.77k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 5.77k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 5.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  5.77k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  5.77k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  5.77k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   42|  5.77k|	i_assert(conn->state.state == SMTP_SERVER_STATE_MAIL_FROM ||
  ------------------
  |  |  219|  5.77k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  5.77k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  5.77k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  5.89k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 5.77k]
  |  |  |  |  |  Branch (202:45): [True: 5.66k, False: 116]
  |  |  |  |  |  Branch (202:45): [True: 116, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  5.77k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  5.77k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  5.77k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   43|  5.77k|		 !smtp_server_command_replied_success(command));
   44|       |
   45|  5.77k|	if (!smtp_server_command_replied_success(command)) {
  ------------------
  |  Branch (45:6): [True: 1.22k, False: 4.54k]
  ------------------
   46|       |		/* Failure */
   47|  1.22k|		return;
   48|  1.22k|	}
   49|       |
   50|       |	/* Success */
   51|  4.54k|	conn->state.trans = smtp_server_transaction_create(conn, data);
   52|  4.54k|}

smtp_server_cmd_noop:
   12|  4.59k|{
   13|  4.59k|	struct smtp_server_connection *conn = cmd->conn;
   14|  4.59k|	struct smtp_server_command *command = cmd->cmd;
   15|  4.59k|	const struct smtp_server_callbacks *callbacks = conn->callbacks;
   16|  4.59k|	const char *param, *error;
   17|  4.59k|	int ret;
   18|       |
   19|       |	/* "NOOP" [ SP String ] CRLF */
   20|  4.59k|	ret = smtp_string_parse(params, &param, &error);
   21|  4.59k|	if (ret < 0) {
  ------------------
  |  Branch (21:6): [True: 2.00k, False: 2.59k]
  ------------------
   22|  2.00k|		smtp_server_reply(cmd, 501, "5.5.4",
   23|  2.00k|				  "Invalid string parameter: %s",
   24|  2.00k|				  error);
   25|  2.00k|		return;
   26|  2.00k|	}
   27|       |
   28|  2.59k|	smtp_server_command_input_lock(cmd);
   29|       |
   30|  2.59k|	smtp_server_command_ref(command);
   31|  2.59k|	if (callbacks != NULL && callbacks->conn_cmd_noop != NULL) {
  ------------------
  |  Branch (31:6): [True: 2.59k, False: 0]
  |  Branch (31:27): [True: 0, False: 2.59k]
  ------------------
   32|       |		/* specific implementation of NOOP command */
   33|      0|		ret = callbacks->conn_cmd_noop(conn->context, cmd);
   34|      0|		if (ret <= 0) {
  ------------------
  |  Branch (34:7): [True: 0, False: 0]
  ------------------
   35|      0|			i_assert(ret == 0 ||
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   36|      0|				 smtp_server_command_is_replied(command));
   37|       |			/* command is waiting for external event or it failed */
   38|      0|			smtp_server_command_unref(&command);
   39|      0|			return;
   40|      0|		}
   41|      0|	}
   42|  2.59k|	if (!smtp_server_command_is_replied(command))
  ------------------
  |  Branch (42:6): [True: 2.59k, False: 0]
  ------------------
   43|  2.59k|		smtp_server_cmd_noop_reply_success(cmd);
   44|  2.59k|	smtp_server_command_unref(&command);
   45|  2.59k|}
smtp_server_cmd_noop_reply_success:
   48|  2.59k|{
   49|  2.59k|       i_assert(cmd->cmd->reg->func == smtp_server_cmd_noop);
  ------------------
  |  |  219|  2.59k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  2.59k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  2.59k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  2.59k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 2.59k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 2.59k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  2.59k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  2.59k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  2.59k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   50|       |
   51|  2.59k|       smtp_server_reply(cmd, 250, "2.0.0", "OK");
   52|  2.59k|}

smtp_server_cmd_quit:
   11|    325|{
   12|    325|	struct smtp_server_connection *conn = cmd->conn;
   13|    325|	struct smtp_server_command *command = cmd->cmd;
   14|    325|	const struct smtp_server_callbacks *callbacks = conn->callbacks;
   15|    325|	int ret;
   16|       |
   17|       |	/* "QUIT" CRLF */
   18|    325|	if (*params != '\0') {
  ------------------
  |  Branch (18:6): [True: 242, False: 83]
  ------------------
   19|    242|		smtp_server_reply(cmd,
   20|    242|			501, "5.5.4", "Invalid parameters");
   21|    242|		return;
   22|    242|	}
   23|       |
   24|     83|	smtp_server_connection_input_halt(conn);
   25|       |
   26|     83|	smtp_server_command_ref(command);
   27|     83|	if (callbacks != NULL && callbacks->conn_cmd_quit != NULL) {
  ------------------
  |  Branch (27:6): [True: 83, False: 0]
  |  Branch (27:27): [True: 0, False: 83]
  ------------------
   28|       |		/* specific implementation of QUIT command */
   29|      0|		if ((ret = callbacks->conn_cmd_quit(conn->context, cmd)) <= 0) {
  ------------------
  |  Branch (29:7): [True: 0, False: 0]
  ------------------
   30|      0|			i_assert(ret == 0 ||
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   31|      0|				 smtp_server_command_is_replied(command));
   32|       |			/* command is waiting for external event or it failed */
   33|      0|			smtp_server_command_unref(&command);
   34|      0|			return;
   35|      0|		}
   36|      0|	}
   37|     83|	if (!smtp_server_command_is_replied(command)) {
  ------------------
  |  Branch (37:6): [True: 83, False: 0]
  ------------------
   38|       |		/* set generic QUIT success reply if none is provided */
   39|     83|		smtp_server_reply_quit(cmd);
   40|     83|	}
   41|     83|	smtp_server_command_unref(&command);
   42|     83|}

smtp_server_cmd_rcpt:
  103|  20.7k|{
  104|  20.7k|	struct smtp_server_connection *conn = cmd->conn;
  105|  20.7k|	const struct smtp_server_settings *set = &conn->set;
  106|  20.7k|	enum smtp_capability caps = set->capabilities;
  107|  20.7k|	const struct smtp_server_callbacks *callbacks = conn->callbacks;
  108|  20.7k|	struct smtp_server_command *command = cmd->cmd;
  109|  20.7k|	struct smtp_server_cmd_rcpt *rcpt_data;
  110|  20.7k|	struct smtp_server_recipient *rcpt;
  111|  20.7k|	enum smtp_address_parse_flags path_parse_flags;
  112|  20.7k|	enum smtp_param_rcpt_parse_flags param_parse_flags;
  113|  20.7k|	const char *const *param_extensions = NULL;
  114|  20.7k|	struct smtp_address *path;
  115|  20.7k|	struct smtp_params_rcpt rcpt_params;
  116|  20.7k|	enum smtp_param_parse_error pperror;
  117|  20.7k|	const char *error;
  118|  20.7k|	int ret;
  119|       |
  120|       |	/* rcpt         = "RCPT TO:" ( "<Postmaster@" Domain ">" /
  121|       |	      "<Postmaster>" / Forward-path ) [SP Rcpt-parameters] CRLF
  122|       |	   Forward-path = Path
  123|       |	 */
  124|       |
  125|       |	/* Check transaction state as far as possible */
  126|  20.7k|	if (!cmd_rcpt_check_state(cmd, FALSE))
  ------------------
  |  |   11|  20.7k|#  define FALSE (!1)
  ------------------
  |  Branch (126:6): [True: 489, False: 20.2k]
  ------------------
  127|    489|		return;
  128|       |
  129|       |	/* ( "<Postmaster@" Domain ">" / "<Postmaster>" / Forward-path ) */
  130|  20.2k|	if (params == NULL || !str_begins_icase(params, "TO:", &params)) {
  ------------------
  |  |  128|  20.2k|	(!__builtin_constant_p(n) ? (str_begins_icase)((h), (n), (suffix_r)) : \
  |  |  ------------------
  |  |  |  Branch (128:3): [Folded - Ignored]
  |  |  ------------------
  |  |  129|  20.2k|	 (strncasecmp((h), (n), strlen(n)) != 0 ? FALSE : \
  |  |  ------------------
  |  |  |  |   11|    689|#  define FALSE (!1)
  |  |  ------------------
  |  |  |  Branch (129:4): [True: 689, False: 19.5k]
  |  |  ------------------
  |  |  130|  20.2k|	  str_begins_builtin_success((h), strlen(n), suffix_r)))
  ------------------
  |  Branch (130:6): [True: 0, False: 20.2k]
  |  Branch (130:24): [True: 689, False: 19.5k]
  ------------------
  131|    689|		smtp_server_reply(cmd,
  132|    689|			501, "5.5.4", "Invalid parameters");
  133|    689|		return;
  134|    689|	}
  135|  19.5k|	if (params[0] != ' ' && params[0] != '\t') {
  ------------------
  |  Branch (135:6): [True: 19.3k, False: 212]
  |  Branch (135:26): [True: 19.1k, False: 230]
  ------------------
  136|       |		/* no whitespace */
  137|  19.1k|	} else if ((set->workarounds &
  ------------------
  |  Branch (137:13): [True: 0, False: 442]
  ------------------
  138|    442|		    SMTP_SERVER_WORKAROUND_WHITESPACE_BEFORE_PATH) != 0) {
  139|      0|		while (*params == ' ' || *params == '\t')
  ------------------
  |  Branch (139:10): [True: 0, False: 0]
  |  Branch (139:28): [True: 0, False: 0]
  ------------------
  140|      0|			params++;
  141|    442|	} else {
  142|    442|		smtp_server_reply(cmd, 501, "5.5.4",
  143|    442|				  "Invalid TO: "
  144|    442|				  "Unexpected whitespace before path");
  145|    442|		return;
  146|    442|	}
  147|  19.1k|	path_parse_flags = SMTP_ADDRESS_PARSE_FLAG_ALLOW_LOCALPART;
  148|  19.1k|	if ((set->workarounds & SMTP_SERVER_WORKAROUND_MAILBOX_FOR_PATH) != 0)
  ------------------
  |  Branch (148:6): [True: 0, False: 19.1k]
  ------------------
  149|      0|		path_parse_flags |= SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL;
  150|  19.1k|	if (smtp_address_parse_path_full(pool_datastack_create(), params,
  ------------------
  |  Branch (150:6): [True: 4.94k, False: 14.1k]
  ------------------
  151|  19.1k|					 path_parse_flags, &path, &error,
  152|  19.1k|					 &params) < 0) {
  153|  4.94k|		smtp_server_reply(cmd,
  154|  4.94k|			501, "5.5.4", "Invalid TO: %s", error);
  155|  4.94k|		return;
  156|  4.94k|	}
  157|  14.1k|	if (*params == ' ')
  ------------------
  |  Branch (157:6): [True: 813, False: 13.3k]
  ------------------
  158|    813|		params++;
  159|  13.3k|	else if (*params != '\0') {
  ------------------
  |  Branch (159:11): [True: 444, False: 12.9k]
  ------------------
  160|    444|		smtp_server_reply(cmd, 501, "5.5.4",
  161|    444|			"Invalid TO: Invalid character in path");
  162|    444|		return;
  163|    444|	}
  164|  13.7k|	if (path->domain == NULL && !conn->set.rcpt_domain_optional &&
  ------------------
  |  Branch (164:6): [True: 1.15k, False: 12.5k]
  |  Branch (164:30): [True: 1.15k, False: 0]
  ------------------
  165|  13.7k|		strcasecmp(path->localpart, "postmaster") != 0) {
  ------------------
  |  Branch (165:3): [True: 763, False: 393]
  ------------------
  166|    763|		smtp_server_reply(cmd,
  167|    763|			501, "5.5.4", "Invalid TO: Missing domain");
  168|    763|		return;
  169|    763|	}
  170|       |
  171|       |	/* [SP Rcpt-parameters] */
  172|  12.9k|	param_parse_flags = 0;
  173|  12.9k|	if (conn->set.rcpt_domain_optional)
  ------------------
  |  Branch (173:6): [True: 0, False: 12.9k]
  ------------------
  174|      0|		param_parse_flags |= SMTP_PARAM_RCPT_FLAG_ORCPT_ALLOW_LOCALPART;
  175|  12.9k|	if (array_is_created(&conn->rcpt_param_extensions))
  ------------------
  |  |  176|  12.9k|	array_is_created_i(&(array)->arr)
  |  |  ------------------
  |  |  |  Branch (176:2): [True: 0, False: 12.9k]
  |  |  ------------------
  ------------------
  176|      0|		param_extensions = array_front(&conn->rcpt_param_extensions);
  ------------------
  |  |  277|      0|#define array_front(array) array_idx(array, 0)
  |  |  ------------------
  |  |  |  |  287|      0|	ARRAY_TYPE_CAST_CONST(array)array_idx_i(&(array)->arr, idx)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|	(typeof(*(array)->v))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  177|  12.9k|	if (smtp_params_rcpt_parse(pool_datastack_create(), params,
  ------------------
  |  Branch (177:6): [True: 800, False: 12.1k]
  ------------------
  178|  12.9k|				   param_parse_flags, caps, param_extensions,
  179|  12.9k|				   &rcpt_params, &pperror, &error) < 0) {
  180|    800|		switch (pperror) {
  181|    200|		case SMTP_PARAM_PARSE_ERROR_BAD_SYNTAX:
  ------------------
  |  Branch (181:3): [True: 200, False: 600]
  ------------------
  182|    200|			smtp_server_reply(cmd,
  183|    200|				501, "5.5.4", "%s", error);
  184|    200|			break;
  185|    600|		case SMTP_PARAM_PARSE_ERROR_NOT_SUPPORTED:
  ------------------
  |  Branch (185:3): [True: 600, False: 200]
  ------------------
  186|    600|			smtp_server_reply(cmd,
  187|    600|				555, "5.5.4", "%s", error);
  188|    600|			break;
  189|      0|		default:
  ------------------
  |  Branch (189:3): [True: 0, False: 800]
  ------------------
  190|      0|			i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
  191|    800|		}
  192|    800|		return;
  193|    800|	}
  194|       |
  195|  12.1k|	rcpt = smtp_server_recipient_create(cmd, path, &rcpt_params);
  196|       |
  197|  12.1k|	rcpt_data = p_new(cmd->pool, struct smtp_server_cmd_rcpt, 1);
  ------------------
  |  |   97|  12.1k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|  12.1k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|  12.1k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|  12.1k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  12.1k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  198|  12.1k|	rcpt_data->rcpt = rcpt;
  199|  12.1k|	command->data = rcpt_data;
  200|       |
  201|  12.1k|	smtp_server_command_add_hook(command, SMTP_SERVER_COMMAND_HOOK_NEXT,
  ------------------
  |  |  588|  12.1k|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|  12.1k|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|  12.1k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  12.1k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  12.1k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  12.1k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|  12.1k|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|  12.1k|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
  202|  12.1k|				     cmd_rcpt_recheck, rcpt_data);
  203|  12.1k|	smtp_server_command_add_hook(command, SMTP_SERVER_COMMAND_HOOK_COMPLETED,
  ------------------
  |  |  588|  12.1k|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|  12.1k|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|  12.1k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  12.1k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  12.1k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  12.1k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|  12.1k|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|  12.1k|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
  204|  12.1k|				     cmd_rcpt_completed, rcpt_data);
  205|  12.1k|	smtp_server_command_add_hook(command, SMTP_SERVER_COMMAND_HOOK_DESTROY,
  ------------------
  |  |  588|  12.1k|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|  12.1k|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|  12.1k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  12.1k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  12.1k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  12.1k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|  12.1k|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|  12.1k|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
  206|  12.1k|				     cmd_rcpt_destroy, rcpt_data);
  207|       |
  208|  12.1k|	conn->state.pending_rcpt_cmds++;
  209|       |
  210|  12.1k|	smtp_server_command_ref(command);
  211|  12.1k|	i_assert(callbacks != NULL && callbacks->conn_cmd_rcpt != NULL);
  ------------------
  |  |  219|  12.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  12.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  12.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  24.3k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 12.1k]
  |  |  |  |  |  Branch (202:45): [True: 12.1k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 12.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  12.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  12.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  212|       |
  213|  12.1k|	struct event_reason *reason =
  214|  12.1k|		smtp_server_connection_reason_begin(conn, "cmd_rcpt");
  215|  12.1k|	ret = callbacks->conn_cmd_rcpt(conn->context, cmd, rcpt);
  216|  12.1k|	event_reason_end(&reason);
  217|  12.1k|	if (ret <= 0) {
  ------------------
  |  Branch (217:6): [True: 0, False: 12.1k]
  ------------------
  218|      0|		i_assert(ret == 0 || smtp_server_command_is_replied(command));
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  219|       |		/* Command is waiting for external event or it failed */
  220|      0|		smtp_server_command_unref(&command);
  221|      0|		return;
  222|      0|	}
  223|  12.1k|	if (!smtp_server_command_is_replied(command)) {
  ------------------
  |  Branch (223:6): [True: 12.1k, False: 0]
  ------------------
  224|       |		/* Set generic RCPT success reply if none is provided */
  225|  12.1k|		smtp_server_cmd_rcpt_reply_success(cmd);
  226|  12.1k|	}
  227|  12.1k|	smtp_server_command_unref(&command);
  228|  12.1k|}
smtp_server_command_is_rcpt:
  231|  24.3k|{
  232|  24.3k|	return (cmd->cmd->reg->func == smtp_server_cmd_rcpt);
  233|  24.3k|}
smtp_server_cmd_rcpt_reply_success:
  236|  12.1k|{
  237|  12.1k|	struct smtp_server_cmd_rcpt *rcpt_data = cmd->cmd->data;
  238|       |
  239|  12.1k|	i_assert(smtp_server_command_is_rcpt(cmd));
  ------------------
  |  |  219|  12.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  12.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  12.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  12.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 12.1k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 12.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  12.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  12.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  240|       |
  241|  12.1k|	smtp_server_recipient_reply(rcpt_data->rcpt, 250, "2.1.5", "OK");
  242|  12.1k|}
smtp-server-cmd-rcpt.c:cmd_rcpt_check_state:
   28|  32.8k|{
   29|  32.8k|	struct smtp_server_connection *conn = cmd->conn;
   30|  32.8k|	struct smtp_server_command *command = cmd->cmd;
   31|  32.8k|	struct smtp_server_transaction *trans = conn->state.trans;
   32|       |
   33|  32.8k|	if (smtp_server_command_is_replied(command) &&
  ------------------
  |  Branch (33:6): [True: 12.1k, False: 20.7k]
  ------------------
   34|  32.8k|	    !smtp_server_command_replied_success(command) &&
  ------------------
  |  Branch (34:6): [True: 0, False: 12.1k]
  ------------------
   35|  32.8k|	    !smtp_server_command_reply_is_forwarded(command))
  ------------------
  |  Branch (35:6): [True: 0, False: 0]
  ------------------
   36|      0|		return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
   37|       |
   38|  32.8k|	if (trans == NULL &&
  ------------------
  |  Branch (38:6): [True: 8.39k, False: 24.4k]
  ------------------
   39|  32.8k|	    (conn->state.pending_mail_cmds == 0 || next_to_reply)) {
  ------------------
  |  Branch (39:7): [True: 489, False: 7.90k]
  |  Branch (39:45): [True: 0, False: 7.90k]
  ------------------
   40|    489|		smtp_server_reply(cmd,
   41|    489|			503, "5.5.0", "MAIL needed first");
   42|    489|		return FALSE;
  ------------------
  |  |   11|    489|#  define FALSE (!1)
  ------------------
   43|    489|	}
   44|  32.3k|	if (conn->set.max_recipients > 0 && trans != NULL &&
  ------------------
  |  Branch (44:6): [True: 0, False: 32.3k]
  |  Branch (44:38): [True: 0, False: 0]
  ------------------
   45|  32.3k|		smtp_server_transaction_rcpt_count(trans) >=
  ------------------
  |  Branch (45:3): [True: 0, False: 0]
  ------------------
   46|      0|			conn->set.max_recipients) {
   47|      0|		smtp_server_reply(cmd,
   48|      0|			451, "4.5.3", "Too many recipients");
   49|      0|		return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
   50|      0|	}
   51|       |
   52|  32.3k|	return TRUE;
  ------------------
  |  |   15|  32.3k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  32.3k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   53|  32.3k|}
smtp-server-cmd-rcpt.c:cmd_rcpt_recheck:
   86|  12.1k|{
   87|  12.1k|	struct smtp_server_connection *conn = cmd->conn;
   88|       |
   89|       |	/* All preceding commands have finished and now the transaction state
   90|       |	   is clear. This provides the opportunity to re-check the transaction
   91|       |	   state and abort the pending proxied mail command if it is bound to
   92|       |	   fail */
   93|  12.1k|	if (!cmd_rcpt_check_state(cmd, TRUE))
  ------------------
  |  |   15|  12.1k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  12.1k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  |  Branch (93:6): [True: 0, False: 12.1k]
  ------------------
   94|      0|		return;
   95|       |
   96|       |	/* Advance state */
   97|  12.1k|	smtp_server_connection_set_state(conn, SMTP_SERVER_STATE_RCPT_TO,
   98|  12.1k|					 smtp_address_encode(data->rcpt->path));
   99|  12.1k|}
smtp-server-cmd-rcpt.c:cmd_rcpt_completed:
   58|  12.1k|{
   59|  12.1k|	struct smtp_server_connection *conn = cmd->conn;
   60|  12.1k|	struct smtp_server_command *command = cmd->cmd;
   61|  12.1k|	struct smtp_server_recipient *rcpt = data->rcpt;
   62|       |
   63|  12.1k|	i_assert(conn->state.pending_rcpt_cmds > 0);
  ------------------
  |  |  219|  12.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  12.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  12.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  12.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 12.1k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 12.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  12.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  12.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   64|  12.1k|	conn->state.pending_rcpt_cmds--;
   65|       |
   66|  12.1k|	i_assert(smtp_server_command_is_replied(command));
  ------------------
  |  |  219|  12.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  12.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  12.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  12.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 12.1k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 12.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  12.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  12.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   67|  12.1k|	i_assert(conn->state.state == SMTP_SERVER_STATE_RCPT_TO ||
  ------------------
  |  |  219|  12.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  12.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  12.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  12.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 12.1k]
  |  |  |  |  |  Branch (202:45): [True: 12.1k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  12.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  12.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   68|  12.1k|		 !smtp_server_command_replied_success(command));
   69|       |
   70|  12.1k|	if (!smtp_server_command_replied_success(command)) {
  ------------------
  |  Branch (70:6): [True: 0, False: 12.1k]
  ------------------
   71|       |		/* Failure */
   72|      0|		conn->state.denied_rcpt_cmds++;
   73|      0|		smtp_server_recipient_denied(
   74|      0|			rcpt, smtp_server_command_get_reply(cmd->cmd, 0));
   75|      0|		return;
   76|      0|	}
   77|       |
   78|       |	/* Success */
   79|  12.1k|	data->rcpt = NULL; /* clear to prevent destruction */
   80|  12.1k|	(void)smtp_server_recipient_approved(&rcpt);
   81|  12.1k|}
smtp-server-cmd-rcpt.c:cmd_rcpt_destroy:
   22|  12.1k|{
   23|  12.1k|	smtp_server_recipient_destroy(&data->rcpt);
   24|  12.1k|}

smtp_server_cmd_rset:
   29|  5.72k|{
   30|  5.72k|	struct smtp_server_connection *conn = cmd->conn;
   31|  5.72k|	const struct smtp_server_callbacks *callbacks = conn->callbacks;
   32|  5.72k|	struct smtp_server_command *command = cmd->cmd;
   33|  5.72k|	int ret;
   34|       |
   35|       |	/* rset = "RSET" CRLF */
   36|  5.72k|	if (*params != '\0') {
  ------------------
  |  Branch (36:6): [True: 261, False: 5.46k]
  ------------------
   37|    261|		smtp_server_reply(cmd,
   38|    261|			501, "5.5.4", "Invalid parameters");
   39|    261|		return;
   40|    261|	}
   41|       |
   42|  5.46k|	smtp_server_command_pipeline_block(cmd);
   43|  5.46k|	smtp_server_command_add_hook(command, SMTP_SERVER_COMMAND_HOOK_COMPLETED,
  ------------------
  |  |  588|  5.46k|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|  5.46k|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|  5.46k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  5.46k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  5.46k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  5.46k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|  5.46k|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|  5.46k|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
   44|  5.46k|				     cmd_rset_completed, NULL);
   45|       |
   46|  5.46k|	smtp_server_command_ref(command);
   47|  5.46k|	if (callbacks != NULL && callbacks->conn_cmd_rset != NULL) {
  ------------------
  |  Branch (47:6): [True: 5.46k, False: 0]
  |  Branch (47:27): [True: 0, False: 5.46k]
  ------------------
   48|       |		/* specific implementation of RSET command */
   49|      0|		if ((ret=callbacks->conn_cmd_rset(conn->context, cmd)) <= 0) {
  ------------------
  |  Branch (49:7): [True: 0, False: 0]
  ------------------
   50|      0|			i_assert(ret == 0 ||
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   51|      0|				 smtp_server_command_is_replied(command));
   52|       |			/* command is waiting for external event or it failed */
   53|      0|			smtp_server_command_unref(&command);
   54|      0|			return;
   55|      0|		}
   56|      0|	}
   57|       |
   58|  5.46k|	if (!smtp_server_command_is_replied(command)) {
  ------------------
  |  Branch (58:6): [True: 5.46k, False: 0]
  ------------------
   59|       |		/* set generic RSET success reply if none is provided */
   60|  5.46k|		smtp_server_cmd_rset_reply_success(cmd);
   61|  5.46k|	}
   62|  5.46k|	smtp_server_command_unref(&command);;
   63|  5.46k|}
smtp_server_cmd_rset_reply_success:
   66|  5.46k|{
   67|  5.46k|	i_assert(cmd->cmd->reg->func == smtp_server_cmd_rset);
  ------------------
  |  |  219|  5.46k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  5.46k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  5.46k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  5.46k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 5.46k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 5.46k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  5.46k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  5.46k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  5.46k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   68|       |
   69|  5.46k|	smtp_server_reply(cmd, 250, "2.0.0", "OK");
   70|  5.46k|}
smtp-server-cmd-rset.c:cmd_rset_completed:
   11|  5.46k|{
   12|  5.46k|	struct smtp_server_connection *conn = cmd->conn;
   13|  5.46k|	struct smtp_server_command *command = cmd->cmd;
   14|       |
   15|  5.46k|	i_assert(smtp_server_command_is_replied(command));
  ------------------
  |  |  219|  5.46k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  5.46k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  5.46k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  5.46k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 5.46k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 5.46k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  5.46k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  5.46k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  5.46k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   16|  5.46k|	if (!smtp_server_command_replied_success(command)) {
  ------------------
  |  Branch (16:6): [True: 0, False: 5.46k]
  ------------------
   17|       |		/* failure */
   18|      0|		return;
   19|      0|	}
   20|       |
   21|       |	/* success */
   22|  5.46k|	if (conn->state.trans != NULL)
  ------------------
  |  Branch (22:6): [True: 907, False: 4.55k]
  ------------------
   23|    907|		smtp_server_transaction_reset(conn->state.trans);
   24|  5.46k|	smtp_server_connection_reset_state(conn);
   25|  5.46k|}

smtp_server_cmd_starttls:
  151|    574|{
  152|    574|	struct smtp_server_connection *conn = cmd->conn;
  153|    574|	struct smtp_server_command *command = cmd->cmd;
  154|    574|	enum smtp_capability capabilities = conn->set.capabilities;
  155|       |
  156|    574|	if (conn->ssl_secured) {
  ------------------
  |  Branch (156:6): [True: 0, False: 574]
  ------------------
  157|      0|		i_assert((capabilities & SMTP_CAPABILITY_STARTTLS) == 0);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  158|      0|		smtp_server_reply(cmd,
  159|      0|			502, "5.5.1", "TLS is already active.");
  160|      0|		return;
  161|    574|	} else if ((capabilities & SMTP_CAPABILITY_STARTTLS) == 0) {
  ------------------
  |  Branch (161:13): [True: 574, False: 0]
  ------------------
  162|    574|		smtp_server_reply(cmd,
  163|    574|			502, "5.5.1", "TLS support is not enabled.");
  164|    574|		return;
  165|    574|	}
  166|       |
  167|       |	/* "STARTTLS" CRLF */
  168|      0|	if (*params != '\0') {
  ------------------
  |  Branch (168:6): [True: 0, False: 0]
  ------------------
  169|      0|		smtp_server_reply(cmd,
  170|      0|			501, "5.5.4", "Invalid parameters");
  171|      0|		return;
  172|      0|	}
  173|       |
  174|      0|	smtp_server_command_input_lock(cmd);
  175|      0|	smtp_server_connection_input_lock(conn);
  176|       |
  177|      0|	smtp_server_command_add_hook(command, SMTP_SERVER_COMMAND_HOOK_NEXT,
  ------------------
  |  |  588|      0|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|      0|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|      0|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|      0|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|      0|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|      0|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
  178|      0|				     cmd_starttls_next, NULL);
  179|      0|}

smtp_server_cmd_vrfy:
   12|  1.02k|{
   13|  1.02k|	struct smtp_server_connection *conn = cmd->conn;
   14|  1.02k|	struct smtp_server_command *command = cmd->cmd;
   15|  1.02k|	const struct smtp_server_callbacks *callbacks = conn->callbacks;
   16|  1.02k|	const char *param, *error;
   17|  1.02k|	int ret;
   18|       |
   19|       |	/* vrfy = "VRFY" SP String CRLF */
   20|  1.02k|	ret = smtp_string_parse(params, &param, &error);
   21|  1.02k|	if (ret < 0) {
  ------------------
  |  Branch (21:6): [True: 202, False: 822]
  ------------------
   22|    202|		smtp_server_reply(cmd, 501, "5.5.4",
   23|    202|				  "Invalid string parameter: %s", error);
   24|    202|		return;
   25|    822|	} else if (ret == 0) {
  ------------------
  |  Branch (25:13): [True: 419, False: 403]
  ------------------
   26|    419|		smtp_server_reply(cmd, 501, "5.5.4", "Invalid parameters");
   27|    419|		return;
   28|    419|	}
   29|       |
   30|    403|	smtp_server_command_ref(command);
   31|    403|	if (callbacks != NULL && callbacks->conn_cmd_vrfy != NULL) {
  ------------------
  |  Branch (31:6): [True: 403, False: 0]
  |  Branch (31:27): [True: 0, False: 403]
  ------------------
   32|       |		/* specific implementation of VRFY command */
   33|      0|		ret = callbacks->conn_cmd_vrfy(conn->context, cmd, param);
   34|      0|		if (ret <= 0) {
  ------------------
  |  Branch (34:7): [True: 0, False: 0]
  ------------------
   35|      0|			i_assert(ret == 0 ||
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   36|      0|				 smtp_server_command_is_replied(command));
   37|       |			/* command is waiting for external event or it failed */
   38|      0|			smtp_server_command_unref(&command);
   39|      0|			return;
   40|      0|		}
   41|      0|	}
   42|       |
   43|       |	/* RFC 5321, Section 3.5.3:
   44|       |
   45|       |	   A server MUST NOT return a 250 code in response to a VRFY or EXPN
   46|       |	   command unless it has actually verified the address. In particular,
   47|       |	   a server MUST NOT return 250 if all it has done is to verify that the
   48|       |	   syntax given is valid. In that case, 502 (Command not implemented)
   49|       |	   or 500 (Syntax error, command unrecognized) SHOULD be returned. As
   50|       |	   stated elsewhere, implementation (in the sense of actually validating
   51|       |	   addresses and returning information) of VRFY and EXPN are strongly
   52|       |	   recommended. Hence, implementations that return 500 or 502 for VRFY
   53|       |	   are not in full compliance with this specification.
   54|       |
   55|       |	   There may be circumstances where an address appears to be valid but
   56|       |	   cannot reasonably be verified in real time, particularly when a
   57|       |	   server is acting as a mail exchanger for another server or domain.
   58|       |	   "Apparent validity", in this case, would normally involve at least
   59|       |	   syntax checking and might involve verification that any domains
   60|       |	   specified were ones to which the host expected to be able to relay
   61|       |	   mail. In these situations, reply code 252 SHOULD be returned.
   62|       |	 */
   63|    403|	if (!smtp_server_command_is_replied(command))
  ------------------
  |  Branch (63:6): [True: 403, False: 0]
  ------------------
   64|    403|		smtp_server_cmd_vrfy_reply_default(cmd);
   65|    403|	smtp_server_command_unref(&command);
   66|    403|}
smtp_server_cmd_vrfy_reply_default:
   69|    403|{
   70|    403|	i_assert(cmd->cmd->reg->func == smtp_server_cmd_vrfy);
  ------------------
  |  |  219|    403|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    403|#  define STMT_START do
  |  |  ------------------
  |  |  220|    403|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    403|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 403]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 403]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    403|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    403|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    403|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   71|       |
   72|    403|	smtp_server_reply(cmd, 252, "2.3.3", "Try RCPT instead");
   73|    403|}

smtp_server_cmd_xclient:
   88|    233|{
   89|    233|	struct smtp_server_connection *conn = cmd->conn;
   90|    233|	struct smtp_server_command *command = cmd->cmd;
   91|    233|	const struct smtp_server_callbacks *callbacks = conn->callbacks;
   92|    233|	struct smtp_proxy_data *proxy_data;
   93|    233|	ARRAY_TYPE(smtp_proxy_data_field) extra_fields = ARRAY_INIT;
  ------------------
  |  |   10|    233|	union array ## __ ## name
  ------------------
              	ARRAY_TYPE(smtp_proxy_data_field) extra_fields = ARRAY_INIT;
  ------------------
  |  |    5|    233|#define ARRAY_INIT { { NULL, 0 } }
  ------------------
   94|    233|	const char *const *argv;
   95|       |
   96|       |	/* xclient-command = XCLIENT 1*( SP attribute-name"="attribute-value )
   97|       |	   attribute-name = ( NAME | ADDR | PORT | PROTO | HELO | LOGIN )
   98|       |	   attribute-value = xtext
   99|       |	 */
  100|       |
  101|    233|	if ((conn->set.capabilities & SMTP_CAPABILITY_XCLIENT) == 0) {
  ------------------
  |  Branch (101:6): [True: 233, False: 0]
  ------------------
  102|    233|		smtp_server_reply(cmd,
  103|    233|			502, "5.5.1", "Unsupported command");
  104|    233|		return;
  105|    233|	}
  106|       |
  107|       |	/* check transaction state as far as possible */
  108|      0|	if (!cmd_xclient_check_state(cmd))
  ------------------
  |  Branch (108:6): [True: 0, False: 0]
  ------------------
  109|      0|		return;
  110|       |
  111|       |	/* check whether client is trusted */
  112|      0|	if (!smtp_server_connection_is_trusted(conn)) {
  ------------------
  |  Branch (112:6): [True: 0, False: 0]
  ------------------
  113|      0|		smtp_server_reply(cmd, 550, "5.7.14",
  114|      0|			"You are not from trusted IP");
  115|      0|		return;
  116|      0|	}
  117|       |
  118|      0|	proxy_data = p_new(cmd->pool, struct smtp_proxy_data, 1);
  ------------------
  |  |   97|      0|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|      0|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|      0|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  119|       |
  120|      0|	argv = t_strsplit(params, " ");
  121|      0|	for (; *argv != NULL; argv++) {
  ------------------
  |  Branch (121:9): [True: 0, False: 0]
  ------------------
  122|      0|		struct smtp_param param;
  123|      0|		const char *error;
  124|       |
  125|      0|		if (smtp_param_parse(pool_datastack_create(), *argv,
  ------------------
  |  Branch (125:7): [True: 0, False: 0]
  ------------------
  126|      0|			&param, &error) < 0) {
  127|      0|			smtp_server_reply(cmd, 501, "5.5.4",
  128|      0|				"Invalid parameter: %s", error);
  129|      0|			return;
  130|      0|		}
  131|       |
  132|      0|		param.keyword = t_str_ucase(param.keyword);
  133|       |
  134|      0|		if (smtp_xtext_parse(param.value, &param.value, &error) < 0) {
  ------------------
  |  Branch (134:7): [True: 0, False: 0]
  ------------------
  135|      0|			smtp_server_reply(cmd, 501, "5.5.4",
  136|      0|				"Invalid %s parameter: %s",
  137|      0|				param.keyword, error);
  138|      0|			return;
  139|      0|		}
  140|       |
  141|      0|		if (strcmp(param.keyword, "ADDR") == 0) {
  ------------------
  |  Branch (141:7): [True: 0, False: 0]
  ------------------
  142|      0|			bool ipv6 = FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  143|      0|			if (strcasecmp(param.value, "[UNAVAILABLE]") == 0)
  ------------------
  |  Branch (143:8): [True: 0, False: 0]
  ------------------
  144|      0|				continue;
  145|      0|			if (str_begins_icase(param.value, "IPV6:", &param.value))
  ------------------
  |  |  128|      0|	(!__builtin_constant_p(n) ? (str_begins_icase)((h), (n), (suffix_r)) : \
  |  |  ------------------
  |  |  |  Branch (128:2): [True: 0, False: 0]
  |  |  |  Branch (128:3): [Folded - Ignored]
  |  |  ------------------
  |  |  129|      0|	 (strncasecmp((h), (n), strlen(n)) != 0 ? FALSE : \
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  |  |  |  Branch (129:4): [True: 0, False: 0]
  |  |  ------------------
  |  |  130|      0|	  str_begins_builtin_success((h), strlen(n), suffix_r)))
  ------------------
  146|      0|				ipv6 = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  147|      0|			if (net_addr2ip(param.value, &proxy_data->source_ip) < 0 ||
  ------------------
  |  Branch (147:8): [True: 0, False: 0]
  ------------------
  148|      0|				(ipv6 && proxy_data->source_ip.family != AF_INET6)) {
  ------------------
  |  Branch (148:6): [True: 0, False: 0]
  |  Branch (148:14): [True: 0, False: 0]
  ------------------
  149|      0|				smtp_server_reply(cmd, 501, "5.5.4",
  150|      0|					"Invalid ADDR parameter");
  151|      0|				return;
  152|      0|			}
  153|      0|		} else if (strcmp(param.keyword, "HELO") == 0) {
  ------------------
  |  Branch (153:14): [True: 0, False: 0]
  ------------------
  154|      0|			if (strcasecmp(param.value, "[UNAVAILABLE]") == 0)
  ------------------
  |  Branch (154:8): [True: 0, False: 0]
  ------------------
  155|      0|				continue;
  156|      0|			if (smtp_helo_domain_parse
  ------------------
  |  Branch (156:8): [True: 0, False: 0]
  ------------------
  157|      0|				(param.value, TRUE, &proxy_data->helo) >= 0)
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  158|      0|				proxy_data->helo =
  159|      0|					p_strdup(cmd->pool, proxy_data->helo);
  160|      0|		} else if (strcmp(param.keyword, "LOGIN") == 0) {
  ------------------
  |  Branch (160:14): [True: 0, False: 0]
  ------------------
  161|      0|			if (strcasecmp(param.value, "[UNAVAILABLE]") == 0)
  ------------------
  |  Branch (161:8): [True: 0, False: 0]
  ------------------
  162|      0|				continue;
  163|      0|			proxy_data->login = p_strdup(cmd->pool, param.value);
  164|      0|		} else if (strcmp(param.keyword, "PORT") == 0) {
  ------------------
  |  Branch (164:14): [True: 0, False: 0]
  ------------------
  165|      0|			if (strcasecmp(param.value, "[UNAVAILABLE]") == 0)
  ------------------
  |  Branch (165:8): [True: 0, False: 0]
  ------------------
  166|      0|				continue;
  167|      0|			if (net_str2port(param.value, &proxy_data->source_port) < 0) {
  ------------------
  |  Branch (167:8): [True: 0, False: 0]
  ------------------
  168|      0|				smtp_server_reply(cmd, 501, "5.5.4",
  169|      0|					"Invalid PORT parameter");
  170|      0|				return;
  171|      0|			}
  172|      0|		} else if (strcmp(param.keyword, "PROTO") == 0) {
  ------------------
  |  Branch (172:14): [True: 0, False: 0]
  ------------------
  173|      0|			param.value = t_str_ucase(param.value);
  174|      0|			if (strcmp(param.value, "SMTP") == 0)
  ------------------
  |  Branch (174:8): [True: 0, False: 0]
  ------------------
  175|      0|				proxy_data->proto = SMTP_PROXY_PROTOCOL_SMTP;
  176|      0|			else if (strcmp(param.value, "ESMTP") == 0)
  ------------------
  |  Branch (176:13): [True: 0, False: 0]
  ------------------
  177|      0|				proxy_data->proto = SMTP_PROXY_PROTOCOL_ESMTP;
  178|      0|			else if (strcmp(param.value, "LMTP") == 0)
  ------------------
  |  Branch (178:13): [True: 0, False: 0]
  ------------------
  179|      0|				proxy_data->proto = SMTP_PROXY_PROTOCOL_LMTP;
  180|      0|			else {
  181|      0|				smtp_server_reply(cmd, 501, "5.5.4",
  182|      0|					"Invalid PROTO parameter");
  183|      0|				return;
  184|      0|			}
  185|      0|		} else if (strcmp(param.keyword, "SESSION") == 0) {
  ------------------
  |  Branch (185:14): [True: 0, False: 0]
  ------------------
  186|      0|			if (strcasecmp(param.value, "[UNAVAILABLE]") == 0)
  ------------------
  |  Branch (186:8): [True: 0, False: 0]
  ------------------
  187|      0|				continue;
  188|      0|			proxy_data->session = p_strdup(cmd->pool, param.value);
  189|      0|		} else if (strcmp(param.keyword, "CLIENT-TRANSPORT") == 0) {
  ------------------
  |  Branch (189:14): [True: 0, False: 0]
  ------------------
  190|      0|			if (strcasecmp(param.value, "[UNAVAILABLE]") == 0)
  ------------------
  |  Branch (190:8): [True: 0, False: 0]
  ------------------
  191|      0|				continue;
  192|      0|			proxy_data->client_transport =
  193|      0|				p_strdup(cmd->pool, param.value);
  194|      0|		} else if (strcmp(param.keyword, "DESTNAME") == 0) {
  ------------------
  |  Branch (194:14): [True: 0, False: 0]
  ------------------
  195|      0|			if (!connection_is_valid_dns_name(param.value)) {
  ------------------
  |  Branch (195:8): [True: 0, False: 0]
  ------------------
  196|      0|				smtp_server_reply(cmd, 501, "5.5.4",
  197|      0|						  "Invalid DESTNAME parameter");
  198|      0|				return;
  199|      0|			}
  200|      0|			proxy_data->local_name = p_strdup(cmd->pool, param.value);
  201|      0|		} else if (strcmp(param.keyword, "TIMEOUT") == 0) {
  ------------------
  |  Branch (201:14): [True: 0, False: 0]
  ------------------
  202|      0|			if (str_to_uint(param.value,
  ------------------
  |  Branch (202:8): [True: 0, False: 0]
  ------------------
  203|      0|				&proxy_data->timeout_secs) < 0) {
  204|      0|				smtp_server_reply(cmd, 501, "5.5.4",
  205|      0|					"Invalid TIMEOUT parameter");
  206|      0|				return;
  207|      0|			}
  208|      0|		} else if (strcmp(param.keyword, "TTL") == 0) {
  ------------------
  |  Branch (208:14): [True: 0, False: 0]
  ------------------
  209|      0|			if (str_to_uint(param.value,
  ------------------
  |  Branch (209:8): [True: 0, False: 0]
  ------------------
  210|      0|				&proxy_data->ttl_plus_1) < 0) {
  211|      0|				smtp_server_reply(cmd, 501, "5.5.4",
  212|      0|					"Invalid TTL parameter");
  213|      0|				return;
  214|      0|			}
  215|      0|			proxy_data->ttl_plus_1++;
  216|      0|		} else {
  217|      0|			smtp_server_cmd_xclient_extra_field(conn,
  218|      0|				cmd->pool, &param, &extra_fields);
  219|      0|		}
  220|      0|	}
  221|       |
  222|      0|	if (array_is_created(&extra_fields)) {
  ------------------
  |  |  176|      0|	array_is_created_i(&(array)->arr)
  |  |  ------------------
  |  |  |  Branch (176:2): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  223|      0|		proxy_data->extra_fields = array_get(&extra_fields,
  ------------------
  |  |  255|      0|	ARRAY_TYPE_CAST_CONST(array)array_get_i(&(array)->arr, count)
  |  |  ------------------
  |  |  |  |   52|      0|	(typeof(*(array)->v))
  |  |  ------------------
  ------------------
  224|      0|			&proxy_data->extra_fields_count);
  225|      0|	}
  226|       |
  227|      0|	smtp_server_command_input_lock(cmd);
  228|       |
  229|      0|	smtp_server_command_add_hook(command, SMTP_SERVER_COMMAND_HOOK_NEXT,
  ------------------
  |  |  588|      0|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|      0|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|      0|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|      0|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|      0|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|      0|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
  230|      0|				     cmd_xclient_recheck, proxy_data);
  231|      0|	smtp_server_command_add_hook(command, SMTP_SERVER_COMMAND_HOOK_COMPLETED,
  ------------------
  |  |  588|      0|	smtp_server_command_add_hook((_cmd), (_type) - \
  |  |  589|      0|		CALLBACK_TYPECHECK(_func, void (*)( \
  |  |  ------------------
  |  |  |  |  171|      0|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|      0|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  590|      0|			struct smtp_server_cmd_ctx *, typeof(_context))), \
  |  |  591|      0|		(smtp_server_cmd_func_t *)(_func), (_context))
  ------------------
  232|      0|				     cmd_xclient_completed, proxy_data);
  233|       |
  234|      0|	if (conn->state.state == SMTP_SERVER_STATE_GREETING) {
  ------------------
  |  Branch (234:6): [True: 0, False: 0]
  ------------------
  235|      0|		smtp_server_connection_set_state(
  236|      0|			conn, SMTP_SERVER_STATE_XCLIENT, NULL);
  237|      0|	}
  238|       |
  239|      0|	smtp_server_command_ref(command);
  240|      0|	if (callbacks != NULL && callbacks->conn_cmd_xclient != NULL) {
  ------------------
  |  Branch (240:6): [True: 0, False: 0]
  |  Branch (240:27): [True: 0, False: 0]
  ------------------
  241|       |		/* specific implementation of XCLIENT command */
  242|      0|		callbacks->conn_cmd_xclient(conn->context, cmd, proxy_data);
  243|      0|	}
  244|      0|	smtp_server_command_unref(&command);
  245|      0|}

smtp_server_command_register:
   17|  80.8k|{
   18|  80.8k|	struct smtp_server_command_reg cmd;
   19|       |
   20|  80.8k|	i_zero(&cmd);
  ------------------
  |  |  249|  80.8k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  80.8k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  80.8k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   21|  80.8k|	cmd.name = name;
   22|  80.8k|	cmd.func = func;
   23|  80.8k|	cmd.flags = flags;
   24|  80.8k|	array_push_back(&server->commands_reg, &cmd);
  ------------------
  |  |  282|  80.8k|#define array_push_back(array, item) array_append(array, (item), 1)
  |  |  ------------------
  |  |  |  |  214|  80.8k|	TYPE_CHECKS(void, ARRAY_TYPE_CHECK(array, data), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  80.8k|	(FALSE ? (return_type)(checks) : (func))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  80.8k|#  define FALSE (!1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (11:17): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:25): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  215|  80.8k|	array_append_i(&(array)->arr, data, count))
  |  |  ------------------
  ------------------
   25|       |
   26|  80.8k|	server->commands_unsorted = TRUE;
  ------------------
  |  |   15|  80.8k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  80.8k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   27|  80.8k|}
smtp_server_commands_init:
   90|  6.21k|{
   91|  6.21k|	p_array_init(&server->commands_reg, server->pool, 16);
  ------------------
  |  |   44|  6.21k|	array_create(array, pool, sizeof(**(array)->v), init_count)
  |  |  ------------------
  |  |  |  |  152|  6.21k|	array_create_i(&(array)->arr, pool, element_size, init_count)
  |  |  ------------------
  ------------------
   92|       |
   93|  6.21k|	switch (server->set.protocol) {
  ------------------
  |  Branch (93:10): [True: 0, False: 6.21k]
  ------------------
   94|  6.21k|	case SMTP_PROTOCOL_SMTP:
  ------------------
  |  Branch (94:2): [True: 6.21k, False: 0]
  ------------------
   95|  6.21k|		smtp_server_command_register(
   96|  6.21k|			server,	"EHLO", smtp_server_cmd_ehlo,
   97|  6.21k|			SMTP_SERVER_CMD_FLAG_PRETLS |
   98|  6.21k|			SMTP_SERVER_CMD_FLAG_PREAUTH);
   99|  6.21k|		smtp_server_command_register(
  100|  6.21k|			server, "HELO", smtp_server_cmd_helo,
  101|  6.21k|			SMTP_SERVER_CMD_FLAG_PREAUTH);
  102|  6.21k|		break;
  103|      0|	case SMTP_PROTOCOL_LMTP:
  ------------------
  |  Branch (103:2): [True: 0, False: 6.21k]
  ------------------
  104|      0|		smtp_server_command_register(
  105|      0|			server, "LHLO", smtp_server_cmd_ehlo,
  106|      0|			SMTP_SERVER_CMD_FLAG_PRETLS |
  107|      0|			SMTP_SERVER_CMD_FLAG_PREAUTH);
  108|      0|		break;
  109|  6.21k|	}
  110|       |
  111|  6.21k|	smtp_server_command_register(
  112|  6.21k|		server, "AUTH", smtp_server_cmd_auth,
  113|  6.21k|		SMTP_SERVER_CMD_FLAG_PREAUTH);
  114|  6.21k|	smtp_server_command_register(
  115|  6.21k|		server, "STARTTLS", smtp_server_cmd_starttls,
  116|  6.21k|		SMTP_SERVER_CMD_FLAG_PRETLS | SMTP_SERVER_CMD_FLAG_PREAUTH);
  117|  6.21k|	smtp_server_command_register(
  118|  6.21k|		server, "MAIL", smtp_server_cmd_mail, 0);
  119|  6.21k|	smtp_server_command_register(server, "RCPT", smtp_server_cmd_rcpt, 0);
  120|  6.21k|	smtp_server_command_register(server, "DATA", smtp_server_cmd_data, 0);
  121|  6.21k|	smtp_server_command_register(server, "BDAT", smtp_server_cmd_bdat, 0);
  122|  6.21k|	smtp_server_command_register(
  123|  6.21k|		server, "RSET", smtp_server_cmd_rset,
  124|  6.21k|		SMTP_SERVER_CMD_FLAG_PREAUTH);
  125|  6.21k|	smtp_server_command_register(server, "VRFY", smtp_server_cmd_vrfy, 0);
  126|  6.21k|	smtp_server_command_register(
  127|  6.21k|		server, "NOOP", smtp_server_cmd_noop,
  128|  6.21k|		SMTP_SERVER_CMD_FLAG_PRETLS | SMTP_SERVER_CMD_FLAG_PREAUTH);
  129|  6.21k|	smtp_server_command_register(
  130|  6.21k|		server, "QUIT", smtp_server_cmd_quit,
  131|  6.21k|		SMTP_SERVER_CMD_FLAG_PRETLS | SMTP_SERVER_CMD_FLAG_PREAUTH);
  132|       |
  133|  6.21k|	smtp_server_command_register(
  134|  6.21k|		server, "XCLIENT", smtp_server_cmd_xclient,
  135|  6.21k|		SMTP_SERVER_CMD_FLAG_PREAUTH);
  136|  6.21k|}
smtp_server_command_new_invalid:
  183|  13.0k|{
  184|  13.0k|	struct smtp_server_command *cmd;
  185|       |
  186|  13.0k|	cmd = smtp_server_command_alloc(conn);
  187|  13.0k|	smtp_server_command_update_event(cmd);
  188|       |
  189|  13.0k|	e_debug(cmd->context.event, "Invalid command");
  ------------------
  |  |   61|  13.0k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  13.0k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  13.0k|	struct event *_tmp_event = (_event); \
  |  |   63|  13.0k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  13.0k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  13.0k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 13.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  13.0k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  13.0k|	else \
  |  |   66|  13.0k|		event_send_abort(_tmp_event); \
  |  |   67|  13.0k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  13.0k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  190|       |
  191|  13.0k|	return cmd;
  192|  13.0k|}
smtp_server_command_new:
  197|   103k|{
  198|   103k|	struct smtp_server *server = conn->server;
  199|   103k|	struct smtp_server_command *cmd;
  200|       |
  201|   103k|	cmd = smtp_server_command_alloc(conn);
  202|   103k|	cmd->context.name = p_strdup(cmd->context.pool, name);
  203|   103k|	cmd->reg = smtp_server_command_find(server, name);
  204|       |
  205|   103k|	smtp_server_command_update_event(cmd);
  206|       |
  207|   103k|	e_debug(cmd->context.event, "New command");
  ------------------
  |  |   61|   103k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|   103k|#  define STMT_START do
  |  |  ------------------
  |  |   62|   103k|	struct event *_tmp_event = (_event); \
  |  |   63|   103k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|   103k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   103k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 103k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|   103k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|   103k|	else \
  |  |   66|   103k|		event_send_abort(_tmp_event); \
  |  |   67|   103k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|   103k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  208|       |
  209|   103k|	return cmd;
  210|   103k|}
smtp_server_command_execute:
  214|   103k|{
  215|   103k|	struct smtp_server_connection *conn = cmd->context.conn;
  216|       |
  217|   103k|	event_add_str(cmd->context.event, "cmd_args", params);
  218|   103k|	event_add_str(cmd->context.event, "cmd_human_args", params);
  219|       |
  220|   103k|	struct event_passthrough *e =
  221|   103k|		event_create_passthrough(cmd->context.event)->
  ------------------
  |  |  176|   103k|	event_create_passthrough((parent), __FILE__, __LINE__)
  ------------------
  222|   103k|		set_name("smtp_server_command_started");
  223|   103k|	e_debug(e->event(), "Execute command");
  ------------------
  |  |   61|   103k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|   103k|#  define STMT_START do
  |  |  ------------------
  |  |   62|   103k|	struct event *_tmp_event = (_event); \
  |  |   63|   103k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|   103k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   103k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 103k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|   103k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|   103k|	else \
  |  |   66|   103k|		event_send_abort(_tmp_event); \
  |  |   67|   103k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|   103k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  224|       |
  225|   103k|	if (cmd->reg == NULL) {
  ------------------
  |  Branch (225:6): [True: 20.7k, False: 82.5k]
  ------------------
  226|       |		/* RFC 5321, Section 4.2.4: Reply Code 502
  227|       |
  228|       |		   Questions have been raised as to when reply code 502 (Command
  229|       |		   not implemented) SHOULD be returned in preference to other
  230|       |		   codes. 502 SHOULD be used when the command is actually
  231|       |		   recognized by the SMTP server, but not implemented. If the
  232|       |		   command is not recognized, code 500 SHOULD be returned.
  233|       |		 */
  234|  20.7k|		smtp_server_command_fail(cmd,
  235|  20.7k|			500, "5.5.1", "Unknown command");
  236|       |
  237|  82.5k|	} else if (!conn->ssl_secured && conn->set.tls_required &&
  ------------------
  |  Branch (237:13): [True: 82.5k, False: 0]
  |  Branch (237:35): [True: 0, False: 82.5k]
  ------------------
  238|  82.5k|		   (cmd->reg->flags & SMTP_SERVER_CMD_FLAG_PRETLS) == 0) {
  ------------------
  |  Branch (238:6): [True: 0, False: 0]
  ------------------
  239|       |		/* RFC 3207, Section 4:
  240|       |
  241|       |		   A SMTP server that is not publicly referenced may choose to
  242|       |		   require that the client perform a TLS negotiation before
  243|       |		   accepting any commands. In this case, the server SHOULD
  244|       |		   return the reply code:
  245|       |
  246|       |		   530 Must issue a STARTTLS command first
  247|       |
  248|       |		   to every command other than NOOP, EHLO, STARTTLS, or QUIT. If
  249|       |		   the client and server are using the ENHANCEDSTATUSCODES ESMTP
  250|       |		   extension [RFC2034], the status code to be returned SHOULD be
  251|       |		   5.7.0.
  252|       |		 */
  253|      0|		smtp_server_command_fail(cmd,
  254|      0|			530, "5.7.0", "TLS required.");
  255|       |
  256|  82.5k|	} else if (!conn->authenticated && !conn->set.auth_optional &&
  ------------------
  |  Branch (256:13): [True: 82.5k, False: 0]
  |  Branch (256:37): [True: 0, False: 82.5k]
  ------------------
  257|  82.5k|		   (cmd->reg->flags & SMTP_SERVER_CMD_FLAG_PREAUTH) == 0) {
  ------------------
  |  Branch (257:6): [True: 0, False: 0]
  ------------------
  258|       |		/* RFC 4954, Section 6: Status Codes
  259|       |
  260|       |		   530 5.7.0  Authentication required
  261|       |
  262|       |		   This response SHOULD be returned by any command other than
  263|       |		   AUTH, EHLO, HELO, NOOP, RSET, or QUIT when server policy
  264|       |		   requires authentication in order to perform the requested
  265|       |		   action and authentication is not currently in force.
  266|       |		 */
  267|      0|		smtp_server_command_fail(cmd,
  268|      0|			530, "5.7.0", "Authentication required.");
  269|       |
  270|  82.5k|	} else {
  271|  82.5k|		struct smtp_server_command *tmp_cmd = cmd;
  272|       |
  273|  82.5k|		i_assert(cmd->reg->func != NULL);
  ------------------
  |  |  219|  82.5k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  82.5k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  82.5k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  82.5k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 82.5k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 82.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  82.5k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  82.5k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  82.5k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  274|  82.5k|		smtp_server_command_ref(tmp_cmd);
  275|  82.5k|		cmd->reg->func(&tmp_cmd->context, params);
  276|  82.5k|		if (tmp_cmd->state == SMTP_SERVER_COMMAND_STATE_NEW)
  ------------------
  |  Branch (276:7): [True: 4.79k, False: 77.7k]
  ------------------
  277|  4.79k|			tmp_cmd->state = SMTP_SERVER_COMMAND_STATE_PROCESSING;
  278|  82.5k|		if (!smtp_server_command_unref(&tmp_cmd))
  ------------------
  |  Branch (278:7): [True: 0, False: 82.5k]
  ------------------
  279|      0|			cmd = NULL;
  280|  82.5k|	}
  281|   103k|}
smtp_server_command_ref:
  284|   828k|{
  285|   828k|	if (cmd->destroying)
  ------------------
  |  Branch (285:6): [True: 0, False: 828k]
  ------------------
  286|      0|		return;
  287|   828k|	cmd->refcount++;
  288|   828k|}
smtp_server_command_unref:
  291|   944k|{
  292|   944k|	struct smtp_server_command *cmd = *_cmd;
  293|   944k|	struct smtp_server_connection *conn = cmd->context.conn;
  294|       |
  295|   944k|	*_cmd = NULL;
  296|       |
  297|   944k|	if (cmd->destroying)
  ------------------
  |  Branch (297:6): [True: 0, False: 944k]
  ------------------
  298|      0|		return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  299|       |
  300|   944k|	i_assert(cmd->refcount > 0);
  ------------------
  |  |  219|   944k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   944k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   944k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   944k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 944k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 944k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   944k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   944k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   944k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  301|   944k|	if (--cmd->refcount > 0)
  ------------------
  |  Branch (301:6): [True: 828k, False: 116k]
  ------------------
  302|   828k|		return TRUE;
  ------------------
  |  |   15|   828k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   828k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  303|   116k|	cmd->destroying = TRUE;
  ------------------
  |  |   15|   116k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   116k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  304|       |
  305|   116k|	if (cmd->state >= SMTP_SERVER_COMMAND_STATE_FINISHED) {
  ------------------
  |  Branch (305:6): [True: 116k, False: 0]
  ------------------
  306|   116k|		e_debug(cmd->context.event, "Destroy");
  ------------------
  |  |   61|   116k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|   116k|#  define STMT_START do
  |  |  ------------------
  |  |   62|   116k|	struct event *_tmp_event = (_event); \
  |  |   63|   116k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|   116k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   116k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 116k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|   116k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|   116k|	else \
  |  |   66|   116k|		event_send_abort(_tmp_event); \
  |  |   67|   116k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|   116k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  307|   116k|	} else {
  308|      0|		struct event_passthrough *e =
  309|      0|			event_create_passthrough(cmd->context.event)->
  ------------------
  |  |  176|      0|	event_create_passthrough((parent), __FILE__, __LINE__)
  ------------------
  310|      0|			set_name("smtp_server_command_finished");
  311|      0|		e->add_int("status_code", 9000);
  312|      0|		e->add_str("enhanced_code", "9.0.0");
  313|      0|		e->add_str("error", "Aborted");
  314|      0|		e_debug(e->event(), "Destroy");
  ------------------
  |  |   61|      0|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |   62|      0|	struct event *_tmp_event = (_event); \
  |  |   63|      0|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|      0|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|      0|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|      0|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|      0|	else \
  |  |   66|      0|		event_send_abort(_tmp_event); \
  |  |   67|      0|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  315|       |
  316|      0|		cmd->state = SMTP_SERVER_COMMAND_STATE_ABORTED;
  317|      0|		DLLIST2_REMOVE(&conn->command_queue_head,
  ------------------
  |  |   79|      0|	DLLIST2_REMOVE_FULL(head, tail, item, prev, next)
  |  |  ------------------
  |  |  |  |   65|      0|#define DLLIST2_REMOVE_FULL(head, tail, item, prev, next) STMT_START { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|      0|#  define STMT_START do
  |  |  |  |  ------------------
  |  |  |  |   66|      0|	if ((item)->prev != NULL) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   67|      0|		(item)->prev->next = (item)->next; \
  |  |  |  |   68|      0|	else if (*(head) == item) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (68:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   69|      0|		*(head) = (item)->next; \
  |  |  |  |   70|      0|	if ((item)->next != NULL) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (70:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   71|      0|		(item)->next->prev = (item)->prev; \
  |  |  |  |   72|      0|		(item)->next = NULL; \
  |  |  |  |   73|      0|	} else if ((*tail) == item) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (73:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   74|      0|		*(tail) = (item)->prev; \
  |  |  |  |   75|      0|	(item)->prev = NULL; \
  |  |  |  |   76|      0|	} STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  318|      0|			&conn->command_queue_tail, cmd);
  319|      0|		conn->command_queue_count--;
  320|      0|	}
  321|       |
  322|       |	/* Execute hooks */
  323|   116k|	if (!smtp_server_command_call_hooks(
  ------------------
  |  Branch (323:6): [True: 0, False: 116k]
  ------------------
  324|   116k|		&cmd, SMTP_SERVER_COMMAND_HOOK_DESTROY, TRUE))
  ------------------
  |  |   15|   116k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   116k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  325|      0|		i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
  326|       |
  327|   116k|	smtp_server_command_pipeline_unblock(&cmd->context);
  328|       |
  329|   116k|	smtp_server_reply_free(cmd);
  330|   116k|	event_unref(&cmd->context.event);
  331|   116k|	pool_unref(&cmd->context.pool);
  332|   116k|	return FALSE;
  ------------------
  |  |   11|   116k|#  define FALSE (!1)
  ------------------
  333|   116k|}
smtp_server_command_abort:
  336|  3.69k|{
  337|  3.69k|	struct smtp_server_command *cmd = *_cmd;
  338|  3.69k|	struct smtp_server_connection *conn = cmd->context.conn;
  339|       |
  340|       |	/* Preemptively remove command from queue (references may still exist)
  341|       |	 */
  342|  3.69k|	if (cmd->state >= SMTP_SERVER_COMMAND_STATE_FINISHED) {
  ------------------
  |  Branch (342:6): [True: 0, False: 3.69k]
  ------------------
  343|      0|		e_debug(cmd->context.event, "Abort");
  ------------------
  |  |   61|      0|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |   62|      0|	struct event *_tmp_event = (_event); \
  |  |   63|      0|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|      0|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|      0|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|      0|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|      0|	else \
  |  |   66|      0|		event_send_abort(_tmp_event); \
  |  |   67|      0|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  344|  3.69k|	} else {
  345|  3.69k|		struct event_passthrough *e =
  346|  3.69k|			event_create_passthrough(cmd->context.event)->
  ------------------
  |  |  176|  3.69k|	event_create_passthrough((parent), __FILE__, __LINE__)
  ------------------
  347|  3.69k|			set_name("smtp_server_command_finished");
  348|  3.69k|		e->add_int("status_code", 9000);
  349|  3.69k|		e->add_str("enhanced_code", "9.0.0");
  350|  3.69k|		e->add_str("error", "Aborted");
  351|  3.69k|		e_debug(e->event(), "Abort");
  ------------------
  |  |   61|  3.69k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  3.69k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  3.69k|	struct event *_tmp_event = (_event); \
  |  |   63|  3.69k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  3.69k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  3.69k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 3.69k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  3.69k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  3.69k|	else \
  |  |   66|  3.69k|		event_send_abort(_tmp_event); \
  |  |   67|  3.69k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  3.69k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  352|       |
  353|  3.69k|		cmd->state = SMTP_SERVER_COMMAND_STATE_ABORTED;
  354|  3.69k|		DLLIST2_REMOVE(&conn->command_queue_head,
  ------------------
  |  |   79|  3.69k|	DLLIST2_REMOVE_FULL(head, tail, item, prev, next)
  |  |  ------------------
  |  |  |  |   65|  3.69k|#define DLLIST2_REMOVE_FULL(head, tail, item, prev, next) STMT_START { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  3.69k|#  define STMT_START do
  |  |  |  |  ------------------
  |  |  |  |   66|  3.69k|	if ((item)->prev != NULL) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:6): [True: 0, False: 3.69k]
  |  |  |  |  ------------------
  |  |  |  |   67|  3.69k|		(item)->prev->next = (item)->next; \
  |  |  |  |   68|  3.69k|	else if (*(head) == item) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (68:11): [True: 3.69k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   69|  3.69k|		*(head) = (item)->next; \
  |  |  |  |   70|  3.69k|	if ((item)->next != NULL) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (70:6): [True: 2.50k, False: 1.18k]
  |  |  |  |  ------------------
  |  |  |  |   71|  2.50k|		(item)->next->prev = (item)->prev; \
  |  |  |  |   72|  2.50k|		(item)->next = NULL; \
  |  |  |  |   73|  2.50k|	} else if ((*tail) == item) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (73:13): [True: 1.18k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   74|  1.18k|		*(tail) = (item)->prev; \
  |  |  |  |   75|  3.69k|	(item)->prev = NULL; \
  |  |  |  |   76|  3.69k|	} STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  3.69k|#  define STMT_END while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  355|  3.69k|			&conn->command_queue_tail, cmd);
  356|  3.69k|		conn->command_queue_count--;
  357|  3.69k|	}
  358|  3.69k|	smtp_server_reply_free(cmd);
  359|       |
  360|  3.69k|	smtp_server_command_pipeline_unblock(&cmd->context);
  361|  3.69k|	smtp_server_command_unref(_cmd);
  362|  3.69k|}
smtp_server_command_add_hook:
  369|   129k|{
  370|   129k|	struct smtp_server_command_hook *hook;
  371|       |
  372|   129k|	i_assert(func != NULL);
  ------------------
  |  |  219|   129k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   129k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   129k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   129k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 129k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 129k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   129k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   129k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   129k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  373|       |
  374|   129k|	hook = cmd->hooks_head;
  375|   245k|	while (hook != NULL) {
  ------------------
  |  Branch (375:9): [True: 115k, False: 129k]
  ------------------
  376|       |		/* No double registrations */
  377|   115k|		i_assert(hook->type != type || hook->func != func);
  ------------------
  |  |  219|   115k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   115k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   115k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   115k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 115k]
  |  |  |  |  |  Branch (202:45): [True: 115k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   115k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   115k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   115k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  378|       |
  379|   115k|		hook = hook->next;
  380|   115k|	}
  381|       |
  382|   129k|	hook = p_new(cmd->context.pool, struct smtp_server_command_hook, 1);
  ------------------
  |  |   97|   129k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|   129k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|   129k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|   129k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|   129k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  383|   129k|	hook->type = type;
  384|   129k|	hook->func = func;
  385|   129k|	hook->context = context;
  386|       |
  387|   129k|	DLLIST2_APPEND(&cmd->hooks_head, &cmd->hooks_tail, hook);
  ------------------
  |  |   49|   129k|	DLLIST2_APPEND_FULL(head, tail, item, prev, next)
  |  |  ------------------
  |  |  |  |   41|   129k|#define DLLIST2_APPEND_FULL(head, tail, item, prev, next) STMT_START { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   129k|#  define STMT_START do
  |  |  |  |  ------------------
  |  |  |  |   42|   129k|	(item)->prev = *(tail); \
  |  |  |  |   43|   129k|	(item)->next = NULL; \
  |  |  |  |   44|   129k|	if (*(tail) != NULL) (*(tail))->next = (item); else (*head) = (item); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:6): [True: 78.0k, False: 51.8k]
  |  |  |  |  ------------------
  |  |  |  |   45|   129k|	*(tail) = (item); \
  |  |  |  |   46|   129k|	} STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   129k|#  define STMT_END while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  388|   129k|}
smtp_server_command_remove_hook:
  394|     89|{
  395|     89|	struct smtp_server_command_hook *hook;
  396|     89|	bool found = FALSE;
  ------------------
  |  |   11|     89|#  define FALSE (!1)
  ------------------
  397|       |
  398|     89|	hook = cmd->hooks_head;
  399|     89|	while (hook != NULL) {
  ------------------
  |  Branch (399:9): [True: 89, False: 0]
  ------------------
  400|     89|		struct smtp_server_command_hook *hook_next = hook->next;
  401|       |
  402|     89|		if (hook->type == type && hook->func == func) {
  ------------------
  |  Branch (402:7): [True: 89, False: 0]
  |  Branch (402:29): [True: 89, False: 0]
  ------------------
  403|     89|			DLLIST2_REMOVE(&cmd->hooks_head, &cmd->hooks_tail,
  ------------------
  |  |   79|     89|	DLLIST2_REMOVE_FULL(head, tail, item, prev, next)
  |  |  ------------------
  |  |  |  |   65|     89|#define DLLIST2_REMOVE_FULL(head, tail, item, prev, next) STMT_START { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|     89|#  define STMT_START do
  |  |  |  |  ------------------
  |  |  |  |   66|     89|	if ((item)->prev != NULL) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:6): [True: 0, False: 89]
  |  |  |  |  ------------------
  |  |  |  |   67|     89|		(item)->prev->next = (item)->next; \
  |  |  |  |   68|     89|	else if (*(head) == item) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (68:11): [True: 89, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   69|     89|		*(head) = (item)->next; \
  |  |  |  |   70|     89|	if ((item)->next != NULL) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (70:6): [True: 89, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   71|     89|		(item)->next->prev = (item)->prev; \
  |  |  |  |   72|     89|		(item)->next = NULL; \
  |  |  |  |   73|     89|	} else if ((*tail) == item) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (73:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   74|      0|		*(tail) = (item)->prev; \
  |  |  |  |   75|     89|	(item)->prev = NULL; \
  |  |  |  |   76|     89|	} STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|     89|#  define STMT_END while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  404|     89|				       hook);
  405|     89|			found = TRUE;
  ------------------
  |  |   15|     89|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|     89|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  406|     89|			break;
  407|     89|		}
  408|       |
  409|      0|		hook = hook_next;
  410|      0|	}
  411|     89|	i_assert(found);
  ------------------
  |  |  219|     89|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|     89|#  define STMT_START do
  |  |  ------------------
  |  |  220|     89|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|     89|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 89]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 89]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|     89|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|     89|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|     89|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  412|     89|}
smtp_server_command_call_hooks:
  417|   599k|{
  418|   599k|	struct smtp_server_command *cmd = *_cmd;
  419|   599k|	struct smtp_server_command_hook *hook;
  420|       |
  421|   599k|	if (type != SMTP_SERVER_COMMAND_HOOK_DESTROY) {
  ------------------
  |  Branch (421:6): [True: 482k, False: 116k]
  ------------------
  422|   482k|		if (cmd->state >= SMTP_SERVER_COMMAND_STATE_FINISHED)
  ------------------
  |  Branch (422:7): [True: 0, False: 482k]
  ------------------
  423|      0|			return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  424|   482k|		smtp_server_command_ref(cmd);
  425|   482k|	}
  426|       |
  427|   599k|	hook = cmd->hooks_head;
  428|  1.07M|	while (hook != NULL) {
  ------------------
  |  Branch (428:9): [True: 477k, False: 599k]
  ------------------
  429|   477k|		struct smtp_server_command_hook *hook_next = hook->next;
  430|       |
  431|   477k|		if (hook->type == type) {
  ------------------
  |  Branch (431:7): [True: 127k, False: 349k]
  ------------------
  432|   127k|			if (remove) {
  ------------------
  |  Branch (432:8): [True: 127k, False: 0]
  ------------------
  433|   127k|				DLLIST2_REMOVE(&cmd->hooks_head,
  ------------------
  |  |   79|   127k|	DLLIST2_REMOVE_FULL(head, tail, item, prev, next)
  |  |  ------------------
  |  |  |  |   65|   127k|#define DLLIST2_REMOVE_FULL(head, tail, item, prev, next) STMT_START { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   127k|#  define STMT_START do
  |  |  |  |  ------------------
  |  |  |  |   66|   127k|	if ((item)->prev != NULL) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:6): [True: 12.0k, False: 115k]
  |  |  |  |  ------------------
  |  |  |  |   67|   127k|		(item)->prev->next = (item)->next; \
  |  |  |  |   68|   127k|	else if (*(head) == item) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (68:11): [True: 115k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   69|   115k|		*(head) = (item)->next; \
  |  |  |  |   70|   127k|	if ((item)->next != NULL) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (70:6): [True: 65.4k, False: 62.1k]
  |  |  |  |  ------------------
  |  |  |  |   71|  65.4k|		(item)->next->prev = (item)->prev; \
  |  |  |  |   72|  65.4k|		(item)->next = NULL; \
  |  |  |  |   73|  65.4k|	} else if ((*tail) == item) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (73:13): [True: 62.1k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   74|  62.1k|		*(tail) = (item)->prev; \
  |  |  |  |   75|   127k|	(item)->prev = NULL; \
  |  |  |  |   76|   127k|	} STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   127k|#  define STMT_END while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  434|   127k|					       &cmd->hooks_tail, hook);
  435|   127k|			}
  436|   127k|			hook->func(&cmd->context, hook->context);
  437|   127k|		}
  438|       |
  439|   477k|		hook = hook_next;
  440|   477k|	}
  441|       |
  442|   599k|	if (type != SMTP_SERVER_COMMAND_HOOK_DESTROY) {
  ------------------
  |  Branch (442:6): [True: 482k, False: 116k]
  ------------------
  443|   482k|		if (!smtp_server_command_unref(&cmd)) {
  ------------------
  |  Branch (443:7): [True: 497, False: 482k]
  ------------------
  444|    497|			*_cmd = NULL;
  445|    497|			return FALSE;
  ------------------
  |  |   11|    497|#  define FALSE (!1)
  ------------------
  446|    497|		}
  447|   482k|	}
  448|   598k|	return TRUE;
  ------------------
  |  |   15|   598k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   598k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  449|   599k|}
smtp_server_command_remove_hooks:
  453|   135k|{
  454|   135k|	struct smtp_server_command_hook *hook;
  455|       |
  456|   135k|	hook = cmd->hooks_head;
  457|   228k|	while (hook != NULL) {
  ------------------
  |  Branch (457:9): [True: 92.7k, False: 135k]
  ------------------
  458|  92.7k|		struct smtp_server_command_hook *hook_next = hook->next;
  459|       |
  460|  92.7k|		if (hook->type == type) {
  ------------------
  |  Branch (460:7): [True: 0, False: 92.7k]
  ------------------
  461|      0|			DLLIST2_REMOVE(&cmd->hooks_head, &cmd->hooks_tail,
  ------------------
  |  |   79|      0|	DLLIST2_REMOVE_FULL(head, tail, item, prev, next)
  |  |  ------------------
  |  |  |  |   65|      0|#define DLLIST2_REMOVE_FULL(head, tail, item, prev, next) STMT_START { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|      0|#  define STMT_START do
  |  |  |  |  ------------------
  |  |  |  |   66|      0|	if ((item)->prev != NULL) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   67|      0|		(item)->prev->next = (item)->next; \
  |  |  |  |   68|      0|	else if (*(head) == item) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (68:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   69|      0|		*(head) = (item)->next; \
  |  |  |  |   70|      0|	if ((item)->next != NULL) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (70:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   71|      0|		(item)->next->prev = (item)->prev; \
  |  |  |  |   72|      0|		(item)->next = NULL; \
  |  |  |  |   73|      0|	} else if ((*tail) == item) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (73:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   74|      0|		*(tail) = (item)->prev; \
  |  |  |  |   75|      0|	(item)->prev = NULL; \
  |  |  |  |   76|      0|	} STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  462|      0|				       hook);
  463|      0|		}
  464|       |
  465|  92.7k|		hook = hook_next;
  466|  92.7k|	}
  467|   135k|}
smtp_server_command_next_to_reply:
  485|   136k|{
  486|   136k|	struct smtp_server_command *cmd = *_cmd;
  487|       |
  488|   136k|	e_debug(cmd->context.event, "Next to reply");
  ------------------
  |  |   61|   136k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|   136k|#  define STMT_START do
  |  |  ------------------
  |  |   62|   136k|	struct event *_tmp_event = (_event); \
  |  |   63|   136k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|   136k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   136k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 136k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|   136k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|   136k|	else \
  |  |   66|   136k|		event_send_abort(_tmp_event); \
  |  |   67|   136k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|   136k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  489|       |
  490|   136k|	if (!smtp_server_command_call_hooks(
  ------------------
  |  Branch (490:6): [True: 497, False: 135k]
  ------------------
  491|   136k|		_cmd, SMTP_SERVER_COMMAND_HOOK_NEXT, TRUE))
  ------------------
  |  |   15|   136k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   136k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  492|    497|		return FALSE;
  ------------------
  |  |   11|    497|#  define FALSE (!1)
  ------------------
  493|       |
  494|   135k|	smtp_server_command_remove_hooks(cmd, SMTP_SERVER_COMMAND_HOOK_NEXT);
  495|   135k|	return TRUE;
  ------------------
  |  |   15|   135k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   135k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  496|   136k|}
smtp_server_command_ready_to_reply:
  499|   115k|{
  500|   115k|	cmd->state = SMTP_SERVER_COMMAND_STATE_READY_TO_REPLY;
  501|   115k|	e_debug(cmd->context.event, "Ready to reply");
  ------------------
  |  |   61|   115k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|   115k|#  define STMT_START do
  |  |  ------------------
  |  |   62|   115k|	struct event *_tmp_event = (_event); \
  |  |   63|   115k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|   115k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   115k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 115k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|   115k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|   115k|	else \
  |  |   66|   115k|		event_send_abort(_tmp_event); \
  |  |   67|   115k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|   115k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  502|   115k|	smtp_server_connection_trigger_output(cmd->context.conn);
  503|   115k|}
smtp_server_command_completed:
  526|   112k|{
  527|   112k|	struct smtp_server_command *cmd = *_cmd;
  528|       |
  529|   112k|	if (cmd->replies_submitted < cmd->replies_expected)
  ------------------
  |  Branch (529:6): [True: 0, False: 112k]
  ------------------
  530|      0|		return TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  531|       |
  532|   112k|	e_debug(cmd->context.event, "Completed");
  ------------------
  |  |   61|   112k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|   112k|#  define STMT_START do
  |  |  ------------------
  |  |   62|   112k|	struct event *_tmp_event = (_event); \
  |  |   63|   112k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|   112k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   112k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 112k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|   112k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|   112k|	else \
  |  |   66|   112k|		event_send_abort(_tmp_event); \
  |  |   67|   112k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|   112k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  533|       |
  534|   112k|	if (cmd->pipeline_blocked)
  ------------------
  |  Branch (534:6): [True: 12.7k, False: 99.9k]
  ------------------
  535|  12.7k|		smtp_server_command_pipeline_unblock(&cmd->context);
  536|       |
  537|   112k|	return smtp_server_command_call_hooks(
  538|   112k|		_cmd, SMTP_SERVER_COMMAND_HOOK_COMPLETED, TRUE);
  ------------------
  |  |   15|   112k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   112k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  539|   112k|}
smtp_server_command_submit_reply:
  576|   116k|{
  577|   116k|	struct smtp_server_connection *conn = cmd->context.conn;
  578|   116k|	unsigned int i, submitted;
  579|   116k|	bool is_bad = FALSE;
  ------------------
  |  |   11|   116k|#  define FALSE (!1)
  ------------------
  580|       |
  581|   116k|	i_assert(conn != NULL && array_is_created(&cmd->replies));
  ------------------
  |  |  219|   116k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   116k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   116k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   233k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 116k]
  |  |  |  |  |  Branch (202:45): [True: 116k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 116k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   116k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   116k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   116k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  582|       |
  583|   116k|	submitted = 0;
  584|   233k|	for (i = 0; i < cmd->replies_expected; i++) {
  ------------------
  |  Branch (584:14): [True: 116k, False: 116k]
  ------------------
  585|   116k|		const struct smtp_server_reply *reply =
  586|   116k|			array_idx(&cmd->replies, i);
  ------------------
  |  |  287|   116k|	ARRAY_TYPE_CAST_CONST(array)array_idx_i(&(array)->arr, idx)
  |  |  ------------------
  |  |  |  |   52|   116k|	(typeof(*(array)->v))
  |  |  ------------------
  ------------------
  587|   116k|		if (!reply->submitted)
  ------------------
  |  Branch (587:7): [True: 0, False: 116k]
  ------------------
  588|      0|			continue;
  589|   116k|		submitted++;
  590|       |
  591|   116k|		i_assert(reply->content != NULL);
  ------------------
  |  |  219|   116k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   116k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   116k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   116k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 116k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 116k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   116k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   116k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   116k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  592|   116k|		switch (reply->content->status) {
  ------------------
  |  Branch (592:11): [True: 51.0k, False: 65.9k]
  ------------------
  593|  33.8k|		case 500:
  ------------------
  |  Branch (593:3): [True: 33.8k, False: 83.1k]
  ------------------
  594|  57.9k|		case 501:
  ------------------
  |  Branch (594:3): [True: 24.1k, False: 92.8k]
  ------------------
  595|  65.9k|		case 503:
  ------------------
  |  Branch (595:3): [True: 7.94k, False: 109k]
  ------------------
  596|  65.9k|			is_bad = TRUE;
  ------------------
  |  |   15|  65.9k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  65.9k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  597|  65.9k|			break;
  598|   116k|		}
  599|   116k|	}
  600|       |
  601|   116k|	i_assert(submitted == cmd->replies_submitted);
  ------------------
  |  |  219|   116k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   116k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   116k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   116k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 116k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 116k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   116k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   116k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   116k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  602|       |
  603|       |	/* Limit number of consecutive bad commands */
  604|   116k|	if (is_bad)
  ------------------
  |  Branch (604:6): [True: 65.9k, False: 51.0k]
  ------------------
  605|  65.9k|		conn->bad_counter++;
  606|  51.0k|	else if (cmd->replies_submitted == cmd->replies_expected)
  ------------------
  |  Branch (606:11): [True: 51.0k, False: 0]
  ------------------
  607|  51.0k|		conn->bad_counter = 0;
  608|       |
  609|   116k|	if (!smtp_server_command_handle_reply(cmd))
  ------------------
  |  Branch (609:6): [True: 0, False: 116k]
  ------------------
  610|      0|		return;
  611|       |
  612|   116k|	if (conn != NULL && conn->bad_counter > conn->set.max_bad_commands) {
  ------------------
  |  Branch (612:6): [True: 116k, False: 0]
  |  Branch (612:22): [True: 227, False: 116k]
  ------------------
  613|    227|		smtp_server_connection_terminate(&conn,
  614|    227|			"4.7.0", "Too many invalid commands.");
  615|    227|		return;
  616|    227|	}
  617|   116k|}
smtp_server_command_is_replied:
  620|   150k|{
  621|   150k|	unsigned int i;
  622|       |
  623|   150k|	if (!array_is_created(&cmd->replies))
  ------------------
  |  |  176|   150k|	array_is_created_i(&(array)->arr)
  ------------------
  |  Branch (623:6): [True: 84.4k, False: 65.7k]
  ------------------
  624|  84.4k|		return FALSE;
  ------------------
  |  |   11|  84.4k|#  define FALSE (!1)
  ------------------
  625|       |
  626|   131k|	for (i = 0; i < cmd->replies_expected; i++) {
  ------------------
  |  Branch (626:14): [True: 65.7k, False: 65.7k]
  ------------------
  627|  65.7k|		const struct smtp_server_reply *reply =
  628|  65.7k|			array_idx(&cmd->replies, i);
  ------------------
  |  |  287|  65.7k|	ARRAY_TYPE_CAST_CONST(array)array_idx_i(&(array)->arr, idx)
  |  |  ------------------
  |  |  |  |   52|  65.7k|	(typeof(*(array)->v))
  |  |  ------------------
  ------------------
  629|  65.7k|		if (!reply->submitted)
  ------------------
  |  Branch (629:7): [True: 0, False: 65.7k]
  ------------------
  630|      0|			return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  631|  65.7k|	}
  632|       |
  633|  65.7k|	return TRUE;
  ------------------
  |  |   15|  65.7k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  65.7k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  634|  65.7k|}
smtp_server_command_get_reply:
  658|  6.56k|{
  659|  6.56k|	struct smtp_server_reply *reply;
  660|       |
  661|  6.56k|	i_assert(idx < cmd->replies_expected);
  ------------------
  |  |  219|  6.56k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.56k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.56k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.56k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.56k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.56k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.56k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.56k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  662|       |
  663|  6.56k|	if (!array_is_created(&cmd->replies))
  ------------------
  |  |  176|  6.56k|	array_is_created_i(&(array)->arr)
  ------------------
  |  Branch (663:6): [True: 0, False: 6.56k]
  ------------------
  664|      0|		return NULL;
  665|       |
  666|  6.56k|	reply = array_idx_get_space(&cmd->replies, idx);
  ------------------
  |  |  317|  6.56k|	ARRAY_TYPE_CAST_MODIFIABLE(array) \
  |  |  ------------------
  |  |  |  |   54|  6.56k|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  |  |  318|  6.56k|		array_idx_get_space_i(&(array)->arr, idx)
  ------------------
  667|  6.56k|	if (!reply->submitted)
  ------------------
  |  Branch (667:6): [True: 0, False: 6.56k]
  ------------------
  668|      0|		return NULL;
  669|  6.56k|	return reply;
  670|  6.56k|}
smtp_server_command_replied_success:
  684|  94.5k|{
  685|  94.5k|	bool success = FALSE;
  ------------------
  |  |   11|  94.5k|#  define FALSE (!1)
  ------------------
  686|  94.5k|	unsigned int i;
  687|       |
  688|  94.5k|	if (!array_is_created(&cmd->replies))
  ------------------
  |  |  176|  94.5k|	array_is_created_i(&(array)->arr)
  ------------------
  |  Branch (688:6): [True: 0, False: 94.5k]
  ------------------
  689|      0|		return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  690|       |
  691|   189k|	for (i = 0; i < cmd->replies_expected; i++) {
  ------------------
  |  Branch (691:14): [True: 94.5k, False: 94.5k]
  ------------------
  692|  94.5k|		const struct smtp_server_reply *reply =
  693|  94.5k|			array_idx(&cmd->replies, i);
  ------------------
  |  |  287|  94.5k|	ARRAY_TYPE_CAST_CONST(array)array_idx_i(&(array)->arr, idx)
  |  |  ------------------
  |  |  |  |   52|  94.5k|	(typeof(*(array)->v))
  |  |  ------------------
  ------------------
  694|  94.5k|		if (!reply->submitted)
  ------------------
  |  Branch (694:7): [True: 0, False: 94.5k]
  ------------------
  695|      0|			return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  696|  94.5k|		if (smtp_server_reply_is_success(reply))
  ------------------
  |  Branch (696:7): [True: 75.4k, False: 19.0k]
  ------------------
  697|  75.4k|			success = TRUE;
  ------------------
  |  |   15|  75.4k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  75.4k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  698|  94.5k|	}
  699|       |
  700|  94.5k|	return success;
  701|  94.5k|}
smtp_server_command_send_replies:
  735|   113k|{
  736|   113k|	int ret;
  737|       |
  738|   113k|	if (!smtp_server_command_next_to_reply(&cmd))
  ------------------
  |  Branch (738:6): [True: 497, False: 113k]
  ------------------
  739|    497|		return FALSE;
  ------------------
  |  |   11|    497|#  define FALSE (!1)
  ------------------
  740|   113k|	if (cmd->state < SMTP_SERVER_COMMAND_STATE_READY_TO_REPLY)
  ------------------
  |  Branch (740:6): [True: 618, False: 112k]
  ------------------
  741|    618|		return FALSE;
  ------------------
  |  |   11|    618|#  define FALSE (!1)
  ------------------
  742|       |
  743|   113k|	i_assert(cmd->state == SMTP_SERVER_COMMAND_STATE_READY_TO_REPLY &&
  ------------------
  |  |  219|   112k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   112k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   112k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   225k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 112k]
  |  |  |  |  |  Branch (202:45): [True: 112k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 112k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   112k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   113k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   113k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  744|   112k|		 array_is_created(&cmd->replies));
  745|       |
  746|   112k|	if (!smtp_server_command_completed(&cmd))
  ------------------
  |  Branch (746:6): [True: 0, False: 112k]
  ------------------
  747|      0|		return TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  748|       |
  749|       |	/* Send command replies */
  750|   112k|	ret = smtp_server_command_send_more_replies(cmd);
  751|   112k|	if (ret < 0)
  ------------------
  |  Branch (751:6): [True: 0, False: 112k]
  ------------------
  752|      0|		return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  753|   112k|	if (ret == 0) {
  ------------------
  |  Branch (753:6): [True: 0, False: 112k]
  ------------------
  754|      0|		cmd->state = SMTP_SERVER_COMMAND_STATE_PROCESSING;
  755|      0|		return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  756|      0|	}
  757|       |
  758|   112k|	smtp_server_command_finished(cmd);
  759|   112k|	return TRUE;
  ------------------
  |  |   15|   112k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   112k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  760|   112k|}
smtp_server_command_finished:
  763|   112k|{
  764|   112k|	struct smtp_server_connection *conn = cmd->context.conn;
  765|   112k|	struct smtp_server_reply *reply;
  766|       |
  767|   112k|	i_assert(cmd->state < SMTP_SERVER_COMMAND_STATE_FINISHED);
  ------------------
  |  |  219|   112k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   112k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   112k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   112k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 112k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 112k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   112k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   112k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   112k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  768|   112k|	cmd->state = SMTP_SERVER_COMMAND_STATE_FINISHED;
  769|       |
  770|   112k|	DLLIST2_REMOVE(&conn->command_queue_head,
  ------------------
  |  |   79|   112k|	DLLIST2_REMOVE_FULL(head, tail, item, prev, next)
  |  |  ------------------
  |  |  |  |   65|   112k|#define DLLIST2_REMOVE_FULL(head, tail, item, prev, next) STMT_START { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   112k|#  define STMT_START do
  |  |  |  |  ------------------
  |  |  |  |   66|   112k|	if ((item)->prev != NULL) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:6): [True: 0, False: 112k]
  |  |  |  |  ------------------
  |  |  |  |   67|   112k|		(item)->prev->next = (item)->next; \
  |  |  |  |   68|   112k|	else if (*(head) == item) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (68:11): [True: 112k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   69|   112k|		*(head) = (item)->next; \
  |  |  |  |   70|   112k|	if ((item)->next != NULL) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (70:6): [True: 89.5k, False: 23.1k]
  |  |  |  |  ------------------
  |  |  |  |   71|  89.5k|		(item)->next->prev = (item)->prev; \
  |  |  |  |   72|  89.5k|		(item)->next = NULL; \
  |  |  |  |   73|  89.5k|	} else if ((*tail) == item) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (73:13): [True: 23.1k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   74|  23.1k|		*(tail) = (item)->prev; \
  |  |  |  |   75|   112k|	(item)->prev = NULL; \
  |  |  |  |   76|   112k|	} STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   112k|#  define STMT_END while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  771|   112k|		       &conn->command_queue_tail, cmd);
  772|   112k|	conn->command_queue_count--;
  773|   112k|	conn->stats.reply_count++;
  774|       |
  775|   112k|	i_assert(array_is_created(&cmd->replies));
  ------------------
  |  |  219|   112k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   112k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   112k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   112k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 112k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 112k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   112k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   112k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   112k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  776|   112k|	reply = array_front_modifiable(&cmd->replies);
  ------------------
  |  |  278|   112k|#define array_front_modifiable(array) array_idx_modifiable(array, 0)
  |  |  ------------------
  |  |  |  |  312|   112k|	ARRAY_TYPE_CAST_MODIFIABLE(array) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|   112k|	(typeof(*(array)->v_modifiable))
  |  |  |  |  ------------------
  |  |  |  |  313|   112k|		array_idx_modifiable_i(&(array)->arr, idx)
  |  |  ------------------
  ------------------
  777|   112k|	i_assert(reply->content != NULL);
  ------------------
  |  |  219|   112k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   112k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   112k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   112k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 112k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 112k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   112k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   112k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   112k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  778|       |
  779|   112k|	struct event_passthrough *e =
  780|   112k|		event_create_passthrough(cmd->context.event)->
  ------------------
  |  |  176|   112k|	event_create_passthrough((parent), __FILE__, __LINE__)
  ------------------
  781|   112k|		set_name("smtp_server_command_finished");
  782|   112k|	smtp_server_reply_add_to_event(reply, e);
  783|   112k|	e_debug(e->event(), "Finished");
  ------------------
  |  |   61|   112k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|   112k|#  define STMT_START do
  |  |  ------------------
  |  |   62|   112k|	struct event *_tmp_event = (_event); \
  |  |   63|   112k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|   112k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   112k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 112k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|   112k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|   112k|	else \
  |  |   66|   112k|		event_send_abort(_tmp_event); \
  |  |   67|   112k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|   112k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  784|       |
  785|   112k|	if (reply->content->status == 221 || reply->content->status == 421) {
  ------------------
  |  Branch (785:6): [True: 45, False: 112k]
  |  Branch (785:39): [True: 0, False: 112k]
  ------------------
  786|     45|		i_assert(cmd->replies_expected == 1);
  ------------------
  |  |  219|     45|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|     45|#  define STMT_START do
  |  |  ------------------
  |  |  220|     45|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|     45|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 45]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 45]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|     45|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|     45|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|     45|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  787|     45|		if (reply->content->status == 421) {
  ------------------
  |  Branch (787:7): [True: 0, False: 45]
  ------------------
  788|      0|			smtp_server_connection_close(&conn, t_strdup_printf(
  789|      0|				"Server closed the connection: %s",
  790|      0|				smtp_server_reply_get_one_line(reply)));
  791|     45|		} else {
  792|     45|			smtp_server_connection_close(&conn, "Logged out");
  793|     45|		}
  794|     45|		smtp_server_command_unref(&cmd);
  795|     45|		return;
  796|     45|	}
  797|   112k|	if (cmd->input_locked)
  ------------------
  |  Branch (797:6): [True: 1.24k, False: 111k]
  ------------------
  798|  1.24k|		smtp_server_command_input_unlock(&cmd->context);
  799|   112k|	if (cmd->pipeline_blocked)
  ------------------
  |  Branch (799:6): [True: 0, False: 112k]
  ------------------
  800|      0|		smtp_server_command_pipeline_unblock(&cmd->context);
  801|       |
  802|   112k|	smtp_server_command_unref(&cmd);
  803|   112k|	smtp_server_connection_trigger_output(conn);
  804|   112k|}
smtp_server_command_fail:
  809|  40.2k|{
  810|  40.2k|	unsigned int i;
  811|  40.2k|	va_list args;
  812|       |
  813|  40.2k|	i_assert(status / 100 > 2);
  ------------------
  |  |  219|  40.2k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  40.2k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  40.2k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  40.2k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 40.2k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 40.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  40.2k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  40.2k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  40.2k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  814|       |
  815|  40.2k|	va_start(args, fmt);
  816|  40.2k|	if (cmd->replies_expected == 1) {
  ------------------
  |  Branch (816:6): [True: 40.2k, False: 0]
  ------------------
  817|  40.2k|		smtp_server_reply_indexv(&cmd->context, 0,
  818|  40.2k|					 status, enh_code, fmt, args);
  819|  40.2k|	} else for (i = 0; i < cmd->replies_expected; i++) {
  ------------------
  |  Branch (819:21): [True: 0, False: 0]
  ------------------
  820|      0|		bool sent = FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  821|       |
  822|      0|		if (array_is_created(&cmd->replies)) {
  ------------------
  |  |  176|      0|	array_is_created_i(&(array)->arr)
  |  |  ------------------
  |  |  |  Branch (176:2): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  823|      0|			const struct smtp_server_reply *reply =
  824|      0|				array_idx(&cmd->replies, i);
  ------------------
  |  |  287|      0|	ARRAY_TYPE_CAST_CONST(array)array_idx_i(&(array)->arr, idx)
  |  |  ------------------
  |  |  |  |   52|      0|	(typeof(*(array)->v))
  |  |  ------------------
  ------------------
  825|      0|			sent = reply->sent;
  826|      0|		}
  827|       |
  828|       |		/* Send the same reply for all */
  829|      0|		if (!sent) {
  ------------------
  |  Branch (829:7): [True: 0, False: 0]
  ------------------
  830|      0|			va_list args_copy;
  831|      0|			VA_COPY(args_copy, args);
  ------------------
  |  |  864|      0|#define VA_COPY va_copy
  ------------------
  832|      0|			smtp_server_reply_indexv(&cmd->context, i,
  833|      0|				status, enh_code, fmt, args_copy);
  834|      0|			va_end(args_copy);
  835|      0|		}
  836|      0|	}
  837|  40.2k|	va_end(args);
  838|  40.2k|}
smtp_server_command_input_lock:
  841|  30.9k|{
  842|  30.9k|	struct smtp_server_command *command = cmd->cmd;
  843|  30.9k|	struct smtp_server_connection *conn = cmd->conn;
  844|       |
  845|  30.9k|	command->input_locked = TRUE;
  ------------------
  |  |   15|  30.9k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  30.9k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  846|  30.9k|	smtp_server_connection_input_halt(conn);
  847|  30.9k|}
smtp_server_command_input_unlock:
  850|  16.2k|{
  851|  16.2k|	struct smtp_server_command *command = cmd->cmd;
  852|  16.2k|	struct smtp_server_connection *conn = cmd->conn;
  853|       |
  854|  16.2k|	command->input_locked = FALSE;
  ------------------
  |  |   11|  16.2k|#  define FALSE (!1)
  ------------------
  855|  16.2k|	if (command->input_captured) {
  ------------------
  |  Branch (855:6): [True: 10.4k, False: 5.87k]
  ------------------
  856|  10.4k|		command->input_captured = FALSE;
  ------------------
  |  |   11|  10.4k|#  define FALSE (!1)
  ------------------
  857|  10.4k|		smtp_server_connection_input_halt(conn);
  858|  10.4k|	}
  859|  16.2k|	smtp_server_connection_input_resume(conn);
  860|  16.2k|}
smtp_server_command_input_capture:
  865|  11.0k|{
  866|  11.0k|	struct smtp_server_command *command = cmd->cmd;
  867|  11.0k|	struct smtp_server_connection *conn = cmd->conn;
  868|       |
  869|  11.0k|	smtp_server_connection_input_capture(conn, *callback, cmd);
  ------------------
  |  |  313|  11.0k|	smtp_server_connection_input_capture(conn - \
  |  |  314|  11.0k|		CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
  |  |  ------------------
  |  |  |  |  171|  11.0k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  11.0k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  11.0k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  11.0k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  315|  11.0k|		(smtp_server_input_callback_t *)callback, context)
  ------------------
  870|  11.0k|	command->input_locked = TRUE;
  ------------------
  |  |   15|  11.0k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  11.0k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  871|  11.0k|	command->input_captured = TRUE;
  ------------------
  |  |   15|  11.0k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  11.0k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  872|  11.0k|}
smtp_server_command_pipeline_block:
  875|  12.7k|{
  876|  12.7k|	struct smtp_server_command *command = cmd->cmd;
  877|  12.7k|	struct smtp_server_connection *conn = cmd->conn;
  878|       |
  879|  12.7k|	e_debug(cmd->event, "Pipeline blocked");
  ------------------
  |  |   61|  12.7k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  12.7k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  12.7k|	struct event *_tmp_event = (_event); \
  |  |   63|  12.7k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  12.7k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  12.7k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 12.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  12.7k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  12.7k|	else \
  |  |   66|  12.7k|		event_send_abort(_tmp_event); \
  |  |   67|  12.7k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.7k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  880|       |
  881|  12.7k|	command->pipeline_blocked = TRUE;
  ------------------
  |  |   15|  12.7k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  12.7k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  882|  12.7k|	smtp_server_connection_input_lock(conn);
  883|  12.7k|}
smtp_server_command_pipeline_unblock:
  886|   132k|{
  887|   132k|	struct smtp_server_command *command = cmd->cmd;
  888|   132k|	struct smtp_server_connection *conn = cmd->conn;
  889|       |
  890|   132k|	if (!command->pipeline_blocked)
  ------------------
  |  Branch (890:6): [True: 120k, False: 12.7k]
  ------------------
  891|   120k|		return;
  892|       |
  893|  12.7k|	command->pipeline_blocked = FALSE;
  ------------------
  |  |   11|  12.7k|#  define FALSE (!1)
  ------------------
  894|  12.7k|	smtp_server_connection_input_unlock(conn);
  895|       |
  896|  12.7k|	e_debug(cmd->event, "Pipeline unblocked");
  ------------------
  |  |   61|  12.7k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  12.7k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  12.7k|	struct event *_tmp_event = (_event); \
  |  |   63|  12.7k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  12.7k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  12.7k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 12.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  12.7k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  12.7k|	else \
  |  |   66|  12.7k|		event_send_abort(_tmp_event); \
  |  |   67|  12.7k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.7k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  897|  12.7k|}
smtp-server-command.c:smtp_server_command_alloc:
  160|   116k|{
  161|   116k|	struct smtp_server_command *cmd;
  162|   116k|	pool_t pool;
  163|       |
  164|   116k|	pool = pool_alloconly_create("smtp_server_command", 1024);
  165|   116k|	cmd = p_new(pool, struct smtp_server_command, 1);
  ------------------
  |  |   97|   116k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|   116k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|   116k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|   116k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|   116k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  166|   116k|	cmd->context.pool = pool;
  167|   116k|	cmd->context.cmd = cmd;
  168|   116k|	cmd->context.event = event_create(conn->event);
  ------------------
  |  |  156|   116k|	event_create((parent), __FILE__, __LINE__)
  ------------------
  169|   116k|	cmd->refcount = 1;
  170|   116k|	cmd->context.conn = conn;
  171|   116k|	cmd->context.server = conn->server;
  172|   116k|	cmd->replies_expected = 1;
  173|       |
  174|   116k|	DLLIST2_APPEND(&conn->command_queue_head,
  ------------------
  |  |   49|   116k|	DLLIST2_APPEND_FULL(head, tail, item, prev, next)
  |  |  ------------------
  |  |  |  |   41|   116k|#define DLLIST2_APPEND_FULL(head, tail, item, prev, next) STMT_START { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   116k|#  define STMT_START do
  |  |  |  |  ------------------
  |  |  |  |   42|   116k|	(item)->prev = *(tail); \
  |  |  |  |   43|   116k|	(item)->next = NULL; \
  |  |  |  |   44|   116k|	if (*(tail) != NULL) (*(tail))->next = (item); else (*head) = (item); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:6): [True: 92.0k, False: 24.3k]
  |  |  |  |  ------------------
  |  |  |  |   45|   116k|	*(tail) = (item); \
  |  |  |  |   46|   116k|	} STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   116k|#  define STMT_END while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  175|   116k|		       &conn->command_queue_tail, cmd);
  176|   116k|	conn->command_queue_count++;
  177|       |
  178|   116k|	return cmd;
  179|   116k|}
smtp-server-command.c:smtp_server_command_update_event:
  143|   116k|{
  144|   116k|	struct event *event = cmd->context.event;
  145|   116k|	const char *label = (cmd->context.name == NULL ?
  ------------------
  |  Branch (145:23): [True: 13.0k, False: 103k]
  ------------------
  146|  13.0k|			     "[unknown]" :
  147|   116k|			     t_str_ucase(cmd->context.name));
  148|       |
  149|   116k|	if (cmd->reg != NULL)
  ------------------
  |  Branch (149:6): [True: 82.5k, False: 33.8k]
  ------------------
  150|  82.5k|		event_add_str(event, "cmd_name", cmd->reg->name);
  151|  33.8k|	else
  152|  33.8k|		event_add_str(event, "cmd_name", "unknown");
  153|   116k|	event_add_str(event, "cmd_input_name", cmd->context.name);
  154|   116k|	event_set_append_log_prefix(event,
  155|   116k|				    t_strdup_printf("command %s: ", label));
  156|   116k|}
smtp-server-command.c:smtp_server_command_find:
   79|   103k|{
   80|   103k|	if (server->commands_unsorted) {
  ------------------
  |  Branch (80:6): [True: 5.83k, False: 97.4k]
  ------------------
   81|  5.83k|		array_sort(&server->commands_reg, smtp_server_command_cmp);
  ------------------
  |  |  398|  5.83k|	TYPE_CHECKS(void, \
  |  |  ------------------
  |  |  |  |  194|  5.83k|	(FALSE ? (return_type)(checks) : (func))
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  5.83k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (11:17): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (194:25): [Folded - Ignored]
  |  |  |  |  |  Branch (194:25): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  399|  5.83k|	CALLBACK_TYPECHECK(cmp, int (*)(typeof(*(array)->v), \
  |  |  400|  5.83k|					typeof(*(array)->v))), \
  |  |  401|  5.83k|	array_sort_i(&(array)->arr, (int (*)(const void *, const void *))cmp))
  ------------------
   82|  5.83k|		server->commands_unsorted = FALSE;
  ------------------
  |  |   11|  5.83k|#  define FALSE (!1)
  ------------------
   83|  5.83k|	}
   84|       |
   85|   103k|	return array_bsearch(&server->commands_reg,
  ------------------
  |  |  406|   103k|	TYPE_CHECKS(void *, \
  |  |  ------------------
  |  |  |  |  194|   103k|	(FALSE ? (return_type)(checks) : (func))
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|   103k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (11:17): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (194:25): [Folded - Ignored]
  |  |  |  |  |  Branch (194:25): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  407|   103k|	CALLBACK_TYPECHECK(cmp, int (*)(typeof(const typeof(*key) *), \
  |  |  408|   103k|					typeof(*(array)->v))), \
  |  |  409|   103k|	ARRAY_TYPE_CAST_MODIFIABLE(array)array_bsearch_i(&(array)->arr, \
  |  |  410|   103k|		(const void *)key, (int (*)(const void *, const void *))cmp))
  ------------------
   86|   103k|		name, smtp_server_command_bsearch);
   87|   103k|}
smtp-server-command.c:smtp_server_command_cmp:
   66|   192k|{
   67|   192k|	return strcasecmp(c1->name, c2->name);
   68|   192k|}
smtp-server-command.c:smtp_server_command_bsearch:
   73|   326k|{
   74|   326k|	return strcasecmp(name, cmd->name);
   75|   326k|}
smtp-server-command.c:smtp_server_command_handle_reply:
  543|   116k|{
  544|   116k|	struct smtp_server_connection *conn = cmd->context.conn;
  545|       |
  546|   116k|	smtp_server_connection_ref(conn);
  547|       |
  548|   116k|	if (!smtp_server_command_replied(&cmd))
  ------------------
  |  Branch (548:6): [True: 0, False: 116k]
  ------------------
  549|      0|		return smtp_server_connection_unref(&conn);
  550|       |
  551|   116k|	if (cmd->input_locked)
  ------------------
  |  Branch (551:6): [True: 13.0k, False: 103k]
  ------------------
  552|  13.0k|		smtp_server_command_input_unlock(&cmd->context);
  553|       |
  554|       |	/* Submit reply */
  555|   116k|	switch (cmd->state) {
  556|   111k|	case SMTP_SERVER_COMMAND_STATE_NEW:
  ------------------
  |  Branch (556:2): [True: 111k, False: 5.47k]
  ------------------
  557|   115k|	case SMTP_SERVER_COMMAND_STATE_PROCESSING:
  ------------------
  |  Branch (557:2): [True: 4.23k, False: 112k]
  ------------------
  558|   115k|		if (!smtp_server_command_is_complete(cmd)) {
  ------------------
  |  Branch (558:7): [True: 3.11k, False: 112k]
  ------------------
  559|  3.11k|			e_debug(cmd->context.event, "Not ready to reply");
  ------------------
  |  |   61|  3.11k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  3.11k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  3.11k|	struct event *_tmp_event = (_event); \
  |  |   63|  3.11k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  3.11k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  3.11k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 3.11k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  3.11k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  3.11k|	else \
  |  |   66|  3.11k|		event_send_abort(_tmp_event); \
  |  |   67|  3.11k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  3.11k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  560|  3.11k|			cmd->state = SMTP_SERVER_COMMAND_STATE_SUBMITTED_REPLY;
  561|  3.11k|			break;
  562|  3.11k|		}
  563|   112k|		smtp_server_command_ready_to_reply(cmd);
  564|   112k|		break;
  565|  1.23k|	case SMTP_SERVER_COMMAND_STATE_READY_TO_REPLY:
  ------------------
  |  Branch (565:2): [True: 1.23k, False: 115k]
  ------------------
  566|  1.23k|	case SMTP_SERVER_COMMAND_STATE_ABORTED:
  ------------------
  |  Branch (566:2): [True: 0, False: 116k]
  ------------------
  567|  1.23k|		break;
  568|      0|	default:
  ------------------
  |  Branch (568:2): [True: 0, False: 116k]
  ------------------
  569|      0|		i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
  570|   116k|	}
  571|       |
  572|   116k|	return smtp_server_connection_unref(&conn);
  573|   116k|}
smtp-server-command.c:smtp_server_command_replied:
  507|   116k|{
  508|   116k|	struct smtp_server_command *cmd = *_cmd;
  509|       |
  510|   116k|	if (cmd->replies_submitted < cmd->replies_expected) {
  ------------------
  |  Branch (510:6): [True: 0, False: 116k]
  ------------------
  511|      0|		e_debug(cmd->context.event, "Replied (one)");
  ------------------
  |  |   61|      0|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |   62|      0|	struct event *_tmp_event = (_event); \
  |  |   63|      0|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|      0|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|      0|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|      0|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|      0|	else \
  |  |   66|      0|		event_send_abort(_tmp_event); \
  |  |   67|      0|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  512|       |
  513|      0|		return smtp_server_command_call_hooks(
  514|      0|			_cmd, SMTP_SERVER_COMMAND_HOOK_REPLIED_ONE, FALSE);
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  515|      0|	}
  516|       |
  517|   116k|	e_debug(cmd->context.event, "Replied");
  ------------------
  |  |   61|   116k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|   116k|#  define STMT_START do
  |  |  ------------------
  |  |   62|   116k|	struct event *_tmp_event = (_event); \
  |  |   63|   116k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|   116k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   116k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 116k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|   116k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|   116k|	else \
  |  |   66|   116k|		event_send_abort(_tmp_event); \
  |  |   67|   116k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|   116k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  518|       |
  519|   116k|	return (smtp_server_command_call_hooks(
  ------------------
  |  Branch (519:10): [True: 116k, False: 0]
  ------------------
  520|   116k|			_cmd, SMTP_SERVER_COMMAND_HOOK_REPLIED_ONE, TRUE) &&
  ------------------
  |  |   15|   116k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   116k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  521|   116k|		smtp_server_command_call_hooks(
  ------------------
  |  Branch (521:3): [True: 116k, False: 0]
  ------------------
  522|   116k|			_cmd, SMTP_SERVER_COMMAND_HOOK_REPLIED, TRUE));
  ------------------
  |  |   15|   116k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   116k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  523|   116k|}
smtp-server-command.c:smtp_server_command_send_more_replies:
  705|   112k|{
  706|   112k|	unsigned int i;
  707|   112k|	int ret = 1;
  708|       |
  709|   112k|	smtp_server_command_ref(cmd);
  710|       |
  711|       |	// FIXME: handle LMTP DATA command with enormous number of recipients;
  712|       |	// i.e. don't keep filling output stream with replies indefinitely.
  713|   225k|	for (i = 0; i < cmd->replies_expected; i++) {
  ------------------
  |  Branch (713:14): [True: 112k, False: 112k]
  ------------------
  714|   112k|		struct smtp_server_reply *reply;
  715|       |
  716|   112k|		reply = array_idx_modifiable(&cmd->replies, i);
  ------------------
  |  |  312|   112k|	ARRAY_TYPE_CAST_MODIFIABLE(array) \
  |  |  ------------------
  |  |  |  |   54|   112k|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  |  |  313|   112k|		array_idx_modifiable_i(&(array)->arr, idx)
  ------------------
  717|       |
  718|   112k|		if (!reply->submitted) {
  ------------------
  |  Branch (718:7): [True: 0, False: 112k]
  ------------------
  719|      0|			i_assert(!reply->sent);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  720|      0|			ret = 0;
  721|      0|			break;
  722|      0|		}
  723|   112k|		if (smtp_server_reply_send(reply) < 0) {
  ------------------
  |  Branch (723:7): [True: 0, False: 112k]
  ------------------
  724|      0|			ret = -1;
  725|      0|			break;
  726|      0|		}
  727|   112k|	}
  728|       |
  729|   112k|	if (!smtp_server_command_unref(&cmd))
  ------------------
  |  Branch (729:6): [True: 0, False: 112k]
  ------------------
  730|      0|		return -1;
  731|   112k|	return ret;
  732|   112k|}

smtp_server_connection_input_halt:
   85|  67.6k|{
   86|  67.6k|	connection_input_halt(&conn->conn);
   87|  67.6k|}
smtp_server_connection_input_resume:
   90|  63.0k|{
   91|  63.0k|	struct smtp_server_command *cmd;
   92|  63.0k|	bool cmd_locked = FALSE;
  ------------------
  |  |   11|  63.0k|#  define FALSE (!1)
  ------------------
   93|       |
   94|  63.0k|	if (conn->conn.io == NULL) {
  ------------------
  |  Branch (94:6): [True: 46.4k, False: 16.5k]
  ------------------
   95|       |		/* Only resume when we actually can */
   96|  46.4k|		if (conn->input_locked || conn->input_broken ||
  ------------------
  |  Branch (96:7): [True: 0, False: 46.4k]
  |  Branch (96:29): [True: 7.26k, False: 39.2k]
  ------------------
   97|  46.4k|			conn->disconnected)
  ------------------
  |  Branch (97:4): [True: 517, False: 38.6k]
  ------------------
   98|  7.78k|			return;
   99|  38.6k|		if (!smtp_server_connection_check_pipeline(conn))
  ------------------
  |  Branch (99:7): [True: 548, False: 38.1k]
  ------------------
  100|    548|			return;
  101|       |
  102|       |		/* Is queued command still blocking input? */
  103|  38.1k|		cmd = conn->command_queue_head;
  104|   128k|		while (cmd != NULL) {
  ------------------
  |  Branch (104:10): [True: 90.3k, False: 38.1k]
  ------------------
  105|  90.3k|			if (cmd->input_locked || cmd->pipeline_blocked) {
  ------------------
  |  Branch (105:8): [True: 0, False: 90.3k]
  |  Branch (105:29): [True: 0, False: 90.3k]
  ------------------
  106|      0|				cmd_locked = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  107|      0|				break;
  108|      0|			}
  109|  90.3k|			cmd = cmd->next;
  110|  90.3k|		}
  111|  38.1k|		if (cmd_locked)
  ------------------
  |  Branch (111:7): [True: 0, False: 38.1k]
  ------------------
  112|      0|			return;
  113|       |
  114|       |		/* Restore input handler */
  115|  38.1k|		connection_input_resume(&conn->conn);
  116|  38.1k|	}
  117|       |
  118|  54.6k|	if (conn->conn.io != NULL &&
  ------------------
  |  Branch (118:6): [True: 54.6k, False: 0]
  ------------------
  119|  54.6k|		i_stream_have_bytes_left(conn->conn.input)) {
  ------------------
  |  Branch (119:3): [True: 54.6k, False: 0]
  ------------------
  120|  54.6k|		io_set_pending(conn->conn.io);
  121|  54.6k|	}
  122|  54.6k|}
smtp_server_connection_input_lock:
  125|  18.9k|{
  126|  18.9k|	conn->input_locked = TRUE;
  ------------------
  |  |   15|  18.9k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  18.9k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  127|  18.9k|	smtp_server_connection_input_halt(conn);
  128|  18.9k|}
smtp_server_connection_input_unlock:
  131|  18.9k|{
  132|  18.9k|	conn->input_locked = FALSE;
  ------------------
  |  |   11|  18.9k|#  define FALSE (!1)
  ------------------
  133|  18.9k|	smtp_server_connection_input_resume(conn);
  134|  18.9k|}
smtp_server_connection_input_capture:
  139|  11.0k|{
  140|  11.0k|	i_assert(!conn->input_broken && !conn->disconnected);
  ------------------
  |  |  219|  11.0k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  11.0k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  11.0k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  22.0k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 11.0k]
  |  |  |  |  |  Branch (202:45): [True: 11.0k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 11.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  11.0k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  11.0k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  11.0k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  141|  11.0k|	connection_input_halt(&conn->conn);
  142|  11.0k|	conn->conn.io = io_add_istream(conn->conn.input, *callback, context);
  ------------------
  |  |   86|  11.0k|	io_add_istream(input, __FILE__, __LINE__ - \
  |  |   87|  11.0k|		CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
  |  |  ------------------
  |  |  |  |  171|  11.0k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  11.0k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  11.0k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  11.0k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |   88|  11.0k|		(io_callback_t *)callback, context)
  ------------------
  143|  11.0k|}
smtp_server_connection_timeout_stop:
  215|   117k|{
  216|   117k|	if (conn->to_idle != NULL) {
  ------------------
  |  Branch (216:6): [True: 37.8k, False: 79.3k]
  ------------------
  217|  37.8k|		e_debug(conn->event, "Timeout stop");
  ------------------
  |  |   61|  37.8k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  37.8k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  37.8k|	struct event *_tmp_event = (_event); \
  |  |   63|  37.8k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  37.8k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  37.8k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 37.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  37.8k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  37.8k|	else \
  |  |   66|  37.8k|		event_send_abort(_tmp_event); \
  |  |   67|  37.8k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  37.8k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  218|       |
  219|  37.8k|		timeout_remove(&conn->to_idle);
  220|  37.8k|	}
  221|   117k|}
smtp_server_connection_timeout_start:
  224|  44.8k|{
  225|  44.8k|	if (conn->disconnected)
  ------------------
  |  Branch (225:6): [True: 748, False: 44.0k]
  ------------------
  226|    748|		return;
  227|       |
  228|  44.0k|	if (conn->to_idle == NULL &&
  ------------------
  |  Branch (228:6): [True: 37.8k, False: 6.25k]
  ------------------
  229|  44.0k|		conn->set.max_client_idle_time_msecs > 0) {
  ------------------
  |  Branch (229:3): [True: 37.8k, False: 0]
  ------------------
  230|  37.8k|		e_debug(conn->event, "Timeout start");
  ------------------
  |  |   61|  37.8k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  37.8k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  37.8k|	struct event *_tmp_event = (_event); \
  |  |   63|  37.8k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  37.8k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  37.8k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 37.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  37.8k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  37.8k|	else \
  |  |   66|  37.8k|		event_send_abort(_tmp_event); \
  |  |   67|  37.8k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  37.8k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  231|       |
  232|  37.8k|		conn->to_idle = timeout_add(
  ------------------
  |  |  124|  37.8k|	timeout_add(msecs, __FILE__, __LINE__ - \
  |  |  125|  37.8k|		CALLBACK_TYPECHECK(callback, void (*)(typeof(context))) - \
  |  |  ------------------
  |  |  |  |  171|  37.8k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  37.8k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  37.8k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  37.8k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  126|  37.8k|		COMPILE_ERROR_IF_TRUE(__builtin_constant_p(msecs) && \
  |  |  ------------------
  |  |  |  |  180|  37.8k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  37.8k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [True: 37.8k, False: 0]
  |  |  |  |  |  Branch (180:25): [True: 0, False: 0]
  |  |  |  |  |  Branch (180:25): [True: 0, False: 0]
  |  |  |  |  |  Branch (180:25): [True: 0, False: 37.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  127|  37.8k|				      ((msecs) > 0 && (msecs) < 1000)), \
  |  |  128|  37.8k|		(io_callback_t *)callback, context)
  ------------------
  233|  37.8k|			conn->set.max_client_idle_time_msecs,
  234|  37.8k|			smtp_server_connection_idle_timeout, conn);
  235|  37.8k|	}
  236|  44.0k|}
smtp_server_connection_timeout_reset:
  239|  80.4k|{
  240|  80.4k|	if (conn->to_idle != NULL)
  ------------------
  |  Branch (240:6): [True: 56.1k, False: 24.2k]
  ------------------
  241|  56.1k|		timeout_reset(conn->to_idle);
  242|  80.4k|}
smtp_server_connection_pending_command_data:
  614|   115k|{
  615|   115k|	if (conn->smtp_parser == NULL)
  ------------------
  |  Branch (615:6): [True: 0, False: 115k]
  ------------------
  616|      0|		return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  617|   115k|	return smtp_command_parser_pending_data(conn->smtp_parser);
  618|   115k|}
smtp_server_connection_flush:
  679|  27.7k|{
  680|  27.7k|	struct ostream *output = conn->conn.output;
  681|  27.7k|	int ret;
  682|       |
  683|  27.7k|	if ((ret = o_stream_flush(output)) <= 0) {
  ------------------
  |  Branch (683:6): [True: 0, False: 27.7k]
  ------------------
  684|      0|		if (ret < 0)
  ------------------
  |  Branch (684:7): [True: 0, False: 0]
  ------------------
  685|      0|			smtp_server_connection_handle_output_error(conn);
  686|      0|		return ret;
  687|      0|	}
  688|  27.7k|	return 1;
  689|  27.7k|}
smtp_server_connection_trigger_output:
  715|   228k|{
  716|   228k|	if (conn->conn.output != NULL) {
  ------------------
  |  Branch (716:6): [True: 228k, False: 0]
  ------------------
  717|   228k|		e_debug(conn->event, "Trigger output");
  ------------------
  |  |   61|   228k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|   228k|#  define STMT_START do
  |  |  ------------------
  |  |   62|   228k|	struct event *_tmp_event = (_event); \
  |  |   63|   228k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|   228k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   228k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 228k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|   228k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|   228k|	else \
  |  |   66|   228k|		event_send_abort(_tmp_event); \
  |  |   67|   228k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|   228k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  718|   228k|		o_stream_set_flush_pending(conn->conn.output, TRUE);
  ------------------
  |  |   15|   228k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   228k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  719|   228k|	}
  720|   228k|}
smtp_server_connection_list_init:
  739|  6.21k|{
  740|  6.21k|	return connection_list_init(&smtp_server_connection_set,
  741|  6.21k|				    &smtp_server_connection_vfuncs);
  742|  6.21k|}
smtp_server_connection_create:
  951|  6.21k|{
  952|  6.21k|	struct smtp_server_connection *conn;
  953|  6.21k|	struct event *conn_event;
  954|       |
  955|  6.21k|	conn = smtp_server_connection_alloc(server, set, fd_in, fd_out,
  956|  6.21k|					    callbacks, context);
  957|  6.21k|	conn_event = smtp_server_connection_event_create(server, set);
  958|  6.21k|	conn->conn.event_parent = conn_event;
  959|  6.21k|	connection_init_server_ip(server->conn_list, &conn->conn, NULL,
  960|  6.21k|				  fd_in, fd_out, remote_ip, remote_port);
  961|  6.21k|	conn->event = conn->conn.event;
  962|  6.21k|	smtp_server_connection_update_event(conn);
  963|  6.21k|	event_unref(&conn_event);
  964|       |
  965|  6.21k|	conn->ssl_start = ssl_start;
  966|  6.21k|	if (ssl_start)
  ------------------
  |  Branch (966:6): [True: 0, False: 6.21k]
  ------------------
  967|      0|		conn->set.capabilities &= ENUM_NEGATE(SMTP_CAPABILITY_STARTTLS);
  ------------------
  |  |  288|      0|	((unsigned int)(~(x)) + COMPILE_ERROR_IF_TRUE(sizeof((x)) > sizeof(int) || (x) < 0 || (x) > INT_MAX))
  |  |  ------------------
  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  968|       |
  969|       |	/* Halt input until started */
  970|  6.21k|	smtp_server_connection_halt(conn);
  971|       |
  972|  6.21k|	e_debug(conn->event, "Connection created");
  ------------------
  |  |   61|  6.21k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  6.21k|	struct event *_tmp_event = (_event); \
  |  |   63|  6.21k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  6.21k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  6.21k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 6.21k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  6.21k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  6.21k|	else \
  |  |   66|  6.21k|		event_send_abort(_tmp_event); \
  |  |   67|  6.21k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  973|       |
  974|  6.21k|	return conn;
  975|  6.21k|}
smtp_server_connection_ref:
 1018|   285k|{
 1019|   285k|	conn->refcount++;
 1020|   285k|}
smtp_server_connection_unref:
 1110|   291k|{
 1111|   291k|	struct smtp_server_connection *conn = *_conn;
 1112|       |
 1113|   291k|	*_conn = NULL;
 1114|       |
 1115|   291k|	i_assert(conn->refcount > 0);
  ------------------
  |  |  219|   291k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   291k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   291k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   291k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 291k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 291k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   291k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   291k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   291k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1116|   291k|	if (--conn->refcount > 0)
  ------------------
  |  Branch (1116:6): [True: 285k, False: 6.21k]
  ------------------
 1117|   285k|		return TRUE;
  ------------------
  |  |   15|   285k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   285k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1118|       |
 1119|  6.21k|	smtp_server_connection_disconnect(conn, NULL);
 1120|       |
 1121|  6.21k|	e_debug(conn->event, "Connection destroy");
  ------------------
  |  |   61|  6.21k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  6.21k|	struct event *_tmp_event = (_event); \
  |  |   63|  6.21k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  6.21k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  6.21k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 6.21k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  6.21k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  6.21k|	else \
  |  |   66|  6.21k|		event_send_abort(_tmp_event); \
  |  |   67|  6.21k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1122|       |
 1123|  6.21k|	connection_deinit(&conn->conn);
 1124|       |
 1125|  6.21k|	if (conn->callbacks != NULL && conn->callbacks->conn_free != NULL)
  ------------------
  |  Branch (1125:6): [True: 6.21k, False: 0]
  |  Branch (1125:33): [True: 6.21k, False: 0]
  ------------------
 1126|  6.21k|		conn->callbacks->conn_free(conn->context);
 1127|       |
 1128|  6.21k|	i_free(conn->proxy_helo);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1129|  6.21k|	i_free(conn->helo_domain);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1130|  6.21k|	i_free(conn->username);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1131|  6.21k|	i_free(conn->session_id);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1132|  6.21k|	i_free(conn->client_transport);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1133|  6.21k|	i_free(conn->local_name);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1134|  6.21k|	event_unref(&conn->next_trans_event);
 1135|  6.21k|	pool_unref(&conn->pool);
 1136|  6.21k|	return FALSE;
  ------------------
  |  |   11|  6.21k|#  define FALSE (!1)
  ------------------
 1137|   291k|}
smtp_server_connection_send_line:
 1141|  6.21k|{
 1142|  6.21k|	va_list args;
 1143|       |
 1144|  6.21k|	va_start(args, fmt);
 1145|       |
 1146|  6.21k|	T_BEGIN {
  ------------------
  |  |   68|  6.21k|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |   69|  6.21k|		data_stack_frame_t _data_stack_cur_id = t_push(__FILE__ ":" T_XSTRING(__LINE__));
  |  |  ------------------
  |  |  |  |   66|  6.21k|#define T_XSTRING(x)	T_STRING(x)	/* expand and then stringify */
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|  6.21k|#define T_STRING(x)	#x
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1147|  6.21k|		string_t *str;
 1148|       |
 1149|  6.21k|		str = t_str_new(256);
 1150|  6.21k|		str_vprintfa(str, fmt, args);
 1151|       |
 1152|  6.21k|		e_debug(conn->event, "Sent: %s", str_c(str));
  ------------------
  |  |   61|  6.21k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  6.21k|	struct event *_tmp_event = (_event); \
  |  |   63|  6.21k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  6.21k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  6.21k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 6.21k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  6.21k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  6.21k|	else \
  |  |   66|  6.21k|		event_send_abort(_tmp_event); \
  |  |   67|  6.21k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1153|       |
 1154|  6.21k|		str_append(str, "\r\n");
 1155|  6.21k|		o_stream_nsend(conn->conn.output, str_data(str), str_len(str));
 1156|  6.21k|	} T_END;
  ------------------
  |  |   71|  6.21k|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |   72|  6.21k|		if (unlikely(!t_pop(&_data_stack_cur_id))) \
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   73|  6.21k|			i_panic("Leaked t_pop() call"); \
  |  |   74|  6.21k|	} STMT_END; \
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   75|  6.21k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1157|  6.21k|	va_end(args);
 1158|  6.21k|}
smtp_server_connection_reply_lines:
 1164|    227|{
 1165|    227|	struct smtp_reply reply;
 1166|       |
 1167|    227|	i_zero(&reply);
  ------------------
  |  |  249|    227|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|    227|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|    227|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1168|    227|	reply.status = status;
 1169|    227|	reply.text_lines = text_lines;
 1170|       |
 1171|    227|	if (!smtp_reply_parse_enhanced_code(
  ------------------
  |  Branch (1171:6): [True: 0, False: 227]
  ------------------
 1172|    227|		enh_code, &reply.enhanced_code, NULL))
 1173|      0|		reply.enhanced_code = SMTP_REPLY_ENH_CODE(status / 100, 0, 0);
  ------------------
  |  |   21|      0|	(const struct smtp_reply_enhanced_code){(x), (y), (z)}
  ------------------
 1174|       |
 1175|    227|	T_BEGIN {
  ------------------
  |  |   68|    227|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|    227|#  define STMT_START do
  |  |  ------------------
  |  |   69|    227|		data_stack_frame_t _data_stack_cur_id = t_push(__FILE__ ":" T_XSTRING(__LINE__));
  |  |  ------------------
  |  |  |  |   66|    227|#define T_XSTRING(x)	T_STRING(x)	/* expand and then stringify */
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|    227|#define T_STRING(x)	#x
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1176|    227|		string_t *str;
 1177|       |
 1178|    227|		e_debug(conn->event, "Sent: %s", smtp_reply_log(&reply));
  ------------------
  |  |   61|    227|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|    227|#  define STMT_START do
  |  |  ------------------
  |  |   62|    227|	struct event *_tmp_event = (_event); \
  |  |   63|    227|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|    227|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|    227|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 227]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|    227|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|    227|	else \
  |  |   66|    227|		event_send_abort(_tmp_event); \
  |  |   67|    227|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|    227|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1179|       |
 1180|    227|		str = t_str_new(256);
 1181|    227|		smtp_reply_write(str, &reply);
 1182|    227|		o_stream_nsend(conn->conn.output, str_data(str), str_len(str));
 1183|    227|	} T_END;
  ------------------
  |  |   71|    227|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|    227|#  define STMT_START do
  |  |  ------------------
  |  |   72|    227|		if (unlikely(!t_pop(&_data_stack_cur_id))) \
  |  |  ------------------
  |  |  |  |  202|    227|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 227]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 227]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   73|    227|			i_panic("Leaked t_pop() call"); \
  |  |   74|    227|	} STMT_END; \
  |  |  ------------------
  |  |  |  |   64|    227|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   75|    227|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|    227|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1184|    227|}
smtp_server_connection_reply_immediate:
 1189|  1.55k|{
 1190|  1.55k|	va_list args;
 1191|       |
 1192|  1.55k|	va_start(args, fmt);
 1193|  1.55k|	T_BEGIN {
  ------------------
  |  |   68|  1.55k|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  1.55k|#  define STMT_START do
  |  |  ------------------
  |  |   69|  1.55k|		data_stack_frame_t _data_stack_cur_id = t_push(__FILE__ ":" T_XSTRING(__LINE__));
  |  |  ------------------
  |  |  |  |   66|  1.55k|#define T_XSTRING(x)	T_STRING(x)	/* expand and then stringify */
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|  1.55k|#define T_STRING(x)	#x
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1194|  1.55k|		string_t *str;
 1195|       |
 1196|  1.55k|		str = t_str_new(256);
 1197|  1.55k|		str_printfa(str, "%03u ", status);
 1198|  1.55k|		str_vprintfa(str, fmt, args);
 1199|       |
 1200|  1.55k|		e_debug(conn->event, "Sent: %s", str_c(str));
  ------------------
  |  |   61|  1.55k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  1.55k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  1.55k|	struct event *_tmp_event = (_event); \
  |  |   63|  1.55k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  1.55k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  1.55k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 1.55k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  1.55k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  1.55k|	else \
  |  |   66|  1.55k|		event_send_abort(_tmp_event); \
  |  |   67|  1.55k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.55k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1201|       |
 1202|  1.55k|		str_append(str, "\r\n");
 1203|  1.55k|		o_stream_nsend(conn->conn.output, str_data(str), str_len(str));
 1204|  1.55k|	} T_END;
  ------------------
  |  |   71|  1.55k|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  1.55k|#  define STMT_START do
  |  |  ------------------
  |  |   72|  1.55k|		if (unlikely(!t_pop(&_data_stack_cur_id))) \
  |  |  ------------------
  |  |  |  |  202|  1.55k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1.55k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1.55k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   73|  1.55k|			i_panic("Leaked t_pop() call"); \
  |  |   74|  1.55k|	} STMT_END; \
  |  |  ------------------
  |  |  |  |   64|  1.55k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   75|  1.55k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.55k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1205|  1.55k|	va_end(args);
 1206|       |
 1207|       |	/* Send immediately */
 1208|  1.55k|	if (o_stream_is_corked(conn->conn.output)) {
  ------------------
  |  Branch (1208:6): [True: 1.50k, False: 47]
  ------------------
 1209|  1.50k|		o_stream_uncork(conn->conn.output);
 1210|  1.50k|		o_stream_cork(conn->conn.output);
 1211|  1.50k|	}
 1212|  1.55k|}
smtp_server_connection_start_pending:
 1240|  6.21k|{
 1241|  6.21k|	i_assert(!conn->started);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1242|  6.21k|	conn->started = TRUE;
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1243|       |
 1244|  6.21k|	conn->raw_input = conn->conn.input;
 1245|  6.21k|	conn->raw_output = conn->conn.output;
 1246|       |
 1247|  6.21k|	if (!conn->ssl_start)
  ------------------
  |  Branch (1247:6): [True: 6.21k, False: 0]
  ------------------
 1248|  6.21k|		smtp_server_connection_ready(conn);
 1249|      0|	else if (conn->ssl_iostream == NULL)
  ------------------
  |  Branch (1249:11): [True: 0, False: 0]
  ------------------
 1250|      0|		smtp_server_connection_input_unlock(conn);
 1251|  6.21k|}
smtp_server_connection_start:
 1254|  6.21k|{
 1255|  6.21k|	smtp_server_connection_start_pending(conn);
 1256|  6.21k|	smtp_server_connection_resume(conn);
 1257|  6.21k|}
smtp_server_connection_halt:
 1285|  6.21k|{
 1286|  6.21k|	conn->halted = TRUE;
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1287|  6.21k|	smtp_server_connection_timeout_stop(conn);
 1288|  6.21k|	if (!conn->started || !conn->ssl_start || conn->ssl_iostream != NULL)
  ------------------
  |  Branch (1288:6): [True: 6.21k, False: 0]
  |  Branch (1288:24): [True: 0, False: 0]
  |  Branch (1288:44): [True: 0, False: 0]
  ------------------
 1289|  6.21k|		smtp_server_connection_input_lock(conn);
 1290|  6.21k|}
smtp_server_connection_resume:
 1293|  6.21k|{
 1294|  6.21k|	smtp_server_connection_input_unlock(conn);
 1295|  6.21k|	smtp_server_connection_timeout_update(conn);
 1296|  6.21k|	conn->halted = FALSE;
  ------------------
  |  |   11|  6.21k|#  define FALSE (!1)
  ------------------
 1297|  6.21k|}
smtp_server_connection_close:
 1301|  2.45k|{
 1302|  2.45k|	struct smtp_server_connection *conn = *_conn;
 1303|       |
 1304|  2.45k|	*_conn = NULL;
 1305|       |
 1306|  2.45k|	if (conn->closed)
  ------------------
  |  Branch (1306:6): [True: 0, False: 2.45k]
  ------------------
 1307|      0|		return;
 1308|  2.45k|	conn->closed = TRUE;
  ------------------
  |  |   15|  2.45k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  2.45k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1309|       |
 1310|  2.45k|	smtp_server_connection_disconnect(conn, reason);
 1311|  2.45k|	smtp_server_connection_unref(&conn);
 1312|  2.45k|}
smtp_server_connection_terminate:
 1316|    227|{
 1317|    227|	smtp_server_connection_terminate_full(_conn, enh_code, reason, reason);
 1318|    227|}
smtp_server_connection_terminate_full:
 1324|    227|{
 1325|    227|	struct smtp_server_connection *conn = *_conn;
 1326|    227|	const char **reason_lines;
 1327|       |
 1328|    227|	*_conn = NULL;
 1329|       |
 1330|    227|	if (conn->closed)
  ------------------
  |  Branch (1330:6): [True: 0, False: 227]
  ------------------
 1331|      0|		return;
 1332|       |
 1333|    227|	i_assert(enh_code[0] == '4' && enh_code[1] == '.');
  ------------------
  |  |  219|    227|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    227|#  define STMT_START do
  |  |  ------------------
  |  |  220|    227|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    454|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 227]
  |  |  |  |  |  Branch (202:45): [True: 227, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 227, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    227|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    227|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    227|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1334|       |
 1335|    227|	T_BEGIN {
  ------------------
  |  |   68|    227|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|    227|#  define STMT_START do
  |  |  ------------------
  |  |   69|    227|		data_stack_frame_t _data_stack_cur_id = t_push(__FILE__ ":" T_XSTRING(__LINE__));
  |  |  ------------------
  |  |  |  |   66|    227|#define T_XSTRING(x)	T_STRING(x)	/* expand and then stringify */
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|    227|#define T_STRING(x)	#x
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1336|       |		/* Add hostname prefix */
 1337|    227|		reason_lines = t_strsplit_spaces(reply_reason, "\r\n");
 1338|    227|		reason_lines[0] = t_strconcat(conn->set.hostname, " ",
 1339|    227|					      reason_lines[0], NULL);
 1340|       |
 1341|    227|		smtp_server_connection_reply_lines(conn, 421, enh_code,
 1342|    227|						   reason_lines);
 1343|       |
 1344|    227|		smtp_server_connection_close(&conn, log_reason);
 1345|    227|	} T_END;
  ------------------
  |  |   71|    227|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|    227|#  define STMT_START do
  |  |  ------------------
  |  |   72|    227|		if (unlikely(!t_pop(&_data_stack_cur_id))) \
  |  |  ------------------
  |  |  |  |  202|    227|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 227]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 227]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   73|    227|			i_panic("Leaked t_pop() call"); \
  |  |   74|    227|	} STMT_END; \
  |  |  ------------------
  |  |  |  |   64|    227|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   75|    227|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|    227|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1346|    227|}
smtp_server_connection_set_state:
 1366|  56.6k|{
 1367|  56.6k|	bool changed = FALSE;
  ------------------
  |  |   11|  56.6k|#  define FALSE (!1)
  ------------------
 1368|       |
 1369|  56.6k|	if (conn->state.state != state) {
  ------------------
  |  Branch (1369:6): [True: 32.1k, False: 24.5k]
  ------------------
 1370|  32.1k|		conn->state.state = state;
 1371|  32.1k|		changed = TRUE;
  ------------------
  |  |   15|  32.1k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  32.1k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1372|  32.1k|	}
 1373|  56.6k|	if (null_strcmp(args, conn->state.args) != 0) {
  ------------------
  |  Branch (1373:6): [True: 14.5k, False: 42.0k]
  ------------------
 1374|  14.5k|		i_free(conn->state.args);
  ------------------
  |  |   19|  14.5k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  14.5k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  14.5k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  14.5k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  14.5k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  14.5k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  14.5k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  14.5k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1375|  14.5k|		conn->state.args = i_strdup(args);
 1376|  14.5k|		changed = TRUE;
  ------------------
  |  |   15|  14.5k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  14.5k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1377|  14.5k|	}
 1378|       |
 1379|  56.6k|	if (changed && conn->callbacks != NULL &&
  ------------------
  |  Branch (1379:6): [True: 36.1k, False: 20.4k]
  |  Branch (1379:17): [True: 36.1k, False: 0]
  ------------------
 1380|  56.6k|	    conn->callbacks->conn_state_changed != NULL)
  ------------------
  |  Branch (1380:6): [True: 0, False: 36.1k]
  ------------------
 1381|      0|		conn->callbacks->conn_state_changed(conn->context, state, args);
 1382|  56.6k|}
smtp_server_connection_reset_state:
 1393|  20.1k|{
 1394|  20.1k|	e_debug(conn->event, "Connection state reset");
  ------------------
  |  |   61|  20.1k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  20.1k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  20.1k|	struct event *_tmp_event = (_event); \
  |  |   63|  20.1k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  20.1k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  20.1k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 20.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  20.1k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  20.1k|	else \
  |  |   66|  20.1k|		event_send_abort(_tmp_event); \
  |  |   67|  20.1k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  20.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1395|       |
 1396|  20.1k|	i_free(conn->state.args);
  ------------------
  |  |   19|  20.1k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  20.1k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  20.1k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  20.1k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  20.1k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  20.1k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  20.1k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  20.1k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1397|       |
 1398|  20.1k|	if (conn->state.trans != NULL)
  ------------------
  |  Branch (1398:6): [True: 4.54k, False: 15.6k]
  ------------------
 1399|  4.54k|		smtp_server_transaction_free(&conn->state.trans);
 1400|       |
 1401|       |	/* RFC 3030, Section 2:
 1402|       |	   The RSET command, when issued after the first BDAT and before the
 1403|       |	   BDAT LAST, clears all segments sent during that transaction and resets
 1404|       |	   the session.
 1405|       |	 */
 1406|  20.1k|	i_stream_destroy(&conn->state.data_input);
 1407|  20.1k|	i_stream_destroy(&conn->state.data_chain_input);
 1408|  20.1k|	conn->state.data_chain = NULL;
 1409|       |
 1410|       |	/* Reset state */
 1411|  20.1k|	i_zero(&conn->state);
  ------------------
  |  |  249|  20.1k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  20.1k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  20.1k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1412|  20.1k|	smtp_server_connection_set_state(conn, SMTP_SERVER_STATE_READY, NULL);
 1413|  20.1k|}
smtp_server_connection_is_trusted:
 1484|  6.45k|{
 1485|  6.45k|	if (conn->callbacks == NULL || conn->callbacks->conn_is_trusted == NULL)
  ------------------
  |  Branch (1485:6): [True: 0, False: 6.45k]
  |  Branch (1485:33): [True: 6.45k, False: 0]
  ------------------
 1486|  6.45k|		return FALSE;
  ------------------
  |  |   11|  6.45k|#  define FALSE (!1)
  ------------------
 1487|      0|	return conn->callbacks->conn_is_trusted(conn->context);
 1488|  6.45k|}
smtp_server_connection_reason_begin:
 1667|  25.6k|{
 1668|  25.6k|	if (conn->set.reason_code_module == NULL)
  ------------------
  |  Branch (1668:6): [True: 25.6k, False: 0]
  ------------------
 1669|  25.6k|		return NULL;
 1670|      0|	const char *reason_code =
 1671|      0|		event_reason_code(conn->set.reason_code_module, name);
 1672|      0|	return event_reason_begin(reason_code);
  ------------------
  |  |  224|      0|	event_reason_begin(reason_code, __FILE__, __LINE__)
  ------------------
 1673|  25.6k|}
smtp-server-connection.c:smtp_server_connection_update_stats:
   48|  6.21k|{
   49|  6.21k|	if (conn->conn.input != NULL)
  ------------------
  |  Branch (49:6): [True: 6.21k, False: 0]
  ------------------
   50|  6.21k|		conn->stats.input = conn->conn.input->v_offset;
   51|  6.21k|	if (conn->conn.output != NULL)
  ------------------
  |  Branch (51:6): [True: 6.21k, False: 0]
  ------------------
   52|  6.21k|		conn->stats.output = conn->conn.output->offset;
   53|  6.21k|	connection_update_counters(&conn->conn);
   54|  6.21k|}
smtp-server-connection.c:smtp_server_connection_check_pipeline:
   65|   151k|{
   66|   151k|	unsigned int pipeline = conn->command_queue_count;
   67|       |
   68|   151k|	if (conn->command_queue_tail != NULL) {
  ------------------
  |  Branch (68:6): [True: 114k, False: 36.7k]
  ------------------
   69|   114k|		i_assert(pipeline > 0);
  ------------------
  |  |  219|   114k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   114k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   114k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   114k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 114k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 114k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   114k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   114k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   114k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   70|   114k|		if (conn->command_queue_tail->state ==
  ------------------
  |  Branch (70:7): [True: 3.37k, False: 110k]
  ------------------
   71|   114k|		    SMTP_SERVER_COMMAND_STATE_SUBMITTED_REPLY)
   72|  3.37k|			pipeline--;
   73|   114k|	}
   74|       |
   75|   151k|	if (pipeline >= conn->set.max_pipelined_commands) {
  ------------------
  |  Branch (75:6): [True: 4.03k, False: 147k]
  ------------------
   76|  4.03k|		e_debug(conn->event, "Command pipeline is full "
  ------------------
  |  |   61|  4.03k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  4.03k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  4.03k|	struct event *_tmp_event = (_event); \
  |  |   63|  4.03k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  4.03k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  4.03k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 4.03k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  4.03k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  4.03k|	else \
  |  |   66|  4.03k|		event_send_abort(_tmp_event); \
  |  |   67|  4.03k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  4.03k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   77|  4.03k|			"(pipelined commands %u > limit %u)",
   78|  4.03k|			pipeline, conn->set.max_pipelined_commands);
   79|  4.03k|		return FALSE;
  ------------------
  |  |   11|  4.03k|#  define FALSE (!1)
  ------------------
   80|  4.03k|	}
   81|   147k|	return TRUE;
  ------------------
  |  |   15|   147k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   147k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   82|   151k|}
smtp-server-connection.c:smtp_server_connection_update_rawlog:
  147|  6.21k|{
  148|  6.21k|	struct stat st;
  149|       |
  150|  6.21k|	if (conn->set.rawlog_dir == NULL)
  ------------------
  |  Branch (150:6): [True: 6.21k, False: 0]
  ------------------
  151|  6.21k|		return;
  152|       |
  153|      0|	if (!conn->rawlog_checked) {
  ------------------
  |  Branch (153:6): [True: 0, False: 0]
  ------------------
  154|      0|		conn->rawlog_checked = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  155|      0|		if (stat(conn->set.rawlog_dir, &st) == 0)
  ------------------
  |  Branch (155:7): [True: 0, False: 0]
  ------------------
  156|      0|			conn->rawlog_enabled = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  157|      0|	}
  158|      0|	if (conn->rawlog_enabled) {
  ------------------
  |  Branch (158:6): [True: 0, False: 0]
  ------------------
  159|      0|		iostream_rawlog_create(conn->set.rawlog_dir,
  160|      0|				       &conn->conn.input, &conn->conn.output);
  161|      0|	}
  162|      0|}
smtp-server-connection.c:smtp_server_connection_output:
  692|  27.7k|{
  693|  27.7k|	int ret;
  694|       |
  695|  27.7k|	e_debug(conn->event, "Sending replies");
  ------------------
  |  |   61|  27.7k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  27.7k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  27.7k|	struct event *_tmp_event = (_event); \
  |  |   63|  27.7k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  27.7k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  27.7k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 27.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  27.7k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  27.7k|	else \
  |  |   66|  27.7k|		event_send_abort(_tmp_event); \
  |  |   67|  27.7k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  27.7k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  696|       |
  697|  27.7k|	smtp_server_connection_ref(conn);
  698|  27.7k|	o_stream_cork(conn->conn.output);
  699|  27.7k|	ret = smtp_server_connection_flush(conn);
  700|  27.7k|	if (ret > 0) {
  ------------------
  |  Branch (700:6): [True: 27.7k, False: 0]
  ------------------
  701|  27.7k|		smtp_server_connection_timeout_reset(conn);
  702|  27.7k|		smtp_server_connection_send_replies(conn);
  703|  27.7k|	}
  704|  27.7k|	if (ret >= 0 && !conn->corked && conn->conn.output != NULL)
  ------------------
  |  Branch (704:6): [True: 27.7k, False: 0]
  |  Branch (704:18): [True: 27.7k, False: 0]
  |  Branch (704:35): [True: 27.2k, False: 542]
  ------------------
  705|  27.2k|		ret = o_stream_uncork_flush(conn->conn.output);
  706|  27.7k|	if (conn->conn.output != NULL && conn->conn.output->closed) {
  ------------------
  |  Branch (706:6): [True: 27.2k, False: 542]
  |  Branch (706:35): [True: 0, False: 27.2k]
  ------------------
  707|      0|		smtp_server_connection_handle_output_error(conn);
  708|      0|		ret = -1;
  709|      0|	}
  710|  27.7k|	smtp_server_connection_unref(&conn);
  711|  27.7k|	return ret;
  712|  27.7k|}
smtp-server-connection.c:smtp_server_connection_send_replies:
  667|  27.7k|{
  668|       |	/* Send more replies until no more replies remain, the output
  669|       |	   blocks again, or the connection is closed */
  670|   140k|	while (!conn->disconnected && smtp_server_connection_next_reply(conn));
  ------------------
  |  Branch (670:9): [True: 140k, False: 45]
  |  Branch (670:32): [True: 112k, False: 27.7k]
  ------------------
  671|       |
  672|  27.7k|	smtp_server_connection_timeout_update(conn);
  673|       |
  674|       |	/* Accept more commands if possible */
  675|  27.7k|	smtp_server_connection_input_resume(conn);
  676|  27.7k|}
smtp-server-connection.c:smtp_server_connection_next_reply:
  633|   140k|{
  634|   140k|	struct smtp_server_command *cmd;
  635|       |
  636|   140k|	cmd = conn->command_queue_head;
  637|   140k|	if (cmd == NULL) {
  ------------------
  |  Branch (637:6): [True: 26.6k, False: 113k]
  ------------------
  638|       |		/* No commands pending */
  639|  26.6k|		e_debug(conn->event, "No more commands pending");
  ------------------
  |  |   61|  26.6k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  26.6k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  26.6k|	struct event *_tmp_event = (_event); \
  |  |   63|  26.6k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  26.6k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  26.6k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 26.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  26.6k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  26.6k|	else \
  |  |   66|  26.6k|		event_send_abort(_tmp_event); \
  |  |   67|  26.6k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  26.6k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  640|  26.6k|		return FALSE;
  ------------------
  |  |   11|  26.6k|#  define FALSE (!1)
  ------------------
  641|  26.6k|	}
  642|       |
  643|   113k|	return smtp_server_command_send_replies(cmd);
  644|   140k|}
smtp-server-connection.c:smtp_server_connection_ready:
  276|  6.21k|{
  277|  6.21k|	conn->raw_input = conn->conn.input;
  278|  6.21k|	conn->raw_output = conn->conn.output;
  279|       |
  280|  6.21k|	smtp_server_connection_update_rawlog(conn);
  281|       |
  282|  6.21k|	conn->smtp_parser = smtp_command_parser_init(conn->conn.input,
  283|  6.21k|						     &conn->set.command_limits);
  284|  6.21k|	o_stream_set_flush_callback(conn->conn.output,
  ------------------
  |  |  142|  6.21k|	o_stream_set_flush_callback(stream - \
  |  |  143|  6.21k|		CALLBACK_TYPECHECK(callback, int (*)(typeof(context))), \
  |  |  ------------------
  |  |  |  |  171|  6.21k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  6.21k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  144|  6.21k|		(stream_flush_callback_t *)callback, context)
  ------------------
  285|  6.21k|				    smtp_server_connection_output, conn);
  286|       |
  287|  6.21k|	o_stream_cork(conn->conn.output);
  288|  6.21k|	if (conn->set.no_greeting) {
  ------------------
  |  Branch (288:6): [True: 0, False: 6.21k]
  ------------------
  289|       |		/* Don't send greeting or login reply. */
  290|  6.21k|	} else if (conn->authenticated) {
  ------------------
  |  Branch (290:13): [True: 0, False: 6.21k]
  ------------------
  291|       |		/* RFC 4954, Section 4:
  292|       |		   Should the client successfully complete the exchange, the
  293|       |		   SMTP server issues a 235 reply. */
  294|      0|		smtp_server_connection_send_line(
  295|      0|			conn, "235 2.7.0 Logged in.");
  296|  6.21k|	} else {
  297|  6.21k|		smtp_server_connection_send_line(
  298|  6.21k|			conn, "220 %s %s", conn->set.hostname,
  299|  6.21k|			conn->set.login_greeting);
  300|  6.21k|	}
  301|  6.21k|	if (!conn->corked)
  ------------------
  |  Branch (301:6): [True: 6.21k, False: 0]
  ------------------
  302|  6.21k|		o_stream_uncork(conn->conn.output);
  303|  6.21k|}
smtp-server-connection.c:smtp_server_connection_destroy:
  306|  3.75k|{
  307|  3.75k|	struct smtp_server_connection *conn =
  308|  3.75k|		(struct smtp_server_connection *)_conn;
  309|       |
  310|  3.75k|	smtp_server_connection_disconnect(conn, NULL);
  311|  3.75k|	smtp_server_connection_unref(&conn);
  312|  3.75k|}
smtp-server-connection.c:smtp_server_connection_input:
  564|  26.2k|{
  565|  26.2k|	struct smtp_server_connection *conn =
  566|  26.2k|		(struct smtp_server_connection *)_conn;
  567|       |
  568|  26.2k|	i_assert(!conn->input_broken);
  ------------------
  |  |  219|  26.2k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  26.2k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  26.2k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  26.2k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 26.2k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 26.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  26.2k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  26.2k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  26.2k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  569|       |
  570|  26.2k|	if (conn->handling_input)
  ------------------
  |  Branch (570:6): [True: 0, False: 26.2k]
  ------------------
  571|      0|		return;
  572|       |
  573|  26.2k|	smtp_server_connection_timeout_reset(conn);
  574|       |
  575|  26.2k|	if (conn->ssl_start && conn->ssl_iostream == NULL) {
  ------------------
  |  Branch (575:6): [True: 0, False: 26.2k]
  |  Branch (575:25): [True: 0, False: 0]
  ------------------
  576|      0|		if (smtp_server_connection_ssl_init(conn) < 0) {
  ------------------
  |  Branch (576:7): [True: 0, False: 0]
  ------------------
  577|      0|			smtp_server_connection_close(&conn,
  578|      0|				"SSL Initialization failed");
  579|      0|			return;
  580|      0|		}
  581|      0|		if (conn->halted) {
  ------------------
  |  Branch (581:7): [True: 0, False: 0]
  ------------------
  582|      0|			smtp_server_connection_input_lock(conn);
  583|      0|			return;
  584|      0|		}
  585|      0|	}
  586|  26.2k|	i_assert(!conn->halted);
  ------------------
  |  |  219|  26.2k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  26.2k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  26.2k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  26.2k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 26.2k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 26.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  26.2k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  26.2k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  26.2k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  587|       |
  588|       |
  589|  26.2k|	if (!smtp_server_connection_check_pipeline(conn)) {
  ------------------
  |  Branch (589:6): [True: 13, False: 26.2k]
  ------------------
  590|     13|		smtp_server_connection_input_halt(conn);
  591|     13|		return;
  592|     13|	}
  593|       |
  594|  26.2k|	smtp_server_connection_ref(conn);
  595|  26.2k|	conn->handling_input = TRUE;
  ------------------
  |  |   15|  26.2k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  26.2k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  596|  26.2k|	if (conn->callbacks != NULL &&
  ------------------
  |  Branch (596:6): [True: 26.2k, False: 0]
  ------------------
  597|  26.2k|	    conn->callbacks->conn_cmd_input_pre != NULL)
  ------------------
  |  Branch (597:6): [True: 0, False: 26.2k]
  ------------------
  598|      0|		conn->callbacks->conn_cmd_input_pre(conn->context);
  599|  26.2k|	smtp_server_connection_handle_input(conn);
  600|  26.2k|	if (conn->callbacks != NULL &&
  ------------------
  |  Branch (600:6): [True: 26.2k, False: 0]
  ------------------
  601|  26.2k|	    conn->callbacks->conn_cmd_input_post != NULL)
  ------------------
  |  Branch (601:6): [True: 0, False: 26.2k]
  ------------------
  602|      0|		conn->callbacks->conn_cmd_input_post(conn->context);
  603|  26.2k|	conn->handling_input = FALSE;
  ------------------
  |  |   11|  26.2k|#  define FALSE (!1)
  ------------------
  604|       |
  605|       |	/* Handle output errors from immediate replies sent to client
  606|       |	   (normal replies are exclusively sent in output handler). */
  607|  26.2k|	if (conn->conn.output != NULL && conn->conn.output->closed)
  ------------------
  |  Branch (607:6): [True: 24.3k, False: 1.87k]
  |  Branch (607:35): [True: 0, False: 24.3k]
  ------------------
  608|      0|               	smtp_server_connection_handle_output_error(conn);
  609|  26.2k|	smtp_server_connection_unref(&conn);
  610|  26.2k|}
smtp-server-connection.c:smtp_server_connection_handle_input:
  423|  26.2k|{
  424|  26.2k|	struct smtp_server_command *pending_command;
  425|  26.2k|	enum smtp_command_parse_error error_code;
  426|  26.2k|	const char *cmd_name, *cmd_params, *error;
  427|  26.2k|	int ret;
  428|       |
  429|       |	/* Check whether we are continuing a command */
  430|  26.2k|	pending_command = NULL;
  431|  26.2k|	if (conn->command_queue_tail != NULL) {
  ------------------
  |  Branch (431:6): [True: 235, False: 25.9k]
  ------------------
  432|    235|		pending_command =
  433|    235|			((conn->command_queue_tail->state ==
  ------------------
  |  Branch (433:5): [True: 153, False: 82]
  ------------------
  434|    235|			  SMTP_SERVER_COMMAND_STATE_SUBMITTED_REPLY) ?
  435|    153|			 conn->command_queue_tail : NULL);
  436|    235|	}
  437|       |
  438|  26.2k|	smtp_server_connection_timeout_reset(conn);
  439|       |
  440|       |	/* Parse commands */
  441|  26.2k|	ret = 1;
  442|  52.0k|	while (!conn->closing && !conn->input_locked && ret != 0) {
  ------------------
  |  Branch (442:9): [True: 52.0k, False: 0]
  |  Branch (442:27): [True: 39.3k, False: 12.7k]
  |  Branch (442:50): [True: 39.1k, False: 163]
  ------------------
  443|   121k|		while ((ret = smtp_command_parse_next(
  ------------------
  |  Branch (443:10): [True: 103k, False: 18.6k]
  ------------------
  444|   121k|			conn->smtp_parser, &cmd_name, &cmd_params,
  445|   121k|			&error_code, &error)) > 0) {
  446|       |
  447|   103k|			if (pending_command != NULL) {
  ------------------
  |  Branch (447:8): [True: 2.81k, False: 100k]
  ------------------
  448|       |				/* Previous command is now fully read and ready
  449|       |				   to reply */
  450|  2.81k|				smtp_server_command_ready_to_reply(pending_command);
  451|  2.81k|				pending_command = NULL;
  452|  2.81k|			}
  453|       |
  454|   103k|			e_debug(conn->event, "Received new command: %s %s",
  ------------------
  |  |   61|   103k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|   103k|#  define STMT_START do
  |  |  ------------------
  |  |   62|   103k|	struct event *_tmp_event = (_event); \
  |  |   63|   103k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|   103k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   103k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 103k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|   103k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|   103k|	else \
  |  |   66|   103k|		event_send_abort(_tmp_event); \
  |  |   67|   103k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|   103k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  455|   103k|				cmd_name, cmd_params);
  456|       |
  457|   103k|			conn->stats.command_count++;
  458|       |
  459|       |			/* Handle command (cmd may be destroyed after this) */
  460|   103k|			if (!smtp_server_connection_handle_command(conn,
  ------------------
  |  Branch (460:8): [True: 4.19k, False: 99.0k]
  ------------------
  461|   103k|				cmd_name, cmd_params))
  462|  4.19k|				return;
  463|       |
  464|  99.0k|			if (conn->disconnected)
  ------------------
  |  Branch (464:8): [True: 206, False: 98.8k]
  ------------------
  465|    206|				return;
  466|       |			/* Last command locked the input; stop trying to read
  467|       |			   more. */
  468|  98.8k|			if (conn->input_locked)
  ------------------
  |  Branch (468:8): [True: 12.7k, False: 86.1k]
  ------------------
  469|  12.7k|				break;
  470|       |			/* Client indicated it will close after this command;
  471|       |			   stop trying to read more. */
  472|  86.1k|			if (conn->closing)
  ------------------
  |  Branch (472:8): [True: 0, False: 86.1k]
  ------------------
  473|      0|				break;
  474|       |
  475|  86.1k|			if (!smtp_server_connection_check_pipeline(conn)) {
  ------------------
  |  Branch (475:8): [True: 3.47k, False: 82.6k]
  ------------------
  476|  3.47k|				smtp_server_connection_input_halt(conn);
  477|  3.47k|				return;
  478|  3.47k|			}
  479|       |
  480|  82.6k|			if (conn->command_queue_tail != NULL) {
  ------------------
  |  Branch (480:8): [True: 82.6k, False: 0]
  ------------------
  481|  82.6k|				pending_command =
  482|  82.6k|					((conn->command_queue_tail->state ==
  ------------------
  |  Branch (482:7): [True: 2.99k, False: 79.6k]
  ------------------
  483|  82.6k|					  SMTP_SERVER_COMMAND_STATE_SUBMITTED_REPLY) ?
  484|  2.99k|					 conn->command_queue_tail : NULL);
  485|  82.6k|			}
  486|  82.6k|		}
  487|       |
  488|  31.3k|		if (ret < 0 && conn->conn.input->eof) {
  ------------------
  |  Branch (488:7): [True: 18.4k, False: 12.8k]
  |  Branch (488:18): [True: 5.35k, False: 13.0k]
  ------------------
  489|  5.35k|			const char *error =
  490|  5.35k|				i_stream_get_disconnect_reason(conn->conn.input);
  491|  5.35k|			e_debug(conn->event, "Remote closed connection: %s",
  ------------------
  |  |   61|  5.35k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  5.35k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  5.35k|	struct event *_tmp_event = (_event); \
  |  |   63|  5.35k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  5.35k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  5.35k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 5.35k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  5.35k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  5.35k|	else \
  |  |   66|  5.35k|		event_send_abort(_tmp_event); \
  |  |   67|  5.35k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  5.35k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  492|  5.35k|				error);
  493|       |
  494|  5.35k|			if (conn->command_queue_head == NULL ||
  ------------------
  |  Branch (494:8): [True: 1.57k, False: 3.77k]
  ------------------
  495|  5.35k|			    conn->command_queue_head->state <
  ------------------
  |  Branch (495:8): [True: 0, False: 3.77k]
  ------------------
  496|  3.77k|			    SMTP_SERVER_COMMAND_STATE_SUBMITTED_REPLY) {
  497|       |				/* No pending commands or unfinished
  498|       |				   command; close */
  499|  1.57k|				smtp_server_connection_close(&conn, error);
  500|  3.77k|			} else {
  501|       |				/* A command is still processing;
  502|       |				   only drop input io for now */
  503|  3.77k|				conn->input_broken = TRUE;
  ------------------
  |  |   15|  3.77k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  3.77k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  504|  3.77k|				smtp_server_connection_input_halt(conn);
  505|  3.77k|			}
  506|  5.35k|			return;
  507|  5.35k|		}
  508|       |
  509|  25.9k|		if (ret < 0) {
  ------------------
  |  Branch (509:7): [True: 13.0k, False: 12.8k]
  ------------------
  510|  13.0k|			struct smtp_server_command *cmd;
  511|       |
  512|  13.0k|			e_debug(conn->event,
  ------------------
  |  |   61|  13.0k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  13.0k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  13.0k|	struct event *_tmp_event = (_event); \
  |  |   63|  13.0k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  13.0k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  13.0k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 13.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  13.0k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  13.0k|	else \
  |  |   66|  13.0k|		event_send_abort(_tmp_event); \
  |  |   67|  13.0k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  13.0k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  513|  13.0k|				"Client sent invalid command: %s", error);
  514|       |
  515|  13.0k|			switch (error_code) {
  516|      0|			case SMTP_COMMAND_PARSE_ERROR_BROKEN_COMMAND:
  ------------------
  |  Branch (516:4): [True: 0, False: 13.0k]
  ------------------
  517|      0|				conn->input_broken = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  518|       |				/* fall through */
  519|  12.5k|			case SMTP_COMMAND_PARSE_ERROR_BAD_COMMAND:
  ------------------
  |  Branch (519:4): [True: 12.5k, False: 498]
  ------------------
  520|  12.5k|				cmd = smtp_server_command_new_invalid(conn);
  521|  12.5k|				smtp_server_command_fail(
  522|  12.5k|					cmd, 500, "5.5.2",
  523|  12.5k|					"Invalid command syntax");
  524|  12.5k|				break;
  525|    498|			case SMTP_COMMAND_PARSE_ERROR_LINE_TOO_LONG:
  ------------------
  |  Branch (525:4): [True: 498, False: 12.5k]
  ------------------
  526|    498|				cmd = smtp_server_command_new_invalid(conn);
  527|    498|				smtp_server_command_fail(
  528|    498|					cmd, 500, "5.5.2", "Line too long");
  529|    498|				break;
  530|      0|			case SMTP_COMMAND_PARSE_ERROR_DATA_TOO_LARGE:
  ------------------
  |  Branch (530:4): [True: 0, False: 13.0k]
  ------------------
  531|       |				/* Command data size exceeds the absolute limit;
  532|       |				   i.e. beyond which we don't even want to skip
  533|       |				   data anymore. The command error is usually
  534|       |				   already submitted by the application and sent
  535|       |				   to the client. */
  536|      0|				smtp_server_connection_close(&conn,
  537|      0|					"Command data size exceeds absolute limit");
  538|      0|				return;
  539|      0|			case SMTP_COMMAND_PARSE_ERROR_BROKEN_STREAM:
  ------------------
  |  Branch (539:4): [True: 0, False: 13.0k]
  ------------------
  540|      0|				smtp_server_connection_close(&conn, error);
  541|      0|				return;
  542|      0|			default:
  ------------------
  |  Branch (542:4): [True: 0, False: 13.0k]
  ------------------
  543|      0|				i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
  544|  13.0k|			}
  545|  13.0k|		}
  546|       |
  547|  25.9k|		if (conn->disconnected)
  ------------------
  |  Branch (547:7): [True: 86, False: 25.8k]
  ------------------
  548|     86|			return;
  549|  25.8k|		if (conn->input_broken || conn->closing) {
  ------------------
  |  Branch (549:7): [True: 0, False: 25.8k]
  |  Branch (549:29): [True: 0, False: 25.8k]
  ------------------
  550|      0|			smtp_server_connection_input_halt(conn);
  551|      0|			return;
  552|      0|		}
  553|       |
  554|  25.8k|		if (ret == 0 && pending_command != NULL &&
  ------------------
  |  Branch (554:7): [True: 163, False: 25.7k]
  |  Branch (554:19): [True: 55, False: 108]
  ------------------
  555|  25.8k|		    !smtp_command_parser_pending_data(conn->smtp_parser)) {
  ------------------
  |  Branch (555:7): [True: 12, False: 43]
  ------------------
  556|       |			/* Previous command is now fully read and ready to
  557|       |			   reply */
  558|     12|			smtp_server_command_ready_to_reply(pending_command);
  559|     12|		}
  560|  25.8k|	}
  561|  26.2k|}
smtp-server-connection.c:smtp_server_connection_handle_command:
  317|   103k|{
  318|   103k|	struct smtp_server_connection *tmp_conn = conn;
  319|   103k|	struct smtp_server_command *cmd;
  320|   103k|	bool finished;
  321|       |
  322|   103k|	cmd = smtp_server_command_new(tmp_conn, cmd_name);
  323|       |
  324|   103k|	smtp_server_command_ref(cmd);
  325|       |
  326|   103k|	smtp_server_connection_ref(tmp_conn);
  327|   103k|	smtp_server_command_execute(cmd, cmd_params);
  328|   103k|	if (!smtp_server_connection_unref(&tmp_conn)) {
  ------------------
  |  Branch (328:6): [True: 0, False: 103k]
  ------------------
  329|       |		/* The command start callback managed to get this connection
  330|       |		   destroyed */
  331|      0|		smtp_server_command_unref(&cmd);
  332|      0|		return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  333|      0|	}
  334|       |
  335|   103k|	if (conn->command_queue_head == cmd)
  ------------------
  |  Branch (335:6): [True: 22.2k, False: 81.0k]
  ------------------
  336|  22.2k|		(void)smtp_server_command_next_to_reply(&cmd);
  337|       |
  338|   103k|	smtp_server_connection_timeout_update(conn);
  339|       |
  340|   103k|	finished = !cmd->input_locked;
  341|   103k|	return (!smtp_server_command_unref(&cmd) || finished);
  ------------------
  |  Branch (341:10): [True: 206, False: 103k]
  |  Branch (341:46): [True: 98.8k, False: 4.19k]
  ------------------
  342|   103k|}
smtp-server-connection.c:smtp_server_connection_alloc:
  792|  6.21k|{
  793|  6.21k|	struct smtp_server_connection *conn;
  794|  6.21k|	pool_t pool;
  795|       |
  796|  6.21k|	pool = pool_alloconly_create("smtp server", 1024);
  797|  6.21k|	conn = p_new(pool, struct smtp_server_connection, 1);
  ------------------
  |  |   97|  6.21k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|  6.21k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|  6.21k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  798|  6.21k|	conn->pool = pool;
  799|  6.21k|	conn->refcount = 1;
  800|  6.21k|	conn->server = server;
  801|  6.21k|	conn->callbacks = callbacks;
  802|  6.21k|	conn->context = context;
  803|       |
  804|       |	/* Merge settings with global server settings */
  805|  6.21k|	conn->set = server->set;
  806|  6.21k|	if (set != NULL) {
  ------------------
  |  Branch (806:6): [True: 0, False: 6.21k]
  ------------------
  807|      0|		conn->set.protocol = server->set.protocol;
  808|      0|		if (set->rawlog_dir != NULL && *set->rawlog_dir != '\0')
  ------------------
  |  Branch (808:7): [True: 0, False: 0]
  |  Branch (808:34): [True: 0, False: 0]
  ------------------
  809|      0|			conn->set.rawlog_dir = p_strdup(pool, set->rawlog_dir);
  810|       |
  811|      0|		if (set->ssl != NULL)
  ------------------
  |  Branch (811:7): [True: 0, False: 0]
  ------------------
  812|      0|			conn->set.ssl = ssl_iostream_settings_dup(pool, set->ssl);
  813|       |
  814|      0|		if (set->hostname != NULL && *set->hostname != '\0')
  ------------------
  |  Branch (814:7): [True: 0, False: 0]
  |  Branch (814:32): [True: 0, False: 0]
  ------------------
  815|      0|			conn->set.hostname = p_strdup(pool, set->hostname);
  816|      0|		if (set->login_greeting != NULL &&
  ------------------
  |  Branch (816:7): [True: 0, False: 0]
  ------------------
  817|      0|			*set->login_greeting != '\0') {
  ------------------
  |  Branch (817:4): [True: 0, False: 0]
  ------------------
  818|      0|			conn->set.login_greeting =
  819|      0|				p_strdup(pool, set->login_greeting);
  820|      0|		}
  821|      0|		if (set->capabilities != 0)
  ------------------
  |  Branch (821:7): [True: 0, False: 0]
  ------------------
  822|      0|			conn->set.capabilities = set->capabilities;
  823|      0|		conn->set.workarounds |= set->workarounds;
  824|       |
  825|      0|		if (set->max_client_idle_time_msecs > 0) {
  ------------------
  |  Branch (825:7): [True: 0, False: 0]
  ------------------
  826|      0|			conn->set.max_client_idle_time_msecs =
  827|      0|				set->max_client_idle_time_msecs;
  828|      0|		}
  829|      0|		if (set->max_pipelined_commands > 0) {
  ------------------
  |  Branch (829:7): [True: 0, False: 0]
  ------------------
  830|      0|			conn->set.max_pipelined_commands =
  831|      0|				set->max_pipelined_commands;
  832|      0|		}
  833|      0|		if (set->max_bad_commands > 0) {
  ------------------
  |  Branch (833:7): [True: 0, False: 0]
  ------------------
  834|      0|			conn->set.max_bad_commands = set->max_bad_commands;
  835|      0|		}
  836|      0|		if (set->max_recipients > 0)
  ------------------
  |  Branch (836:7): [True: 0, False: 0]
  ------------------
  837|      0|			conn->set.max_recipients = set->max_recipients;
  838|      0|		smtp_command_limits_merge(&conn->set.command_limits,
  839|      0|					  &set->command_limits);
  840|       |
  841|      0|		conn->set.max_message_size = set->max_message_size;
  842|      0|		if (set->max_message_size == 0 ||
  ------------------
  |  Branch (842:7): [True: 0, False: 0]
  ------------------
  843|      0|		    set->max_message_size == UOFF_T_MAX) {
  ------------------
  |  |  846|      0|#define UOFF_T_MAX ULONG_MAX
  ------------------
  |  Branch (843:7): [True: 0, False: 0]
  ------------------
  844|      0|			conn->set.command_limits.max_data_size = UOFF_T_MAX;
  ------------------
  |  |  846|      0|#define UOFF_T_MAX ULONG_MAX
  ------------------
  845|      0|		} else if (conn->set.command_limits.max_data_size != 0) {
  ------------------
  |  Branch (845:14): [True: 0, False: 0]
  ------------------
  846|       |			/* Explicit limit given */
  847|      0|		} else if (set->max_message_size >
  ------------------
  |  Branch (847:14): [True: 0, False: 0]
  ------------------
  848|      0|			(UOFF_T_MAX - SMTP_SERVER_DEFAULT_MAX_SIZE_EXCESS_LIMIT)) {
  ------------------
  |  |  846|      0|#define UOFF_T_MAX ULONG_MAX
  ------------------
              			(UOFF_T_MAX - SMTP_SERVER_DEFAULT_MAX_SIZE_EXCESS_LIMIT)) {
  ------------------
  |  |    9|      0|#define SMTP_SERVER_DEFAULT_MAX_SIZE_EXCESS_LIMIT (1024*1024)
  ------------------
  849|       |			/* Very high limit */
  850|      0|			conn->set.command_limits.max_data_size = UOFF_T_MAX;
  ------------------
  |  |  846|      0|#define UOFF_T_MAX ULONG_MAX
  ------------------
  851|      0|		} else {
  852|       |			/* Absolute maximum before connection is closed in DATA
  853|       |			   command */
  854|      0|			conn->set.command_limits.max_data_size =
  855|      0|				set->max_message_size +
  856|      0|					SMTP_SERVER_DEFAULT_MAX_SIZE_EXCESS_LIMIT;
  ------------------
  |  |    9|      0|#define SMTP_SERVER_DEFAULT_MAX_SIZE_EXCESS_LIMIT (1024*1024)
  ------------------
  857|      0|		}
  858|       |
  859|      0|		if (set->mail_param_extensions != NULL) {
  ------------------
  |  Branch (859:7): [True: 0, False: 0]
  ------------------
  860|      0|			conn->set.mail_param_extensions =
  861|      0|				p_strarray_dup(pool, set->mail_param_extensions);
  862|      0|		}
  863|      0|		if (set->rcpt_param_extensions != NULL) {
  ------------------
  |  Branch (863:7): [True: 0, False: 0]
  ------------------
  864|      0|			conn->set.rcpt_param_extensions =
  865|      0|				p_strarray_dup(pool, set->rcpt_param_extensions);
  866|      0|		}
  867|      0|		if (set->xclient_extensions != NULL) {
  ------------------
  |  Branch (867:7): [True: 0, False: 0]
  ------------------
  868|      0|			conn->set.xclient_extensions =
  869|      0|				p_strarray_dup(pool, set->xclient_extensions);
  870|      0|		}
  871|       |
  872|      0|		if (set->socket_send_buffer_size > 0) {
  ------------------
  |  Branch (872:7): [True: 0, False: 0]
  ------------------
  873|      0|			conn->set.socket_send_buffer_size =
  874|      0|				set->socket_send_buffer_size;
  875|      0|		}
  876|      0|		if (set->socket_recv_buffer_size > 0) {
  ------------------
  |  Branch (876:7): [True: 0, False: 0]
  ------------------
  877|      0|			conn->set.socket_recv_buffer_size =
  878|      0|				set->socket_recv_buffer_size;
  879|      0|		}
  880|       |
  881|      0|		conn->set.tls_required =
  882|      0|			conn->set.tls_required || set->tls_required;
  ------------------
  |  Branch (882:4): [True: 0, False: 0]
  |  Branch (882:30): [True: 0, False: 0]
  ------------------
  883|      0|		conn->set.auth_optional =
  884|      0|			conn->set.auth_optional || set->auth_optional;
  ------------------
  |  Branch (884:4): [True: 0, False: 0]
  |  Branch (884:31): [True: 0, False: 0]
  ------------------
  885|      0|		conn->set.mail_path_allow_broken =
  886|      0|			conn->set.mail_path_allow_broken ||
  ------------------
  |  Branch (886:4): [True: 0, False: 0]
  ------------------
  887|      0|				set->mail_path_allow_broken;
  ------------------
  |  Branch (887:5): [True: 0, False: 0]
  ------------------
  888|      0|		conn->set.rcpt_domain_optional =
  889|      0|			conn->set.rcpt_domain_optional ||
  ------------------
  |  Branch (889:4): [True: 0, False: 0]
  ------------------
  890|      0|				set->rcpt_domain_optional;
  ------------------
  |  Branch (890:5): [True: 0, False: 0]
  ------------------
  891|      0|		conn->set.no_greeting =
  892|      0|			conn->set.no_greeting || set->no_greeting;
  ------------------
  |  Branch (892:4): [True: 0, False: 0]
  |  Branch (892:29): [True: 0, False: 0]
  ------------------
  893|      0|		conn->set.debug = conn->set.debug || set->debug;
  ------------------
  |  Branch (893:21): [True: 0, False: 0]
  |  Branch (893:40): [True: 0, False: 0]
  ------------------
  894|      0|	}
  895|       |
  896|  6.21k|	if (set != NULL && set->mail_param_extensions != NULL) {
  ------------------
  |  Branch (896:6): [True: 0, False: 6.21k]
  |  Branch (896:21): [True: 0, False: 0]
  ------------------
  897|      0|		const char *const *extp;
  898|       |
  899|      0|		p_array_init(&conn->mail_param_extensions, pool,
  ------------------
  |  |   44|      0|	array_create(array, pool, sizeof(**(array)->v), init_count)
  |  |  ------------------
  |  |  |  |  152|      0|	array_create_i(&(array)->arr, pool, element_size, init_count)
  |  |  ------------------
  ------------------
  900|      0|			     str_array_length(set->mail_param_extensions) + 8);
  901|      0|		for (extp = set->mail_param_extensions; *extp != NULL; extp++) {
  ------------------
  |  Branch (901:43): [True: 0, False: 0]
  ------------------
  902|      0|			const char *ext = p_strdup(pool, *extp);
  903|      0|			array_push_back(&conn->mail_param_extensions, &ext);
  ------------------
  |  |  282|      0|#define array_push_back(array, item) array_append(array, (item), 1)
  |  |  ------------------
  |  |  |  |  214|      0|	TYPE_CHECKS(void, ARRAY_TYPE_CHECK(array, data), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|	(FALSE ? (return_type)(checks) : (func))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (11:17): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:25): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  215|      0|	array_append_i(&(array)->arr, data, count))
  |  |  ------------------
  ------------------
  904|      0|		}
  905|      0|		array_append_zero(&conn->mail_param_extensions);
  ------------------
  |  |  341|      0|	(void)array_append_space_i(&(array)->arr)
  ------------------
  906|      0|	}
  907|  6.21k|	if (set != NULL && set->rcpt_param_extensions != NULL) {
  ------------------
  |  Branch (907:6): [True: 0, False: 6.21k]
  |  Branch (907:21): [True: 0, False: 0]
  ------------------
  908|      0|		const char *const *extp;
  909|       |
  910|      0|		p_array_init(&conn->rcpt_param_extensions, pool,
  ------------------
  |  |   44|      0|	array_create(array, pool, sizeof(**(array)->v), init_count)
  |  |  ------------------
  |  |  |  |  152|      0|	array_create_i(&(array)->arr, pool, element_size, init_count)
  |  |  ------------------
  ------------------
  911|      0|			     str_array_length(set->rcpt_param_extensions) + 8);
  912|      0|		for (extp = set->rcpt_param_extensions; *extp != NULL; extp++) {
  ------------------
  |  Branch (912:43): [True: 0, False: 0]
  ------------------
  913|      0|			const char *ext = p_strdup(pool, *extp);
  914|      0|			array_push_back(&conn->rcpt_param_extensions, &ext);
  ------------------
  |  |  282|      0|#define array_push_back(array, item) array_append(array, (item), 1)
  |  |  ------------------
  |  |  |  |  214|      0|	TYPE_CHECKS(void, ARRAY_TYPE_CHECK(array, data), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|	(FALSE ? (return_type)(checks) : (func))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (11:17): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:25): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  215|      0|	array_append_i(&(array)->arr, data, count))
  |  |  ------------------
  ------------------
  915|      0|		}
  916|      0|		array_append_zero(&conn->rcpt_param_extensions);
  ------------------
  |  |  341|      0|	(void)array_append_space_i(&(array)->arr)
  ------------------
  917|      0|	}
  918|       |
  919|  6.21k|	net_set_nonblock(fd_in, TRUE);
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  920|  6.21k|	if (fd_in != fd_out)
  ------------------
  |  Branch (920:6): [True: 0, False: 6.21k]
  ------------------
  921|      0|		net_set_nonblock(fd_out, TRUE);
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  922|  6.21k|	(void)net_set_tcp_nodelay(fd_out, TRUE);
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  923|       |
  924|  6.21k|	set = &conn->set;
  925|  6.21k|	if (set->socket_send_buffer_size > 0 &&
  ------------------
  |  Branch (925:6): [True: 0, False: 6.21k]
  ------------------
  926|  6.21k|	    net_set_send_buffer_size(fd_out,
  ------------------
  |  Branch (926:6): [True: 0, False: 0]
  ------------------
  927|      0|			             set->socket_send_buffer_size) < 0) {
  928|      0|		e_error(conn->event,
  ------------------
  |  |   43|      0|	e_error(_event, __FILE__, __LINE__, __VA_ARGS__)
  ------------------
  929|      0|			"net_set_send_buffer_size(%zu) failed: %m",
  930|      0|			set->socket_send_buffer_size);
  931|      0|	}
  932|  6.21k|	if (set->socket_recv_buffer_size > 0 &&
  ------------------
  |  Branch (932:6): [True: 0, False: 6.21k]
  ------------------
  933|  6.21k|	    net_set_recv_buffer_size(fd_in,
  ------------------
  |  Branch (933:6): [True: 0, False: 0]
  ------------------
  934|      0|				     set->socket_recv_buffer_size) < 0) {
  935|      0|		e_error(conn->event,
  ------------------
  |  |   43|      0|	e_error(_event, __FILE__, __LINE__, __VA_ARGS__)
  ------------------
  936|      0|			"net_set_recv_buffer_size(%zu) failed: %m",
  937|      0|			set->socket_recv_buffer_size);
  938|      0|	}
  939|       |
  940|  6.21k|	smtp_server_connection_init_session(conn);
  941|       |
  942|  6.21k|	return conn;
  943|  6.21k|}
smtp-server-connection.c:smtp_server_connection_init_session:
  771|  6.21k|{
  772|  6.21k|	guid_128_t guid;
  773|  6.21k|	string_t *session_id;
  774|       |
  775|  6.21k|	session_id = t_str_new(30);
  776|  6.21k|	guid_128_generate(guid);
  777|  6.21k|	base64_encode(guid, sizeof(guid), session_id);
  778|       |
  779|       |	/* drop trailing "==" */
  780|  6.21k|	i_assert(str_c(session_id)[str_len(session_id)-2] == '=');
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  781|  6.21k|	str_truncate(session_id, str_len(session_id)-2);
  782|       |
  783|  6.21k|	conn->session_id = i_strdup(str_c(session_id));
  784|  6.21k|}
smtp-server-connection.c:smtp_server_connection_event_create:
  747|  6.21k|{
  748|  6.21k|	struct event *conn_event;
  749|       |
  750|  6.21k|	if (set != NULL && set->event_parent != NULL) {
  ------------------
  |  Branch (750:6): [True: 0, False: 6.21k]
  |  Branch (750:21): [True: 0, False: 0]
  ------------------
  751|      0|		conn_event = event_create(set->event_parent);
  ------------------
  |  |  156|      0|	event_create((parent), __FILE__, __LINE__)
  ------------------
  752|      0|		smtp_server_event_init(server, conn_event);
  753|      0|	} else
  754|  6.21k|		conn_event = event_create(server->event);
  ------------------
  |  |  156|  6.21k|	event_create((parent), __FILE__, __LINE__)
  ------------------
  755|  6.21k|	event_set_append_log_prefix(conn_event, t_strdup_printf(
  756|  6.21k|		"%s-server: ", smtp_protocol_name(server->set.protocol)));
  757|  6.21k|	event_set_forced_debug(conn_event, (set != NULL && set->debug));
  ------------------
  |  Branch (757:38): [True: 0, False: 6.21k]
  |  Branch (757:53): [True: 0, False: 0]
  ------------------
  758|       |
  759|  6.21k|	return conn_event;
  760|  6.21k|}
smtp-server-connection.c:smtp_server_connection_update_event:
  764|  6.21k|{
  765|  6.21k|	event_add_str(conn->event, "connection_id", conn->session_id);
  766|  6.21k|	event_add_str(conn->event, "session", conn->session_id);
  767|  6.21k|}
smtp-server-connection.c:smtp_server_connection_disconnect:
 1044|  12.4k|{
 1045|  12.4k|	struct smtp_server_command *cmd, *cmd_next;
 1046|       |
 1047|  12.4k|	if (conn->disconnected)
  ------------------
  |  Branch (1047:6): [True: 6.21k, False: 6.21k]
  ------------------
 1048|  6.21k|		return;
 1049|  6.21k|	conn->disconnected = TRUE;
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1050|       |
 1051|  6.21k|	if (reason == NULL)
  ------------------
  |  Branch (1051:6): [True: 3.75k, False: 2.45k]
  ------------------
 1052|  3.75k|		reason = smtp_server_connection_get_disconnect_reason(conn);
 1053|  2.45k|	else
 1054|  2.45k|		reason = t_str_oneline(reason);
 1055|       |
 1056|  6.21k|	cmd = conn->command_queue_head;
 1057|  6.21k|	if (cmd != NULL && cmd->reg != NULL) {
  ------------------
  |  Branch (1057:6): [True: 1.18k, False: 5.03k]
  |  Branch (1057:21): [True: 1.05k, False: 129]
  ------------------
 1058|       |		/* Unfinished command - include it in the reason string */
 1059|  1.05k|		reason = t_strdup_printf("%s (unfinished %s command)",
 1060|  1.05k|			reason, cmd->reg->name);
 1061|  1.05k|	}
 1062|  6.21k|	if (!conn->set.no_state_in_reason) {
  ------------------
  |  Branch (1062:6): [True: 6.21k, False: 0]
  ------------------
 1063|  6.21k|		reason = t_strdup_printf("%s (state=%s)", reason,
 1064|  6.21k|			smtp_server_state_names[conn->state.state]);
 1065|  6.21k|	}
 1066|       |
 1067|  6.21k|	e_debug(conn->event, "Disconnected: %s", reason);
  ------------------
  |  |   61|  6.21k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  6.21k|	struct event *_tmp_event = (_event); \
  |  |   63|  6.21k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  6.21k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  6.21k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 6.21k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  6.21k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  6.21k|	else \
  |  |   66|  6.21k|		event_send_abort(_tmp_event); \
  |  |   67|  6.21k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1068|       |
 1069|       |	/* Preserve statistics */
 1070|  6.21k|	smtp_server_connection_update_stats(conn);
 1071|       |
 1072|       |	/* Drop transaction */
 1073|  6.21k|	smtp_server_connection_reset_state(conn);
 1074|       |
 1075|       |	/* Clear command queue */
 1076|  6.21k|	cmd = conn->command_queue_head;
 1077|  9.90k|	while (cmd != NULL) {
  ------------------
  |  Branch (1077:9): [True: 3.69k, False: 6.21k]
  ------------------
 1078|  3.69k|		cmd_next = cmd->next;
 1079|  3.69k|		smtp_server_command_abort(&cmd);
 1080|  3.69k|		cmd = cmd_next;
 1081|  3.69k|	}
 1082|       |
 1083|  6.21k|	smtp_server_connection_timeout_stop(conn);
 1084|  6.21k|	if (conn->conn.output != NULL)
  ------------------
  |  Branch (1084:6): [True: 6.21k, False: 0]
  ------------------
 1085|  6.21k|		o_stream_uncork(conn->conn.output);
 1086|  6.21k|	if (conn->smtp_parser != NULL)
  ------------------
  |  Branch (1086:6): [True: 6.21k, False: 0]
  ------------------
 1087|  6.21k|		smtp_command_parser_deinit(&conn->smtp_parser);
 1088|  6.21k|	ssl_iostream_destroy(&conn->ssl_iostream);
 1089|  6.21k|	if (conn->ssl_ctx != NULL)
  ------------------
  |  Branch (1089:6): [True: 0, False: 6.21k]
  ------------------
 1090|      0|		ssl_iostream_context_unref(&conn->ssl_ctx);
 1091|       |
 1092|  6.21k|	if (conn->callbacks != NULL &&
  ------------------
  |  Branch (1092:6): [True: 6.21k, False: 0]
  ------------------
 1093|  6.21k|	    conn->callbacks->conn_disconnect != NULL) {
  ------------------
  |  Branch (1093:6): [True: 0, False: 6.21k]
  ------------------
 1094|       |		/* The callback may close the fd, so remove IO before that */
 1095|      0|		io_remove(&conn->conn.io);
 1096|      0|		conn->callbacks->conn_disconnect(conn->context, reason);
 1097|      0|	}
 1098|       |
 1099|  6.21k|	if (!conn->created_from_streams)
  ------------------
  |  Branch (1099:6): [True: 6.21k, False: 0]
  ------------------
 1100|  6.21k|		connection_disconnect(&conn->conn);
 1101|      0|	else {
 1102|      0|		conn->conn.fd_in = conn->conn.fd_out = -1;
 1103|      0|		io_remove(&conn->conn.io);
 1104|      0|		i_stream_unref(&conn->conn.input);
 1105|      0|		o_stream_unref(&conn->conn.output);
 1106|      0|	}
 1107|  6.21k|}
smtp-server-connection.c:smtp_server_connection_get_disconnect_reason:
 1025|  3.75k|{
 1026|  3.75k|	const char *err;
 1027|       |
 1028|  3.75k|	if (conn->ssl_iostream != NULL &&
  ------------------
  |  Branch (1028:6): [True: 0, False: 3.75k]
  ------------------
 1029|  3.75k|	    !ssl_iostream_is_handshaked(conn->ssl_iostream)) {
  ------------------
  |  Branch (1029:6): [True: 0, False: 0]
  ------------------
 1030|      0|		err = ssl_iostream_get_last_error(conn->ssl_iostream);
 1031|      0|		if (err != NULL) {
  ------------------
  |  Branch (1031:7): [True: 0, False: 0]
  ------------------
 1032|      0|			return t_strdup_printf(
 1033|      0|				"TLS handshaking failed: %s", err);
 1034|      0|		}
 1035|      0|	}
 1036|       |
 1037|  3.75k|	return io_stream_get_disconnect_reason(conn->conn.input,
 1038|  3.75k|					       conn->conn.output);
 1039|  3.75k|}
smtp-server-connection.c:smtp_server_connection_timeout_update:
  246|   137k|{
  247|   137k|	struct smtp_server_command *cmd = conn->command_queue_head;
  248|       |
  249|   137k|	if (cmd == NULL) {
  ------------------
  |  Branch (249:6): [True: 33.5k, False: 103k]
  ------------------
  250|  33.5k|		smtp_server_connection_timeout_start(conn);
  251|  33.5k|		return;
  252|  33.5k|	}
  253|       |
  254|   103k|	switch (cmd->state) {
  ------------------
  |  Branch (254:10): [True: 0, False: 103k]
  ------------------
  255|      0|	case SMTP_SERVER_COMMAND_STATE_NEW:
  ------------------
  |  Branch (255:2): [True: 0, False: 103k]
  ------------------
  256|      0|		smtp_server_connection_timeout_start(conn);
  257|      0|		break;
  258|    175|	case SMTP_SERVER_COMMAND_STATE_PROCESSING:
  ------------------
  |  Branch (258:2): [True: 175, False: 103k]
  ------------------
  259|    175|		if (cmd->input_captured) {
  ------------------
  |  Branch (259:7): [True: 175, False: 0]
  ------------------
  260|       |			/* Command updates timeout internally */
  261|    175|			return;
  262|    175|		}
  263|      0|		smtp_server_connection_timeout_stop(conn);
  264|      0|		break;
  265|    899|	case SMTP_SERVER_COMMAND_STATE_SUBMITTED_REPLY:
  ------------------
  |  Branch (265:2): [True: 899, False: 102k]
  ------------------
  266|   103k|	case SMTP_SERVER_COMMAND_STATE_READY_TO_REPLY:
  ------------------
  |  Branch (266:2): [True: 102k, False: 1.07k]
  ------------------
  267|   103k|		smtp_server_connection_timeout_stop(conn);
  268|   103k|		break;
  269|      0|	case SMTP_SERVER_COMMAND_STATE_FINISHED:
  ------------------
  |  Branch (269:2): [True: 0, False: 103k]
  ------------------
  270|      0|	case SMTP_SERVER_COMMAND_STATE_ABORTED:
  ------------------
  |  Branch (270:2): [True: 0, False: 103k]
  ------------------
  271|      0|		i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
  272|   103k|	}
  273|   103k|}

smtp-server-command.c:smtp_server_command_is_complete:
  275|   115k|{
  276|   115k|	struct smtp_server_connection *conn = cmd->context.conn;
  277|       |
  278|   115k|	return (conn->input_broken || (cmd->next != NULL) || cmd->reply_early ||
  ------------------
  |  Branch (278:10): [True: 0, False: 115k]
  |  Branch (278:32): [True: 0, False: 115k]
  |  Branch (278:55): [True: 0, False: 115k]
  ------------------
  279|   115k|		!smtp_server_connection_pending_command_data(conn));
  ------------------
  |  Branch (279:3): [True: 112k, False: 3.11k]
  ------------------
  280|   115k|}

smtp_server_recipient_create:
   55|  12.1k|{
   56|  12.1k|	struct smtp_server_recipient_private *prcpt;
   57|  12.1k|	pool_t pool;
   58|       |
   59|  12.1k|	pool = pool_alloconly_create("smtp server recipient", 512);
   60|  12.1k|	prcpt = p_new(pool, struct smtp_server_recipient_private, 1);
  ------------------
  |  |   97|  12.1k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|  12.1k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|  12.1k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|  12.1k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  12.1k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   61|  12.1k|	prcpt->refcount = 1;
   62|  12.1k|	prcpt->rcpt.pool = pool;
   63|  12.1k|	prcpt->rcpt.conn = cmd->conn;
   64|  12.1k|	prcpt->rcpt.cmd = cmd;
   65|  12.1k|	prcpt->rcpt.path = smtp_address_clone(pool, rcpt_to);
   66|  12.1k|	smtp_params_rcpt_copy(pool, &prcpt->rcpt.params, params);
   67|       |
   68|  12.1k|	smtp_server_recipient_create_event(prcpt);
   69|       |
   70|  12.1k|	return &prcpt->rcpt;
   71|  12.1k|}
smtp_server_recipient_ref:
   74|  15.0k|{
   75|  15.0k|	struct smtp_server_recipient_private *prcpt =
   76|  15.0k|		(struct smtp_server_recipient_private *)rcpt;
   77|       |
   78|  15.0k|	if (prcpt->destroying)
  ------------------
  |  Branch (78:6): [True: 0, False: 15.0k]
  ------------------
   79|      0|		return;
   80|  15.0k|	i_assert(prcpt->refcount > 0);
  ------------------
  |  |  219|  15.0k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  15.0k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  15.0k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  15.0k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 15.0k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 15.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  15.0k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  15.0k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  15.0k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|  15.0k|	prcpt->refcount++;
   82|  15.0k|}
smtp_server_recipient_unref:
   85|  39.3k|{
   86|  39.3k|	struct smtp_server_recipient *rcpt = *_rcpt;
   87|  39.3k|	struct smtp_server_recipient_private *prcpt =
   88|  39.3k|		(struct smtp_server_recipient_private *)rcpt;
   89|       |
   90|  39.3k|	*_rcpt = NULL;
   91|       |
   92|  39.3k|	if (rcpt == NULL)
  ------------------
  |  Branch (92:6): [True: 12.1k, False: 27.2k]
  ------------------
   93|  12.1k|		return FALSE;
  ------------------
  |  |   11|  12.1k|#  define FALSE (!1)
  ------------------
   94|  27.2k|	if (prcpt->destroying)
  ------------------
  |  Branch (94:6): [True: 0, False: 27.2k]
  ------------------
   95|      0|		return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
   96|       |
   97|  27.2k|	i_assert(prcpt->refcount > 0);
  ------------------
  |  |  219|  27.2k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  27.2k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  27.2k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  27.2k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 27.2k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 27.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  27.2k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  27.2k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  27.2k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   98|  27.2k|	if (--prcpt->refcount > 0)
  ------------------
  |  Branch (98:6): [True: 15.0k, False: 12.1k]
  ------------------
   99|  15.0k|		return TRUE;
  ------------------
  |  |   15|  15.0k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  15.0k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  100|  12.1k|	prcpt->destroying = TRUE;
  ------------------
  |  |   15|  12.1k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  12.1k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  101|       |
  102|  12.1k|	if (!smtp_server_recipient_call_hooks(
  ------------------
  |  Branch (102:6): [True: 0, False: 12.1k]
  ------------------
  103|  12.1k|		&rcpt, SMTP_SERVER_RECIPIENT_HOOK_DESTROY))
  104|      0|		i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
  105|       |
  106|  12.1k|	if (!rcpt->finished) {
  ------------------
  |  Branch (106:6): [True: 8.35k, False: 3.84k]
  ------------------
  107|  8.35k|		smtp_server_recipient_create_event(prcpt);
  108|       |
  109|  8.35k|		struct event_passthrough *e =
  110|  8.35k|			event_create_passthrough(rcpt->event)->
  ------------------
  |  |  176|  8.35k|	event_create_passthrough((parent), __FILE__, __LINE__)
  ------------------
  111|  8.35k|			set_name("smtp_server_transaction_rcpt_finished");
  112|  8.35k|		e->add_int("status_code", 9000);
  113|  8.35k|		e->add_str("enhanced_code", "9.0.0");
  114|  8.35k|		e->add_str("error", "Aborted");
  115|       |
  116|  8.35k|		e_debug(e->event(), "Aborted");
  ------------------
  |  |   61|  8.35k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  8.35k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  8.35k|	struct event *_tmp_event = (_event); \
  |  |   63|  8.35k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  8.35k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  8.35k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 8.35k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  8.35k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  8.35k|	else \
  |  |   66|  8.35k|		event_send_abort(_tmp_event); \
  |  |   67|  8.35k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  8.35k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  117|  8.35k|	}
  118|       |
  119|  12.1k|	event_unref(&rcpt->event);
  120|  12.1k|	pool_unref(&rcpt->pool);
  121|  12.1k|	return FALSE;
  ------------------
  |  |   11|  12.1k|#  define FALSE (!1)
  ------------------
  122|  12.1k|}
smtp_server_recipient_destroy:
  125|  24.3k|{
  126|  24.3k|	smtp_server_recipient_unref(_rcpt);
  127|  24.3k|}
smtp_server_recipient_approved:
  138|  12.1k|{
  139|  12.1k|	struct smtp_server_recipient *rcpt = *_rcpt;
  140|  12.1k|	struct smtp_server_transaction *trans = rcpt->conn->state.trans;
  141|       |
  142|  12.1k|	i_assert(trans != NULL);
  ------------------
  |  |  219|  12.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  12.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  12.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  12.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 12.1k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 12.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  12.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  12.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  143|  12.1k|	i_assert(rcpt->event != NULL);
  ------------------
  |  |  219|  12.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  12.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  12.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  12.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 12.1k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 12.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  12.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  12.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  144|       |
  145|  12.1k|	e_debug(rcpt->event, "Approved");
  ------------------
  |  |   61|  12.1k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  12.1k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  12.1k|	struct event *_tmp_event = (_event); \
  |  |   63|  12.1k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  12.1k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  12.1k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 12.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  12.1k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  12.1k|	else \
  |  |   66|  12.1k|		event_send_abort(_tmp_event); \
  |  |   67|  12.1k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  146|       |
  147|  12.1k|	rcpt->cmd = NULL;
  148|  12.1k|	smtp_server_transaction_add_rcpt(trans, rcpt);
  149|       |
  150|  12.1k|	return smtp_server_recipient_call_hooks(
  151|  12.1k|		_rcpt, SMTP_SERVER_RECIPIENT_HOOK_APPROVED);
  152|  12.1k|}
smtp_server_recipient_data_command:
  172|  50.3k|{
  173|  50.3k|	rcpt->cmd = cmd;
  174|  50.3k|}
smtp_server_recipient_data_replied:
  177|  6.40k|{
  178|  6.40k|	if (rcpt->replied)
  ------------------
  |  Branch (178:6): [True: 3.50k, False: 2.89k]
  ------------------
  179|  3.50k|		return;
  180|  2.89k|	if (smtp_server_recipient_get_reply(rcpt) == NULL)
  ------------------
  |  Branch (180:6): [True: 0, False: 2.89k]
  ------------------
  181|      0|		return;
  182|  2.89k|	rcpt->replied = TRUE;
  ------------------
  |  |   15|  2.89k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  2.89k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  183|  2.89k|	if (!smtp_server_recipient_call_hooks(
  ------------------
  |  Branch (183:6): [True: 0, False: 2.89k]
  ------------------
  184|  2.89k|		&rcpt, SMTP_SERVER_RECIPIENT_HOOK_DATA_REPLIED)) {
  185|       |		/* Nothing to do */
  186|      0|	}
  187|  2.89k|}
smtp_server_recipient_get_reply:
  191|  2.89k|{
  192|  2.89k|	if (!HAS_ALL_BITS(rcpt->trans->flags,
  ------------------
  |  |   18|  2.89k|#define HAS_ALL_BITS(val,bits) ((~(val) & (bits)) == 0)
  ------------------
  |  Branch (192:6): [True: 2.89k, False: 0]
  ------------------
  193|  2.89k|			 SMTP_SERVER_TRANSACTION_FLAG_REPLY_PER_RCPT))
  194|  2.89k|		return smtp_server_command_get_reply(rcpt->cmd->cmd, 0);
  195|      0|	return smtp_server_command_get_reply(rcpt->cmd->cmd, rcpt->index);
  196|  2.89k|}
smtp_server_recipient_replyv:
  208|  12.1k|{
  209|  12.1k|	i_assert(rcpt->cmd != NULL);
  ------------------
  |  |  219|  12.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  12.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  12.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  12.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 12.1k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 12.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  12.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  12.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|       |
  211|  12.1k|	if (smtp_server_command_is_rcpt(rcpt->cmd) && (status / 100) == 2) {
  ------------------
  |  Branch (211:6): [True: 12.1k, False: 0]
  |  Branch (211:48): [True: 12.1k, False: 0]
  ------------------
  212|  12.1k|		smtp_server_reply_indexv(rcpt->cmd, rcpt->index,
  213|  12.1k|					 status, enh_code, fmt, args);
  214|  12.1k|		return;
  215|  12.1k|	}
  216|       |
  217|      0|	smtp_server_reply_index(rcpt->cmd, rcpt->index, status, enh_code,
  218|      0|				"<%s> %s", smtp_address_encode(rcpt->path),
  219|      0|				t_strdup_vprintf(fmt, args));
  220|      0|}
smtp_server_recipient_reply:
  225|  12.1k|{
  226|  12.1k|	va_list args;
  227|       |
  228|  12.1k|	va_start(args, fmt);
  229|  12.1k|	smtp_server_recipient_replyv(rcpt, status, enh_code, fmt, args);
  230|  12.1k|	va_end(args);
  231|  12.1k|}
smtp_server_recipient_reset:
  247|  1.42k|{
  248|  1.42k|	i_assert(!rcpt->finished);
  ------------------
  |  |  219|  1.42k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  1.42k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  1.42k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  1.42k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1.42k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1.42k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  1.42k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  1.42k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.42k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  249|  1.42k|	rcpt->finished = TRUE;
  ------------------
  |  |   15|  1.42k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  1.42k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  250|       |
  251|  1.42k|	struct event_passthrough *e =
  252|  1.42k|		event_create_passthrough(rcpt->event)->
  ------------------
  |  |  176|  1.42k|	event_create_passthrough((parent), __FILE__, __LINE__)
  ------------------
  253|  1.42k|		set_name("smtp_server_transaction_rcpt_finished");
  254|  1.42k|	e->add_int("status_code", 9000);
  255|  1.42k|	e->add_str("enhanced_code", "9.0.0");
  256|  1.42k|	e->add_str("error", "Reset");
  257|       |
  258|  1.42k|	e_debug(e->event(), "Reset");
  ------------------
  |  |   61|  1.42k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  1.42k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  1.42k|	struct event *_tmp_event = (_event); \
  |  |   63|  1.42k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  1.42k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  1.42k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 1.42k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  1.42k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  1.42k|	else \
  |  |   66|  1.42k|		event_send_abort(_tmp_event); \
  |  |   67|  1.42k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.42k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  259|  1.42k|}
smtp_server_recipient_finished:
  263|  2.42k|{
  264|  2.42k|	i_assert(!rcpt->finished);
  ------------------
  |  |  219|  2.42k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  2.42k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  2.42k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  2.42k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 2.42k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 2.42k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  2.42k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  2.42k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  2.42k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  265|  2.42k|	rcpt->finished = TRUE;
  ------------------
  |  |   15|  2.42k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  2.42k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  266|       |
  267|  2.42k|	struct event_passthrough *e =
  268|  2.42k|		event_create_passthrough(rcpt->event)->
  ------------------
  |  |  176|  2.42k|	event_create_passthrough((parent), __FILE__, __LINE__)
  ------------------
  269|  2.42k|		set_name("smtp_server_transaction_rcpt_finished");
  270|  2.42k|	smtp_server_reply_add_to_event(reply, e);
  271|       |
  272|  2.42k|	e_debug(e->event(), "Finished");
  ------------------
  |  |   61|  2.42k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  2.42k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  2.42k|	struct event *_tmp_event = (_event); \
  |  |   63|  2.42k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  2.42k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  2.42k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 2.42k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  2.42k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  2.42k|	else \
  |  |   66|  2.42k|		event_send_abort(_tmp_event); \
  |  |   67|  2.42k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  2.42k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  273|  2.42k|}
smtp_server_recipient_call_hooks:
  332|  27.2k|{
  333|  27.2k|	struct smtp_server_recipient *rcpt = *_rcpt;
  334|  27.2k|	struct smtp_server_recipient_private *prcpt =
  335|  27.2k|		(struct smtp_server_recipient_private *)rcpt;
  336|  27.2k|	struct smtp_server_recipient_hook *hook;
  337|       |
  338|  27.2k|	if (type != SMTP_SERVER_RECIPIENT_HOOK_DESTROY)
  ------------------
  |  Branch (338:6): [True: 15.0k, False: 12.1k]
  ------------------
  339|  15.0k|		smtp_server_recipient_ref(rcpt);
  340|       |
  341|  27.2k|	hook = prcpt->hooks_head;
  342|  27.2k|	while (hook != NULL) {
  ------------------
  |  Branch (342:9): [True: 0, False: 27.2k]
  ------------------
  343|      0|		struct smtp_server_recipient_hook *hook_next = hook->next;
  344|       |
  345|      0|		if (hook->type == type) {
  ------------------
  |  Branch (345:7): [True: 0, False: 0]
  ------------------
  346|      0|			DLLIST2_REMOVE(&prcpt->hooks_head, &prcpt->hooks_tail,
  ------------------
  |  |   79|      0|	DLLIST2_REMOVE_FULL(head, tail, item, prev, next)
  |  |  ------------------
  |  |  |  |   65|      0|#define DLLIST2_REMOVE_FULL(head, tail, item, prev, next) STMT_START { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|      0|#  define STMT_START do
  |  |  |  |  ------------------
  |  |  |  |   66|      0|	if ((item)->prev != NULL) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   67|      0|		(item)->prev->next = (item)->next; \
  |  |  |  |   68|      0|	else if (*(head) == item) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (68:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   69|      0|		*(head) = (item)->next; \
  |  |  |  |   70|      0|	if ((item)->next != NULL) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (70:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   71|      0|		(item)->next->prev = (item)->prev; \
  |  |  |  |   72|      0|		(item)->next = NULL; \
  |  |  |  |   73|      0|	} else if ((*tail) == item) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (73:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   74|      0|		*(tail) = (item)->prev; \
  |  |  |  |   75|      0|	(item)->prev = NULL; \
  |  |  |  |   76|      0|	} STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  347|      0|				       hook);
  348|      0|			hook->func(rcpt, hook->context);
  349|      0|		}
  350|       |
  351|      0|		hook = hook_next;
  352|      0|	}
  353|       |
  354|  27.2k|	if (type != SMTP_SERVER_RECIPIENT_HOOK_DESTROY) {
  ------------------
  |  Branch (354:6): [True: 15.0k, False: 12.1k]
  ------------------
  355|  15.0k|		if (!smtp_server_recipient_unref(&rcpt)) {
  ------------------
  |  Branch (355:7): [True: 0, False: 15.0k]
  ------------------
  356|      0|			*_rcpt = NULL;
  357|      0|			return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  358|      0|		}
  359|  15.0k|	}
  360|  27.2k|	return TRUE;
  ------------------
  |  |   15|  27.2k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  27.2k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  361|  27.2k|}
smtp-server-recipient.c:smtp_server_recipient_create_event:
   25|  20.5k|{
   26|  20.5k|	struct smtp_server_recipient *rcpt = &prcpt->rcpt;
   27|  20.5k|	struct smtp_server_connection *conn = rcpt->conn;
   28|       |
   29|  20.5k|	if (rcpt->event != NULL)
  ------------------
  |  Branch (29:6): [True: 8.35k, False: 12.1k]
  ------------------
   30|  8.35k|		return;
   31|       |
   32|  12.1k|	if (conn->state.trans == NULL) {
  ------------------
  |  Branch (32:6): [True: 5.54k, False: 6.64k]
  ------------------
   33|       |		/* Create event for the transaction early. */
   34|  5.54k|		if (conn->next_trans_event == NULL) {
  ------------------
  |  Branch (34:7): [True: 2.72k, False: 2.82k]
  ------------------
   35|  2.72k|			conn->next_trans_event = event_create(conn->event);
  ------------------
  |  |  156|  2.72k|	event_create((parent), __FILE__, __LINE__)
  ------------------
   36|  2.72k|			event_set_append_log_prefix(conn->next_trans_event,
   37|  2.72k|						    "trans: ");
   38|  2.72k|		}
   39|  5.54k|		rcpt->event = event_create(conn->next_trans_event);
  ------------------
  |  |  156|  5.54k|	event_create((parent), __FILE__, __LINE__)
  ------------------
   40|  6.64k|	} else {
   41|       |		/* Use existing transaction event. */
   42|  6.64k|		rcpt->event = event_create(conn->state.trans->event);
  ------------------
  |  |  156|  6.64k|	event_create((parent), __FILE__, __LINE__)
  ------------------
   43|  6.64k|	}
   44|       |	/* Drop transaction log prefix so that the connection event prefix
   45|       |	   remains. */
   46|  12.1k|	event_drop_parent_log_prefixes(rcpt->event, 1);
   47|       |
   48|  12.1k|	smtp_server_recipient_update_event(prcpt);
   49|  12.1k|}
smtp-server-recipient.c:smtp_server_recipient_update_event:
   13|  12.1k|{
   14|  12.1k|	struct event *event = prcpt->rcpt.event;
   15|  12.1k|	const char *path = smtp_address_encode(prcpt->rcpt.path);
   16|       |
   17|  12.1k|	event_add_str(event, "rcpt_to", path);
   18|  12.1k|	smtp_params_rcpt_add_to_event(&prcpt->rcpt.params, event);
   19|  12.1k|	event_set_append_log_prefix(
   20|  12.1k|		event, t_strdup_printf("rcpt %s: ", str_sanitize(path, 128)));
   21|  12.1k|}

smtp_server_reply_set_status:
  146|   116k|{
  147|   116k|	pool_t pool = reply->command->context.pool;
  148|       |
  149|       |	/* RFC 5321, Section 4.2:
  150|       |
  151|       |	   In the absence of extensions negotiated with the client, SMTP servers
  152|       |	   MUST NOT send reply codes whose first digits are other than 2, 3, 4,
  153|       |	   or 5.  Clients that receive such out-of-range codes SHOULD normally
  154|       |	   treat them as fatal errors and terminate the mail transaction.
  155|       |	 */
  156|   116k|	i_assert(status >= 200 && status < 560);
  ------------------
  |  |  219|   116k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   116k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   116k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   233k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 116k]
  |  |  |  |  |  Branch (202:45): [True: 116k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 116k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   116k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   116k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   116k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  157|       |
  158|       |	/* RFC 2034, Section 4:
  159|       |
  160|       |	   All status codes returned by the server must agree with the primary
  161|       |	   response code, that is, a 2xx response must incorporate a 2.X.X code,
  162|       |	   a 4xx response must incorporate a 4.X.X code, and a 5xx response must
  163|       |	   incorporate a 5.X.X code.
  164|       |	 */
  165|   116k|	i_assert(enh_code == NULL || *enh_code == '\0' ||
  ------------------
  |  |  219|   116k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   116k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   116k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   678k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 116k]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 116k]
  |  |  |  |  |  Branch (202:45): [True: 7.90k, False: 109k]
  |  |  |  |  |  Branch (202:45): [True: 109k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 109k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   116k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   116k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   116k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  166|   116k|		((unsigned int)(enh_code[0] - '0') == (status / 100)
  167|   116k|			&& enh_code[1] == '.'));
  168|       |
  169|   116k|	if (reply->content->status == status &&
  ------------------
  |  Branch (169:6): [True: 0, False: 116k]
  ------------------
  170|   116k|	    null_strcmp(reply->content->enhanced_code, enh_code) == 0)
  ------------------
  |  Branch (170:6): [True: 0, False: 0]
  ------------------
  171|      0|		return;
  172|       |
  173|   116k|	smtp_server_reply_update_prefix(reply, status, enh_code);
  174|   116k|	reply->content->status = status;
  175|   116k|	reply->content->enhanced_code = p_strdup(pool, enh_code);
  176|   116k|}
smtp_server_reply_create_index:
  190|   116k|{
  191|   116k|	struct smtp_server_reply *reply;
  192|   116k|	pool_t pool = cmd->context.pool;
  193|       |
  194|   116k|	i_assert(cmd->replies_expected > 0);
  ------------------
  |  |  219|   116k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   116k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   116k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   116k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 116k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 116k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   116k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   116k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   116k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|   116k|	i_assert(index < cmd->replies_expected);
  ------------------
  |  |  219|   116k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   116k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   116k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   116k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 116k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 116k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   116k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   116k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   116k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  196|       |
  197|   116k|	reply = smtp_server_reply_alloc(cmd, index);
  198|   116k|	reply->index = index;
  199|   116k|	reply->command = cmd;
  200|       |
  201|   116k|	if (reply->content == NULL)
  ------------------
  |  Branch (201:6): [True: 115k, False: 1.23k]
  ------------------
  202|   115k|		reply->content = p_new(pool, struct smtp_server_reply_content, 1);
  ------------------
  |  |   97|   115k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|   115k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|   115k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|   115k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|   115k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  203|   116k|	smtp_server_reply_set_status(reply, status, enh_code);
  204|   116k|	reply->content->text = str_new(default_pool, 256);
  205|       |
  206|   116k|	smtp_server_reply_update_event(reply);
  207|       |
  208|   116k|	return reply;
  209|   116k|}
smtp_server_reply_create:
  214|  7.33k|{
  215|  7.33k|	return smtp_server_reply_create_index(cmd, 0, status, enh_code);
  216|  7.33k|}
smtp_server_reply_free:
  260|   120k|{
  261|   120k|	unsigned int i;
  262|       |
  263|   120k|	if (!array_is_created(&cmd->replies))
  ------------------
  |  |  176|   120k|	array_is_created_i(&(array)->arr)
  ------------------
  |  Branch (263:6): [True: 1.24k, False: 118k]
  ------------------
  264|  1.24k|		return;
  265|       |
  266|   237k|	for (i = 0; i < cmd->replies_expected; i++) {
  ------------------
  |  Branch (266:14): [True: 118k, False: 118k]
  ------------------
  267|   118k|		struct smtp_server_reply *reply =
  268|   118k|			array_idx_modifiable(&cmd->replies, i);
  ------------------
  |  |  312|   118k|	ARRAY_TYPE_CAST_MODIFIABLE(array) \
  |  |  ------------------
  |  |  |  |   54|   118k|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  |  |  313|   118k|		array_idx_modifiable_i(&(array)->arr, idx)
  ------------------
  269|   118k|		smtp_server_reply_destroy(reply);
  270|   118k|	}
  271|   118k|}
smtp_server_reply_add_text:
  275|   109k|{
  276|   109k|	string_t *textbuf = reply->content->text;
  277|       |
  278|   109k|	i_assert(!reply->submitted);
  ------------------
  |  |  219|   109k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   109k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   109k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   109k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 109k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 109k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   109k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   109k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   109k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  279|       |
  280|   109k|	if (*text == '\0')
  ------------------
  |  Branch (280:6): [True: 0, False: 109k]
  ------------------
  281|      0|		return;
  282|       |
  283|   109k|	do {
  284|   109k|		const char *p;
  285|       |
  286|   109k|		reply->content->last_line = str_len(textbuf);
  287|       |
  288|   109k|		p = strchr(text, '\n');
  289|   109k|		str_append(textbuf, reply->content->status_prefix);
  290|   109k|		if (p == NULL) {
  ------------------
  |  Branch (290:7): [True: 109k, False: 0]
  ------------------
  291|   109k|			str_append(textbuf, text);
  292|   109k|			text = NULL;
  293|   109k|		} else {
  294|      0|			if (p > text && *(p-1) == '\r')
  ------------------
  |  Branch (294:8): [True: 0, False: 0]
  |  Branch (294:20): [True: 0, False: 0]
  ------------------
  295|      0|				str_append_data(textbuf, text, p - text - 1);
  296|      0|			else
  297|      0|				str_append_data(textbuf, text, p - text);
  298|      0|			text = p + 1;
  299|      0|		}
  300|   109k|		str_append(textbuf, "\r\n");
  301|   109k|	} while (text != NULL && *text != '\0');
  ------------------
  |  Branch (301:11): [True: 0, False: 109k]
  |  Branch (301:27): [True: 0, False: 0]
  ------------------
  302|   109k|}
smtp_server_reply_submit:
  398|   116k|{
  399|   116k|	i_assert(!reply->submitted);
  ------------------
  |  |  219|   116k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   116k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   116k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   116k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 116k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 116k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   116k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   116k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   116k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  400|   116k|	i_assert(reply->content != NULL);
  ------------------
  |  |  219|   116k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   116k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   116k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   116k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 116k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 116k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   116k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   116k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   116k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  401|   116k|	i_assert(str_len(reply->content->text) >= 5);
  ------------------
  |  |  219|   116k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   116k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   116k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   116k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 116k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 116k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   116k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   116k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   116k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  402|   116k|	e_debug(reply->event, "Submitted");
  ------------------
  |  |   61|   116k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|   116k|#  define STMT_START do
  |  |  ------------------
  |  |   62|   116k|	struct event *_tmp_event = (_event); \
  |  |   63|   116k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|   116k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   116k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 116k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|   116k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|   116k|	else \
  |  |   66|   116k|		event_send_abort(_tmp_event); \
  |  |   67|   116k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|   116k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  403|       |
  404|   116k|	reply->command->replies_submitted++;
  405|   116k|	reply->submitted = TRUE;
  ------------------
  |  |   15|   116k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   116k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  406|   116k|	smtp_server_command_submit_reply(reply->command);
  407|   116k|}
smtp_server_reply_indexv:
  438|   108k|{
  439|   108k|	struct smtp_server_command *cmd = _cmd->cmd;
  440|   108k|	struct smtp_server_reply *reply;
  441|       |
  442|   108k|	reply = smtp_server_reply_create_index(cmd, index, status, enh_code);
  443|   108k|	smtp_server_reply_add_text(reply, t_strdup_vprintf(fmt, args));
  444|   108k|	smtp_server_reply_submit(reply);
  445|   108k|}
smtp_server_reply:
  449|  56.0k|{
  450|  56.0k|	struct smtp_server_command *cmd = _cmd->cmd;
  451|  56.0k|	va_list args;
  452|       |
  453|  56.0k|	i_assert(cmd->replies_expected <= 1);
  ------------------
  |  |  219|  56.0k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  56.0k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  56.0k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  56.0k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 56.0k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 56.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  56.0k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  56.0k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  56.0k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  454|       |
  455|  56.0k|	va_start(args, fmt);
  456|  56.0k|	smtp_server_reply_indexv(_cmd, 0, status, enh_code, fmt, args);
  457|  56.0k|	va_end(args);
  458|  56.0k|}
smtp_server_reply_all:
  528|  1.24k|{
  529|  1.24k|	va_list args;
  530|       |
  531|  1.24k|	va_start(args, fmt);
  532|  1.24k|	smtp_server_reply_allv(_cmd, status, enh_code, fmt, args);
  533|  1.24k|	va_end(args);
  534|  1.24k|}
smtp_server_reply_quit:
  550|     83|{
  551|     83|	struct smtp_server_command *cmd = _cmd->cmd;
  552|     83|	struct smtp_server_reply *reply;
  553|       |
  554|     83|	reply = smtp_server_reply_create(cmd, 221, "2.0.0");
  555|     83|	smtp_server_reply_add_text(reply, "Bye");
  556|     83|	smtp_server_reply_submit(reply);
  557|     83|}
smtp_server_reply_get_message:
  610|  70.1k|{
  611|  70.1k|	string_t *str = t_str_new(256);
  612|       |
  613|  70.1k|	smtp_server_reply_write_one_line(reply, str, TRUE);
  ------------------
  |  |   15|  70.1k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  70.1k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  614|  70.1k|	return str_c(str);
  615|  70.1k|}
smtp_server_reply_send:
  651|   112k|{
  652|   112k|	int ret;
  653|       |
  654|   112k|	if (reply->sent)
  ------------------
  |  Branch (654:6): [True: 0, False: 112k]
  ------------------
  655|      0|		return 0;
  656|       |
  657|   112k|	T_BEGIN {
  ------------------
  |  |   68|   112k|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|   112k|#  define STMT_START do
  |  |  ------------------
  |  |   69|   112k|		data_stack_frame_t _data_stack_cur_id = t_push(__FILE__ ":" T_XSTRING(__LINE__));
  |  |  ------------------
  |  |  |  |   66|   112k|#define T_XSTRING(x)	T_STRING(x)	/* expand and then stringify */
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|   112k|#define T_STRING(x)	#x
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  658|   112k|		ret = smtp_server_reply_send_real(reply);
  659|   112k|	} T_END;
  ------------------
  |  |   71|   112k|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|   112k|#  define STMT_START do
  |  |  ------------------
  |  |   72|   112k|		if (unlikely(!t_pop(&_data_stack_cur_id))) \
  |  |  ------------------
  |  |  |  |  202|   112k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 112k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 112k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   73|   112k|			i_panic("Leaked t_pop() call"); \
  |  |   74|   112k|	} STMT_END; \
  |  |  ------------------
  |  |  |  |   64|   112k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   75|   112k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|   112k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  660|       |
  661|   112k|	reply->sent = TRUE;
  ------------------
  |  |   15|   112k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   112k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  662|   112k|	return ret;
  663|   112k|}
smtp_server_reply_is_success:
  666|   213k|{
  667|   213k|	i_assert(reply->content != NULL);
  ------------------
  |  |  219|   213k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   213k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   213k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   213k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 213k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 213k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   213k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   213k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   213k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  668|   213k|	return (reply->content->status / 100 == 2);
  669|   213k|}
smtp_server_reply_add_to_event:
  673|   116k|{
  674|   116k|	i_assert(reply->content != NULL);
  ------------------
  |  |  219|   116k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   116k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   116k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   116k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 116k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 116k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   116k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   116k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   116k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  675|   116k|	e->add_int("status_code", reply->content->status);
  676|   116k|	if (reply->content->enhanced_code != NULL &&
  ------------------
  |  Branch (676:6): [True: 116k, False: 0]
  ------------------
  677|   116k|	    reply->content->enhanced_code[0] != '\0')
  ------------------
  |  Branch (677:6): [True: 108k, False: 7.90k]
  ------------------
  678|   108k|		e->add_str("enhanced_code", reply->content->enhanced_code);
  679|   116k|	if (!smtp_server_reply_is_success(reply))
  ------------------
  |  Branch (679:6): [True: 70.1k, False: 46.1k]
  ------------------
  680|  70.1k|		e->add_str("error", smtp_server_reply_get_message(reply));
  681|   116k|}
smtp_server_reply_create_ehlo:
  689|  7.24k|{
  690|  7.24k|	struct smtp_server_connection *conn = cmd->context.conn;
  691|  7.24k|	struct smtp_server_reply *reply;
  692|  7.24k|	string_t *textbuf;
  693|       |
  694|  7.24k|	reply = smtp_server_reply_create(cmd, 250, "");
  695|  7.24k|	textbuf = reply->content->text;
  696|  7.24k|	str_append(textbuf, reply->content->status_prefix);
  697|  7.24k|	str_append(textbuf, conn->set.hostname);
  698|  7.24k|	str_append(textbuf, "\r\n");
  699|       |
  700|  7.24k|	return reply;
  701|  7.24k|}
smtp_server_reply_ehlo_add:
  705|  32.2k|{
  706|  32.2k|	string_t *textbuf;
  707|       |
  708|  32.2k|	i_assert(!reply->submitted);
  ------------------
  |  |  219|  32.2k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  32.2k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  32.2k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  32.2k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 32.2k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 32.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  32.2k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  32.2k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  32.2k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  709|  32.2k|	i_assert(reply->content != NULL);
  ------------------
  |  |  219|  32.2k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  32.2k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  32.2k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  32.2k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 32.2k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 32.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  32.2k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  32.2k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  32.2k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  710|  32.2k|	textbuf = reply->content->text;
  711|       |
  712|  32.2k|	reply->content->last_line = str_len(textbuf);
  713|  32.2k|	str_append(textbuf, reply->content->status_prefix);
  714|  32.2k|	str_append(textbuf, keyword);
  715|  32.2k|	str_append(textbuf, "\r\n");
  716|  32.2k|}
smtp_server_reply_ehlo_add_8bitmime:
  765|  6.45k|{
  766|  6.45k|	struct smtp_server_cmd_ctx *cmd = &reply->command->context;
  767|  6.45k|	struct smtp_server_connection *conn = cmd->conn;
  768|  6.45k|	enum smtp_capability caps = conn->set.capabilities;
  769|       |
  770|  6.45k|	if ((caps & SMTP_CAPABILITY_8BITMIME) == 0)
  ------------------
  |  Branch (770:6): [True: 0, False: 6.45k]
  ------------------
  771|      0|		return;
  772|  6.45k|	smtp_server_reply_ehlo_add(reply, "8BITMIME");
  773|  6.45k|}
smtp_server_reply_ehlo_add_binarymime:
  776|  6.45k|{
  777|  6.45k|	struct smtp_server_cmd_ctx *cmd = &reply->command->context;
  778|  6.45k|	struct smtp_server_connection *conn = cmd->conn;
  779|  6.45k|	enum smtp_capability caps = conn->set.capabilities;
  780|       |
  781|  6.45k|	if ((caps & SMTP_CAPABILITY_BINARYMIME) == 0 ||
  ------------------
  |  Branch (781:6): [True: 6.45k, False: 0]
  ------------------
  782|  6.45k|	    (caps & SMTP_CAPABILITY_CHUNKING) == 0)
  ------------------
  |  Branch (782:6): [True: 0, False: 0]
  ------------------
  783|  6.45k|		return;
  784|      0|	smtp_server_reply_ehlo_add(reply, "BINARYMIME");
  785|      0|}
smtp_server_reply_ehlo_add_chunking:
  788|  6.45k|{
  789|  6.45k|	struct smtp_server_cmd_ctx *cmd = &reply->command->context;
  790|  6.45k|	struct smtp_server_connection *conn = cmd->conn;
  791|  6.45k|	enum smtp_capability caps = conn->set.capabilities;
  792|       |
  793|  6.45k|	if ((caps & SMTP_CAPABILITY_CHUNKING) == 0)
  ------------------
  |  Branch (793:6): [True: 0, False: 6.45k]
  ------------------
  794|      0|		return;
  795|  6.45k|	smtp_server_reply_ehlo_add(reply, "CHUNKING");
  796|  6.45k|}
smtp_server_reply_ehlo_add_dsn:
  799|  6.45k|{
  800|  6.45k|	struct smtp_server_cmd_ctx *cmd = &reply->command->context;
  801|  6.45k|	struct smtp_server_connection *conn = cmd->conn;
  802|  6.45k|	enum smtp_capability caps = conn->set.capabilities;
  803|       |
  804|  6.45k|	if ((caps & SMTP_CAPABILITY_DSN) == 0)
  ------------------
  |  Branch (804:6): [True: 6.45k, False: 0]
  ------------------
  805|  6.45k|		return;
  806|      0|	smtp_server_reply_ehlo_add(reply, "DSN");
  807|      0|}
smtp_server_reply_ehlo_add_enhancedstatuscodes:
  811|  6.45k|{
  812|  6.45k|	struct smtp_server_cmd_ctx *cmd = &reply->command->context;
  813|  6.45k|	struct smtp_server_connection *conn = cmd->conn;
  814|  6.45k|	enum smtp_capability caps = conn->set.capabilities;
  815|       |
  816|  6.45k|	if ((caps & SMTP_CAPABILITY_ENHANCEDSTATUSCODES) == 0)
  ------------------
  |  Branch (816:6): [True: 0, False: 6.45k]
  ------------------
  817|      0|		return;
  818|  6.45k|	smtp_server_reply_ehlo_add(reply, "ENHANCEDSTATUSCODES");
  819|  6.45k|}
smtp_server_reply_ehlo_add_pipelining:
  822|  6.45k|{
  823|  6.45k|	smtp_server_reply_ehlo_add(reply, "PIPELINING");
  824|  6.45k|}
smtp_server_reply_ehlo_add_size:
  827|  6.45k|{
  828|  6.45k|	struct smtp_server_cmd_ctx *cmd = &reply->command->context;
  829|  6.45k|	struct smtp_server_connection *conn = cmd->conn;
  830|  6.45k|	enum smtp_capability caps = conn->set.capabilities;
  831|  6.45k|	uoff_t cap_size = conn->set.max_message_size;
  832|       |
  833|  6.45k|	if ((caps & SMTP_CAPABILITY_SIZE) == 0)
  ------------------
  |  Branch (833:6): [True: 0, False: 6.45k]
  ------------------
  834|      0|		return;
  835|       |
  836|  6.45k|	if (cap_size > 0 && cap_size != UOFF_T_MAX) {
  ------------------
  |  |  846|      0|#define UOFF_T_MAX ULONG_MAX
  ------------------
  |  Branch (836:6): [True: 0, False: 6.45k]
  |  Branch (836:22): [True: 0, False: 0]
  ------------------
  837|      0|		smtp_server_reply_ehlo_add_param(reply,
  838|      0|			"SIZE", "%"PRIuUOFF_T, cap_size);
  ------------------
  |  |  789|      0|#define PRIuUOFF_T "lu"
  ------------------
  839|  6.45k|	} else {
  840|  6.45k|		smtp_server_reply_ehlo_add(reply, "SIZE");
  841|  6.45k|	}
  842|  6.45k|}
smtp_server_reply_ehlo_add_starttls:
  850|  6.45k|{
  851|  6.45k|	struct smtp_server_cmd_ctx *cmd = &reply->command->context;
  852|  6.45k|	struct smtp_server_connection *conn = cmd->conn;
  853|  6.45k|	enum smtp_capability caps = conn->set.capabilities;
  854|       |
  855|  6.45k|	if ((caps & SMTP_CAPABILITY_STARTTLS) == 0)
  ------------------
  |  Branch (855:6): [True: 6.45k, False: 0]
  ------------------
  856|  6.45k|		return;
  857|      0|	smtp_server_reply_ehlo_add(reply, "STARTTLS");
  858|      0|}
smtp_server_reply_ehlo_add_vrfy:
  861|  6.45k|{
  862|  6.45k|	struct smtp_server_cmd_ctx *cmd = &reply->command->context;
  863|  6.45k|	struct smtp_server_connection *conn = cmd->conn;
  864|  6.45k|	enum smtp_capability caps = conn->set.capabilities;
  865|       |
  866|  6.45k|	if ((caps & SMTP_CAPABILITY_VRFY) == 0)
  ------------------
  |  Branch (866:6): [True: 6.45k, False: 0]
  ------------------
  867|  6.45k|		return;
  868|      0|	smtp_server_reply_ehlo_add(reply, "VRFY");
  869|      0|}
smtp_server_reply_ehlo_add_xclient:
  872|  6.45k|{
  873|  6.45k|	static const char *base_fields =
  874|  6.45k|		"ADDR PORT PROTO HELO LOGIN SESSION CLIENT-TRANSPORT TTL TIMEOUT "
  875|  6.45k|		"DESTNAME";
  876|  6.45k|	struct smtp_server_cmd_ctx *cmd = &reply->command->context;
  877|  6.45k|	struct smtp_server_connection *conn = cmd->conn;
  878|       |
  879|  6.45k|	if (!smtp_server_connection_is_trusted(conn))
  ------------------
  |  Branch (879:6): [True: 6.45k, False: 0]
  ------------------
  880|  6.45k|		return;
  881|      0|	if (conn->set.xclient_extensions == NULL ||
  ------------------
  |  Branch (881:6): [True: 0, False: 0]
  ------------------
  882|      0|	    *conn->set.xclient_extensions == NULL) {
  ------------------
  |  Branch (882:6): [True: 0, False: 0]
  ------------------
  883|      0|		smtp_server_reply_ehlo_add_param(reply, "XCLIENT", "%s",
  884|      0|			base_fields);
  885|      0|		return;
  886|      0|	}
  887|       |
  888|      0|	smtp_server_reply_ehlo_add_param(reply, "XCLIENT", "%s",
  889|      0|		t_strconcat(base_fields, " ",
  890|      0|			t_strarray_join(conn->set.xclient_extensions, " "),
  891|      0|			NULL));
  892|      0|}
smtp-server-reply.c:smtp_server_reply_update_prefix:
   87|   116k|{
   88|   116k|	pool_t pool = reply->command->context.pool;
   89|   116k|	string_t *textbuf, *new_text;
   90|   116k|	const char *new_prefix, *text, *p;
   91|   116k|	size_t text_len, prefix_len, line_len;
   92|       |
   93|   116k|	if (enh_code == NULL || *enh_code == '\0') {
  ------------------
  |  Branch (93:6): [True: 0, False: 116k]
  |  Branch (93:26): [True: 7.90k, False: 109k]
  ------------------
   94|  7.90k|		new_prefix = p_strdup_printf(pool, "%03u-", status);
   95|   109k|	} else {
   96|   109k|		new_prefix = p_strdup_printf(pool, "%03u-%s ",
   97|   109k|					     status, enh_code);
   98|   109k|	}
   99|       |
  100|   116k|	i_assert(reply->content != NULL);
  ------------------
  |  |  219|   116k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   116k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   116k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   116k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 116k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 116k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   116k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   116k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   116k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  101|   116k|	textbuf = reply->content->text;
  102|       |
  103|   116k|	if (textbuf == NULL || str_len(textbuf) == 0) {
  ------------------
  |  Branch (103:6): [True: 116k, False: 0]
  |  Branch (103:25): [True: 0, False: 0]
  ------------------
  104|   116k|		reply->content->status_prefix = new_prefix;
  105|   116k|		return;
  106|   116k|	}
  107|      0|	new_text = str_new(default_pool, 256);
  108|       |
  109|      0|	prefix_len = strlen(reply->content->status_prefix);
  110|      0|	text = str_c(textbuf);
  111|      0|	text_len = str_len(textbuf);
  112|       |
  113|      0|	i_assert(text_len > prefix_len);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  114|      0|	text_len -= prefix_len;
  115|      0|	text += prefix_len;
  116|       |
  117|      0|	for (;;) {
  118|      0|		reply->content->last_line = str_len(new_text);
  119|       |
  120|      0|		p = strchr(text, '\n');
  121|      0|		i_assert(p != NULL && p > text && *(p-1) == '\r');
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  122|      0|		p++;
  123|       |
  124|      0|		str_append(new_text, new_prefix);
  125|      0|		str_append_data(new_text, text, p - text);
  126|       |
  127|      0|		line_len = (size_t)(p - text);
  128|      0|		i_assert(text_len >= line_len);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  129|      0|		text_len -= line_len;
  130|      0|		text = p;
  131|       |
  132|      0|		if (text_len <= prefix_len)
  ------------------
  |  Branch (132:7): [True: 0, False: 0]
  ------------------
  133|      0|			break;
  134|       |
  135|      0|		text_len -= prefix_len;
  136|      0|		text += prefix_len;
  137|      0|	}
  138|       |
  139|      0|	str_free(&textbuf);
  140|      0|	reply->content->text = new_text;
  141|      0|	reply->content->status_prefix = new_prefix;
  142|      0|}
smtp-server-reply.c:smtp_server_reply_alloc:
   65|   116k|{
   66|   116k|	struct smtp_server_reply *reply;
   67|   116k|	pool_t pool = cmd->context.pool;
   68|       |
   69|   116k|	if (array_is_created(&cmd->replies)) {
  ------------------
  |  |  176|   116k|	array_is_created_i(&(array)->arr)
  |  |  ------------------
  |  |  |  Branch (176:2): [True: 1.23k, False: 115k]
  |  |  ------------------
  ------------------
   70|  1.23k|		reply = array_idx_modifiable(&cmd->replies, index);
  ------------------
  |  |  312|  1.23k|	ARRAY_TYPE_CAST_MODIFIABLE(array) \
  |  |  ------------------
  |  |  |  |   54|  1.23k|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  |  |  313|  1.23k|		array_idx_modifiable_i(&(array)->arr, idx)
  ------------------
   71|       |		/* get rid of any existing reply */
   72|  1.23k|		i_assert(!reply->sent);
  ------------------
  |  |  219|  1.23k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  1.23k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  1.23k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  1.23k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1.23k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  1.23k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  1.23k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.23k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   73|  1.23k|		smtp_server_reply_clear(reply);
   74|   115k|	} else {
   75|   115k|		p_array_init(&cmd->replies, pool, cmd->replies_expected);
  ------------------
  |  |   44|   115k|	array_create(array, pool, sizeof(**(array)->v), init_count)
  |  |  ------------------
  |  |  |  |  152|   115k|	array_create_i(&(array)->arr, pool, element_size, init_count)
  |  |  ------------------
  ------------------
   76|   115k|		array_idx_clear(&cmd->replies, cmd->replies_expected - 1);
  ------------------
  |  |  327|   115k|	array_idx_clear_i(&(array)->arr, idx)
  ------------------
   77|   115k|		reply = array_idx_modifiable(&cmd->replies, index);
  ------------------
  |  |  312|   115k|	ARRAY_TYPE_CAST_MODIFIABLE(array) \
  |  |  ------------------
  |  |  |  |   54|   115k|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  |  |  313|   115k|		array_idx_modifiable_i(&(array)->arr, idx)
  ------------------
   78|   115k|	}
   79|   116k|	reply->event = event_create(cmd->context.event);
  ------------------
  |  |  156|   116k|	event_create((parent), __FILE__, __LINE__)
  ------------------
   80|       |
   81|   116k|	return reply;
   82|   116k|}
smtp-server-reply.c:smtp_server_reply_clear:
   33|  1.23k|{
   34|  1.23k|	smtp_server_reply_destroy(reply);
   35|  1.23k|	if (reply->submitted) {
  ------------------
  |  Branch (35:6): [True: 1.23k, False: 0]
  ------------------
   36|  1.23k|		i_assert(reply->command->replies_submitted > 0);
  ------------------
  |  |  219|  1.23k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  1.23k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  1.23k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  1.23k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1.23k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  1.23k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  1.23k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.23k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   37|  1.23k|		reply->command->replies_submitted--;
   38|  1.23k|	}
   39|  1.23k|	reply->submitted = FALSE;
  ------------------
  |  |   11|  1.23k|#  define FALSE (!1)
  ------------------
   40|  1.23k|	reply->forwarded = FALSE;
  ------------------
  |  |   11|  1.23k|#  define FALSE (!1)
  ------------------
   41|  1.23k|}
smtp-server-reply.c:smtp_server_reply_update_event:
   44|   116k|{
   45|   116k|	struct smtp_server_command *command = reply->command;
   46|       |
   47|   116k|	event_add_int(reply->event, "index", reply->index);
   48|   116k|	event_add_int(reply->event, "status", reply->content->status);
   49|       |
   50|   116k|	if (command->replies_expected > 1) {
  ------------------
  |  Branch (50:6): [True: 0, False: 116k]
  ------------------
   51|      0|		event_set_append_log_prefix(reply->event,
   52|      0|			t_strdup_printf("%u reply [%u/%u]: ",
   53|      0|					reply->content->status,
   54|      0|					reply->index+1,
   55|      0|					command->replies_expected));
   56|   116k|	} else {
   57|   116k|		event_set_append_log_prefix(reply->event,
   58|   116k|			t_strdup_printf("%u reply: ",
   59|   116k|					reply->content->status));
   60|   116k|	}
   61|   116k|}
smtp-server-reply.c:smtp_server_reply_destroy:
   18|   120k|{
   19|   120k|	if (reply->command == NULL)
  ------------------
  |  Branch (19:6): [True: 0, False: 120k]
  ------------------
   20|      0|		return;
   21|       |
   22|   120k|	if (reply->event != NULL) {
  ------------------
  |  Branch (22:6): [True: 116k, False: 3.06k]
  ------------------
   23|   116k|		e_debug(reply->event, "Destroy");
  ------------------
  |  |   61|   116k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|   116k|#  define STMT_START do
  |  |  ------------------
  |  |   62|   116k|	struct event *_tmp_event = (_event); \
  |  |   63|   116k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|   116k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   116k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 116k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|   116k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|   116k|	else \
  |  |   66|   116k|		event_send_abort(_tmp_event); \
  |  |   67|   116k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|   116k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   24|   116k|		event_unref(&reply->event);
   25|   116k|	}
   26|       |
   27|   120k|	if (reply->content == NULL)
  ------------------
  |  Branch (27:6): [True: 0, False: 120k]
  ------------------
   28|      0|		return;
   29|   120k|	str_free(&reply->content->text);
   30|   120k|}
smtp-server-reply.c:smtp_server_reply_allv:
  494|  1.24k|{
  495|  1.24k|	struct smtp_server_command *cmd = _cmd->cmd;
  496|  1.24k|	struct smtp_server_reply *reply;
  497|  1.24k|	const char *text;
  498|  1.24k|	unsigned int first, i = 0;
  499|       |
  500|       |	/* find the first unsent reply */
  501|  1.24k|	if (array_is_created(&cmd->replies)) {
  ------------------
  |  |  176|  1.24k|	array_is_created_i(&(array)->arr)
  |  |  ------------------
  |  |  |  Branch (176:2): [True: 0, False: 1.24k]
  |  |  ------------------
  ------------------
  502|      0|		for (; i < cmd->replies_expected; i++) {
  ------------------
  |  Branch (502:10): [True: 0, False: 0]
  ------------------
  503|      0|			struct smtp_server_reply *reply =
  504|      0|				array_idx_modifiable(&cmd->replies, i);
  ------------------
  |  |  312|      0|	ARRAY_TYPE_CAST_MODIFIABLE(array) \
  |  |  ------------------
  |  |  |  |   54|      0|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  |  |  313|      0|		array_idx_modifiable_i(&(array)->arr, idx)
  ------------------
  505|      0|			if (!reply->sent)
  ------------------
  |  Branch (505:8): [True: 0, False: 0]
  ------------------
  506|      0|				break;
  507|      0|		}
  508|      0|		i_assert (i < cmd->replies_expected);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  509|      0|	}
  510|  1.24k|	first = i++;
  511|       |
  512|       |	/* compose the reply text */
  513|  1.24k|	text = t_strdup_vprintf(fmt, args);
  514|       |
  515|       |	/* submit the first remaining reply */
  516|  1.24k|	reply = smtp_server_reply_create_index(cmd, first, status, enh_code);
  517|  1.24k|	smtp_server_reply_add_text(reply, text);
  518|  1.24k|	smtp_server_reply_submit(reply);
  519|       |
  520|       |	/* duplicate the rest from it */
  521|  1.24k|	for (; i < cmd->replies_expected; i++)
  ------------------
  |  Branch (521:9): [True: 0, False: 1.24k]
  ------------------
  522|      0|		smtp_server_reply_submit_duplicate(_cmd, i, first);
  523|  1.24k|}
smtp-server-reply.c:smtp_server_reply_write_one_line:
  562|  70.1k|{
  563|  70.1k|	string_t *textbuf;
  564|  70.1k|	const char *text, *p;
  565|  70.1k|	size_t text_len, prefix_len, line_len;
  566|       |
  567|  70.1k|	i_assert(reply->content != NULL);
  ------------------
  |  |  219|  70.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  70.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  70.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  70.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 70.1k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 70.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  70.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  70.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  70.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  568|  70.1k|	textbuf = reply->content->text;
  569|  70.1k|	i_assert(str_len(textbuf) > 0);
  ------------------
  |  |  219|  70.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  70.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  70.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  70.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 70.1k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 70.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  70.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  70.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  70.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  570|       |
  571|  70.1k|	prefix_len = strlen(reply->content->status_prefix);
  572|  70.1k|	text = str_c(textbuf);
  573|  70.1k|	text_len = str_len(textbuf);
  574|       |
  575|  70.1k|	if (skip_status) {
  ------------------
  |  Branch (575:6): [True: 70.1k, False: 0]
  ------------------
  576|  70.1k|		i_assert(text_len > prefix_len);
  ------------------
  |  |  219|  70.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  70.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  70.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  70.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 70.1k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 70.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  70.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  70.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  70.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  577|  70.1k|		text_len -= prefix_len;
  578|  70.1k|		text += prefix_len;
  579|  70.1k|	}
  580|       |
  581|  70.1k|	for (;;) {
  582|  70.1k|		p = strchr(text, '\n');
  583|  70.1k|		i_assert(p != NULL && p > text && *(p-1) == '\r');
  ------------------
  |  |  219|  70.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  70.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  70.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   280k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 70.1k]
  |  |  |  |  |  Branch (202:45): [True: 70.1k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 70.1k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 70.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  70.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  70.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  70.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  584|  70.1k|		str_append_data(str, text, p - text - 1);
  585|  70.1k|		line_len = (size_t)(p - text) + 1;
  586|  70.1k|		i_assert(text_len >= line_len);
  ------------------
  |  |  219|  70.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  70.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  70.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  70.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 70.1k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 70.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  70.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  70.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  70.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  587|  70.1k|		text_len -= line_len;
  588|  70.1k|		text = p + 1;
  589|       |
  590|  70.1k|		if (text_len <= prefix_len)
  ------------------
  |  Branch (590:7): [True: 70.1k, False: 0]
  ------------------
  591|  70.1k|			break;
  592|       |
  593|      0|		text_len -= prefix_len;
  594|      0|		text += prefix_len;
  595|      0|		str_append_c(str, ' ');
  ------------------
  |  |   54|      0|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|      0|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|      0|			(unsigned char)(chr), (chr)))
  ------------------
  596|      0|	}
  597|  70.1k|}
smtp-server-reply.c:smtp_server_reply_send_real:
  618|   112k|{
  619|   112k|	struct smtp_server_command *cmd = reply->command;
  620|   112k|	struct smtp_server_connection *conn = cmd->context.conn;
  621|   112k|	struct ostream *output = conn->conn.output;
  622|   112k|	string_t *textbuf;
  623|   112k|	char *text;
  624|   112k|	int ret = 0;
  625|       |
  626|   112k|	i_assert(reply->content != NULL);
  ------------------
  |  |  219|   112k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   112k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   112k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   112k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 112k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 112k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   112k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   112k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   112k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  627|   112k|	textbuf = reply->content->text;
  628|   112k|	i_assert(str_len(textbuf) > 0);
  ------------------
  |  |  219|   112k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   112k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   112k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   112k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 112k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 112k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   112k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   112k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   112k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  629|       |
  630|       |	/* substitute '-' with ' ' in last line */
  631|   112k|	text = str_c_modifiable(textbuf);
  632|   112k|	text = text + reply->content->last_line + 3;
  633|   112k|	if (text[0] != ' ') {
  ------------------
  |  Branch (633:6): [True: 112k, False: 0]
  ------------------
  634|   112k|		i_assert(text[0] == '-');
  ------------------
  |  |  219|   112k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   112k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   112k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   112k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 112k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 112k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   112k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   112k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   112k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  635|   112k|		text[0] = ' ';
  636|   112k|	}
  637|       |
  638|   112k|	if (o_stream_send(output, str_data(textbuf), str_len(textbuf)) < 0) {
  ------------------
  |  Branch (638:6): [True: 0, False: 112k]
  ------------------
  639|      0|		e_debug(reply->event, "Send failed: %s",
  ------------------
  |  |   61|      0|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |   62|      0|	struct event *_tmp_event = (_event); \
  |  |   63|      0|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|      0|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|      0|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|      0|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|      0|	else \
  |  |   66|      0|		event_send_abort(_tmp_event); \
  |  |   67|      0|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  640|      0|			o_stream_get_disconnect_reason(output));
  641|      0|		smtp_server_connection_handle_output_error(conn);
  642|      0|		return -1;
  643|      0|	}
  644|       |
  645|   112k|	e_debug(reply->event, "Sent: %s",
  ------------------
  |  |   61|   112k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|   112k|#  define STMT_START do
  |  |  ------------------
  |  |   62|   112k|	struct event *_tmp_event = (_event); \
  |  |   63|   112k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|   112k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   112k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 112k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|   112k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|   112k|	else \
  |  |   66|   112k|		event_send_abort(_tmp_event); \
  |  |   67|   112k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|   112k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  646|   112k|		smtp_server_reply_get_one_line(reply));
  647|   112k|	return ret;
  648|   112k|}

smtp_server_transaction_create:
   32|  4.54k|{
   33|  4.54k|	struct smtp_server_transaction *trans;
   34|  4.54k|	pool_t pool;
   35|       |
   36|       |	/* create new transaction */
   37|  4.54k|	pool = pool_alloconly_create("smtp server transaction", 4096);
   38|  4.54k|	trans = p_new(pool, struct smtp_server_transaction, 1);
  ------------------
  |  |   97|  4.54k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|  4.54k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|  4.54k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|  4.54k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  4.54k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   39|  4.54k|	trans->pool = pool;
   40|  4.54k|	trans->conn = conn;
   41|       |
   42|       |	/* generate transaction ID */
   43|  4.54k|	if (conn->transaction_seq++ == 0)
  ------------------
  |  Branch (43:6): [True: 2.17k, False: 2.37k]
  ------------------
   44|  2.17k|		trans->id = conn->session_id;
   45|  2.37k|	else {
   46|  2.37k|		trans->id = p_strdup_printf(pool, "%s:T%u", conn->session_id,
   47|  2.37k|					    conn->transaction_seq);
   48|  2.37k|	}
   49|       |
   50|  4.54k|	trans->flags = mail_data->flags;
   51|  4.54k|	trans->mail_from = smtp_address_clone(trans->pool, mail_data->path);
   52|  4.54k|	smtp_params_mail_copy(pool, &trans->params, &mail_data->params);
   53|  4.54k|	trans->timestamp = mail_data->timestamp;
   54|       |
   55|  4.54k|	if (conn->next_trans_event == NULL)
  ------------------
  |  Branch (55:6): [True: 1.83k, False: 2.71k]
  ------------------
   56|  1.83k|		trans->event = event_create(conn->event);
  ------------------
  |  |  156|  1.83k|	event_create((parent), __FILE__, __LINE__)
  ------------------
   57|  2.71k|	else {
   58|  2.71k|		trans->event = conn->next_trans_event;
   59|  2.71k|		conn->next_trans_event = NULL;
   60|  2.71k|	}
   61|  4.54k|	smtp_server_transaction_update_event(trans);
   62|       |
   63|  4.54k|	struct event_passthrough *e =
   64|  4.54k|		event_create_passthrough(trans->event)->
  ------------------
  |  |  176|  4.54k|	event_create_passthrough((parent), __FILE__, __LINE__)
  ------------------
   65|  4.54k|		set_name("smtp_server_transaction_started");
   66|       |
   67|  4.54k|	e_debug(e->event(), "Start");
  ------------------
  |  |   61|  4.54k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  4.54k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  4.54k|	struct event *_tmp_event = (_event); \
  |  |   63|  4.54k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  4.54k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  4.54k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 4.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  4.54k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  4.54k|	else \
  |  |   66|  4.54k|		event_send_abort(_tmp_event); \
  |  |   67|  4.54k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  4.54k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   68|       |
   69|  4.54k|	if (conn->callbacks != NULL &&
  ------------------
  |  Branch (69:6): [True: 4.54k, False: 0]
  ------------------
   70|  4.54k|	    conn->callbacks->conn_trans_start != NULL)
  ------------------
  |  Branch (70:6): [True: 0, False: 4.54k]
  ------------------
   71|      0|		conn->callbacks->conn_trans_start(conn->context, trans);
   72|       |
   73|  4.54k|	return trans;
   74|  4.54k|}
smtp_server_transaction_free:
   77|  4.54k|{
   78|  4.54k|	struct smtp_server_transaction *trans = *_trans;
   79|  4.54k|	struct smtp_server_connection *conn = trans->conn;
   80|  4.54k|	struct smtp_server_recipient **rcpts;
   81|  4.54k|	unsigned int rcpts_total, rcpts_aborted, rcpts_failed;
   82|  4.54k|	unsigned int rcpts_count, i;
   83|       |
   84|  4.54k|	*_trans = NULL;
   85|       |
   86|  4.54k|	if (conn->callbacks != NULL &&
  ------------------
  |  Branch (86:6): [True: 4.54k, False: 0]
  ------------------
   87|  4.54k|	    conn->callbacks->conn_trans_free != NULL)
  ------------------
  |  Branch (87:6): [True: 0, False: 4.54k]
  ------------------
   88|      0|		conn->callbacks->conn_trans_free(conn->context, trans);
   89|       |
   90|  4.54k|	rcpts_count = 0;
   91|  4.54k|	if (array_is_created(&trans->rcpt_to))
  ------------------
  |  |  176|  4.54k|	array_is_created_i(&(array)->arr)
  |  |  ------------------
  |  |  |  Branch (176:2): [True: 2.79k, False: 1.75k]
  |  |  ------------------
  ------------------
   92|  2.79k|		rcpts = array_get_modifiable(&trans->rcpt_to, &rcpts_count);
  ------------------
  |  |  306|  2.79k|	ARRAY_TYPE_CAST_MODIFIABLE(array) \
  |  |  ------------------
  |  |  |  |   54|  2.79k|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  |  |  307|  2.79k|		array_get_modifiable_i(&(array)->arr, count)
  ------------------
   93|       |
   94|  4.54k|	rcpts_aborted = rcpts_count + conn->state.pending_rcpt_cmds;
   95|  4.54k|	rcpts_failed =  conn->state.denied_rcpt_cmds;
   96|  4.54k|	rcpts_total = rcpts_aborted + rcpts_failed;
   97|       |
   98|  16.6k|	for (i = 0; i < rcpts_count; i++)
  ------------------
  |  Branch (98:14): [True: 12.1k, False: 4.54k]
  ------------------
   99|  12.1k|		smtp_server_recipient_destroy(&rcpts[i]);
  100|       |
  101|  4.54k|	if (!trans->finished) {
  ------------------
  |  Branch (101:6): [True: 2.39k, False: 2.15k]
  ------------------
  102|  2.39k|		struct event_passthrough *e =
  103|  2.39k|			event_create_passthrough(trans->event)->
  ------------------
  |  |  176|  2.39k|	event_create_passthrough((parent), __FILE__, __LINE__)
  ------------------
  104|  2.39k|			set_name("smtp_server_transaction_finished")->
  105|  2.39k|			add_int("recipients", rcpts_total)->
  106|  2.39k|			add_int("recipients_denied", rcpts_failed)->
  107|  2.39k|			add_int("recipients_aborted", rcpts_aborted)->
  108|  2.39k|			add_int("recipients_failed", rcpts_failed)->
  109|  2.39k|			add_int("recipients_succeeded", 0);
  110|  2.39k|		e->add_int("status_code", 9000);
  111|  2.39k|		e->add_str("enhanced_code", "9.0.0");
  112|  2.39k|		e->add_str("error", "Aborted");
  113|       |
  114|  2.39k|		e_debug(e->event(), "Aborted");
  ------------------
  |  |   61|  2.39k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  2.39k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  2.39k|	struct event *_tmp_event = (_event); \
  |  |   63|  2.39k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  2.39k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  2.39k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 2.39k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  2.39k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  2.39k|	else \
  |  |   66|  2.39k|		event_send_abort(_tmp_event); \
  |  |   67|  2.39k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  2.39k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  115|  2.39k|	}
  116|       |
  117|  4.54k|	event_unref(&trans->event);
  118|  4.54k|	pool_unref(&trans->pool);
  119|  4.54k|}
smtp_server_transaction_add_rcpt:
  141|  12.1k|{
  142|  12.1k|	if (!array_is_created(&trans->rcpt_to))
  ------------------
  |  |  176|  12.1k|	array_is_created_i(&(array)->arr)
  ------------------
  |  Branch (142:6): [True: 2.79k, False: 9.32k]
  ------------------
  143|  12.1k|		p_array_init(&trans->rcpt_to, trans->pool, 8);
  ------------------
  |  |   44|  2.79k|	array_create(array, pool, sizeof(**(array)->v), init_count)
  |  |  ------------------
  |  |  |  |  152|  2.79k|	array_create_i(&(array)->arr, pool, element_size, init_count)
  |  |  ------------------
  ------------------
  144|       |
  145|  12.1k|	rcpt->trans = trans;
  146|  12.1k|	rcpt->index = array_count(&trans->rcpt_to);
  ------------------
  |  |  200|  12.1k|	array_count_i(&(array)->arr)
  ------------------
  147|       |
  148|  12.1k|	array_push_back(&trans->rcpt_to, &rcpt);
  ------------------
  |  |  282|  12.1k|#define array_push_back(array, item) array_append(array, (item), 1)
  |  |  ------------------
  |  |  |  |  214|  12.1k|	TYPE_CHECKS(void, ARRAY_TYPE_CHECK(array, data), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  12.1k|	(FALSE ? (return_type)(checks) : (func))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  12.1k|#  define FALSE (!1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (11:17): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:25): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  215|  12.1k|	array_append_i(&(array)->arr, data, count))
  |  |  ------------------
  ------------------
  149|  12.1k|}
smtp_server_transaction_has_rcpt:
  152|  31.4k|{
  153|  31.4k|	return (array_is_created(&trans->rcpt_to) &&
  ------------------
  |  |  176|  62.9k|	array_is_created_i(&(array)->arr)
  |  |  ------------------
  |  |  |  Branch (176:2): [True: 30.7k, False: 719]
  |  |  ------------------
  ------------------
  154|  31.4k|		array_count(&trans->rcpt_to) > 0);
  ------------------
  |  |  200|  30.7k|	array_count_i(&(array)->arr)
  ------------------
  |  Branch (154:3): [True: 30.7k, False: 0]
  ------------------
  155|  31.4k|}
smtp_server_transaction_data_command:
  167|  23.6k|{
  168|  23.6k|	struct smtp_server_recipient *rcpt;
  169|       |
  170|  23.6k|	trans->cmd = cmd;
  171|       |
  172|  23.6k|	if (!array_is_created(&trans->rcpt_to))
  ------------------
  |  |  176|  23.6k|	array_is_created_i(&(array)->arr)
  ------------------
  |  Branch (172:6): [True: 810, False: 22.8k]
  ------------------
  173|    810|		return;
  174|  22.8k|	array_foreach_elem(&trans->rcpt_to, rcpt)
  ------------------
  |  |  111|  22.8k|	for (const void *_foreach_end = \
  |  |  112|  22.8k|		CONST_PTR_OFFSET(*(array)->v, (array)->arr.buffer->used), \
  |  |  ------------------
  |  |  |  |   27|  22.8k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  |  |  113|  22.8k|	     *_foreach_ptr = CONST_PTR_OFFSET(*(array)->v, ARRAY_TYPE_CHECK(array, &elem) + \
  |  |  ------------------
  |  |  |  |   27|  91.2k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  114|  22.8k|		COMPILE_ERROR_IF_TRUE(sizeof(elem) > sizeof(void *))) \
  |  |  115|  22.8k|		     ;							\
  |  |  116|  73.1k|	     (_foreach_ptr != _foreach_end &&		\
  |  |  ------------------
  |  |  |  Branch (116:8): [True: 50.3k, False: 22.8k]
  |  |  ------------------
  |  |  117|  73.1k|	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   84|  50.3k|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  |  |  ------------------
  |  |               	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   15|  50.3k|#  define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  50.3k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (117:7): [True: 50.3k, False: 0]
  |  |  ------------------
  |  |  118|  22.8k|		;							\
  |  |  119|  50.3k|	     _foreach_ptr = CONST_PTR_OFFSET(_foreach_ptr, sizeof(elem)))
  |  |  ------------------
  |  |  |  |   27|  50.3k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  ------------------
  175|  50.3k|		smtp_server_recipient_data_command(rcpt, cmd);
  176|  22.8k|}
smtp_server_transaction_received:
  180|  1.24k|{
  181|  1.24k|	event_add_int(trans->event, "data_size", data_size);
  182|  1.24k|}
smtp_server_transaction_reset:
  185|    907|{
  186|    907|	struct smtp_server_connection *conn = trans->conn;
  187|    907|	struct smtp_server_recipient *const *rcpts = NULL;
  188|    907|	unsigned int rcpts_total, rcpts_failed, rcpts_aborted;
  189|    907|	unsigned int rcpts_count, i;
  190|       |
  191|    907|	i_assert(!trans->finished);
  ------------------
  |  |  219|    907|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    907|#  define STMT_START do
  |  |  ------------------
  |  |  220|    907|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    907|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 907]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 907]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    907|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    907|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    907|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  192|    907|	trans->finished = TRUE;
  ------------------
  |  |   15|    907|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|    907|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  193|       |
  194|    907|	rcpts_count = 0;
  195|    907|	if (array_is_created(&trans->rcpt_to))
  ------------------
  |  |  176|    907|	array_is_created_i(&(array)->arr)
  |  |  ------------------
  |  |  |  Branch (176:2): [True: 282, False: 625]
  |  |  ------------------
  ------------------
  196|    282|		rcpts = array_get(&trans->rcpt_to, &rcpts_count);
  ------------------
  |  |  255|    282|	ARRAY_TYPE_CAST_CONST(array)array_get_i(&(array)->arr, count)
  |  |  ------------------
  |  |  |  |   52|    282|	(typeof(*(array)->v))
  |  |  ------------------
  ------------------
  197|       |
  198|    907|	rcpts_aborted = rcpts_count + conn->state.pending_rcpt_cmds;
  199|    907|	rcpts_failed = conn->state.denied_rcpt_cmds;
  200|    907|	rcpts_total = rcpts_aborted + rcpts_failed;
  201|       |
  202|  2.32k|	for (i = 0; i < rcpts_count; i++)
  ------------------
  |  Branch (202:14): [True: 1.42k, False: 907]
  ------------------
  203|  1.42k|		smtp_server_recipient_reset(rcpts[i]);
  204|       |
  205|    907|	struct event_passthrough *e =
  206|    907|		event_create_passthrough(trans->event)->
  ------------------
  |  |  176|    907|	event_create_passthrough((parent), __FILE__, __LINE__)
  ------------------
  207|    907|		set_name("smtp_server_transaction_finished")->
  208|    907|		add_int("recipients", rcpts_total)->
  209|    907|		add_int("recipients_denied", rcpts_failed)->
  210|    907|		add_int("recipients_aborted", rcpts_aborted)->
  211|    907|		add_int("recipients_failed", rcpts_failed)->
  212|    907|		add_int("recipients_succeeded", 0)->
  213|    907|		add_str("is_reset", "yes");
  214|    907|	e_debug(e->event(), "Finished");
  ------------------
  |  |   61|    907|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|    907|#  define STMT_START do
  |  |  ------------------
  |  |   62|    907|	struct event *_tmp_event = (_event); \
  |  |   63|    907|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|    907|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|    907|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 907]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|    907|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|    907|	else \
  |  |   66|    907|		event_send_abort(_tmp_event); \
  |  |   67|    907|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|    907|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  215|    907|}
smtp_server_transaction_finished:
  219|  1.24k|{
  220|  1.24k|	struct smtp_server_connection *conn = trans->conn;
  221|  1.24k|	struct smtp_server_recipient *const *rcpts = NULL;
  222|  1.24k|	const struct smtp_server_reply *trans_reply = NULL;
  223|  1.24k|	unsigned int rcpts_total, rcpts_denied, rcpts_failed, rcpts_succeeded;
  224|  1.24k|	unsigned int rcpts_count, i;
  225|       |
  226|  1.24k|	i_assert(conn->state.pending_rcpt_cmds == 0);
  ------------------
  |  |  219|  1.24k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  1.24k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  1.24k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  1.24k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1.24k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  1.24k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  1.24k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.24k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  227|  1.24k|	i_assert(!trans->finished);
  ------------------
  |  |  219|  1.24k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  1.24k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  1.24k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  1.24k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1.24k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  1.24k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  1.24k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.24k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  228|  1.24k|	trans->finished = TRUE;
  ------------------
  |  |   15|  1.24k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  1.24k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  229|       |
  230|  1.24k|	rcpts_count = 0;
  231|  1.24k|	if (array_is_created(&trans->rcpt_to))
  ------------------
  |  |  176|  1.24k|	array_is_created_i(&(array)->arr)
  |  |  ------------------
  |  |  |  Branch (176:2): [True: 1.24k, False: 0]
  |  |  ------------------
  ------------------
  232|  1.24k|		rcpts = array_get(&trans->rcpt_to, &rcpts_count);
  ------------------
  |  |  255|  1.24k|	ARRAY_TYPE_CAST_CONST(array)array_get_i(&(array)->arr, count)
  |  |  ------------------
  |  |  |  |   52|  1.24k|	(typeof(*(array)->v))
  |  |  ------------------
  ------------------
  233|       |
  234|  1.24k|	rcpts_succeeded = 0;
  235|  1.24k|	rcpts_denied = conn->state.denied_rcpt_cmds;
  236|  1.24k|	rcpts_failed = conn->state.denied_rcpt_cmds;
  237|  1.24k|	rcpts_total = rcpts_count + conn->state.denied_rcpt_cmds;
  238|  3.66k|	for (i = 0; i < rcpts_count; i++) {
  ------------------
  |  Branch (238:14): [True: 2.42k, False: 1.24k]
  ------------------
  239|  2.42k|		struct smtp_server_reply *reply;
  240|       |
  241|  2.42k|		if ((trans->flags &
  ------------------
  |  Branch (241:7): [True: 0, False: 2.42k]
  ------------------
  242|  2.42k|		     SMTP_SERVER_TRANSACTION_FLAG_REPLY_PER_RCPT) != 0)
  243|      0|			reply = smtp_server_command_get_reply(cmd->cmd, i);
  244|  2.42k|		else
  245|  2.42k|			reply = smtp_server_command_get_reply(cmd->cmd, 0);
  246|  2.42k|		smtp_server_recipient_finished(rcpts[i], reply);
  247|       |
  248|  2.42k|		if (smtp_server_reply_is_success(reply))
  ------------------
  |  Branch (248:7): [True: 2.42k, False: 0]
  ------------------
  249|  2.42k|			rcpts_succeeded++;
  250|      0|		else {
  251|      0|			rcpts_failed++;
  252|      0|			if (trans_reply == NULL)
  ------------------
  |  Branch (252:8): [True: 0, False: 0]
  ------------------
  253|      0|				trans_reply = reply;
  254|      0|		}
  255|  2.42k|	}
  256|       |
  257|  1.24k|	if (trans_reply == NULL) {
  ------------------
  |  Branch (257:6): [True: 1.24k, False: 0]
  ------------------
  258|       |		/* record first success reply in transaction */
  259|  1.24k|		trans_reply = smtp_server_command_get_reply(cmd->cmd, 0);
  260|  1.24k|	}
  261|       |
  262|  1.24k|	struct event_passthrough *e =
  263|  1.24k|		event_create_passthrough(trans->event)->
  ------------------
  |  |  176|  1.24k|	event_create_passthrough((parent), __FILE__, __LINE__)
  ------------------
  264|  1.24k|		set_name("smtp_server_transaction_finished")->
  265|  1.24k|		add_int("recipients", rcpts_total)->
  266|  1.24k|		add_int("recipients_denied", rcpts_denied)->
  267|  1.24k|		add_int("recipients_aborted", 0)->
  268|  1.24k|		add_int("recipients_failed", rcpts_failed)->
  269|  1.24k|		add_int("recipients_succeeded", rcpts_succeeded);
  270|  1.24k|	smtp_server_reply_add_to_event(trans_reply, e);
  271|       |
  272|  1.24k|	e_debug(e->event(), "Finished");
  ------------------
  |  |   61|  1.24k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  1.24k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  1.24k|	struct event *_tmp_event = (_event); \
  |  |   63|  1.24k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  1.24k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  1.24k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 1.24k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  1.24k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  1.24k|	else \
  |  |   66|  1.24k|		event_send_abort(_tmp_event); \
  |  |   67|  1.24k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.24k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  273|  1.24k|}
smtp-server-transaction.c:smtp_server_transaction_update_event:
   15|  4.54k|{
   16|  4.54k|	struct event *event = trans->event;
   17|       |
   18|  4.54k|	event_add_str(event, "transaction_id", trans->id);
   19|  4.54k|	event_add_str(event, "session", trans->id);
   20|  4.54k|	event_add_str(event, "mail_from",
   21|  4.54k|		      smtp_address_encode(trans->mail_from));
   22|  4.54k|	event_add_str(event, "mail_from_raw",
   23|  4.54k|		      smtp_address_encode_raw(trans->mail_from));
   24|  4.54k|	smtp_params_mail_add_to_event(&trans->params, event);
   25|  4.54k|	event_set_append_log_prefix(event,
   26|  4.54k|				    t_strdup_printf("trans <%s>: ", trans->id));
   27|  4.54k|}

smtp_server_init:
   28|  6.21k|{
   29|  6.21k|	struct smtp_server *server;
   30|  6.21k|	pool_t pool;
   31|       |
   32|  6.21k|	pool = pool_alloconly_create("smtp server", 1024);
   33|  6.21k|	server = p_new(pool, struct smtp_server, 1);
  ------------------
  |  |   97|  6.21k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|  6.21k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|  6.21k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   34|  6.21k|	server->pool = pool;
   35|  6.21k|	server->set.protocol = set->protocol;
   36|  6.21k|	server->set.reason_code_module =
   37|  6.21k|		p_strdup(pool, set->reason_code_module);
   38|  6.21k|	server->set.rawlog_dir = p_strdup_empty(pool, set->rawlog_dir);
   39|       |
   40|  6.21k|	if (set->ssl != NULL) {
  ------------------
  |  Branch (40:6): [True: 0, False: 6.21k]
  ------------------
   41|      0|		server->set.ssl =
   42|      0|			ssl_iostream_settings_dup(server->pool, set->ssl);
   43|      0|	}
   44|       |
   45|  6.21k|	if (set->hostname != NULL && *set->hostname != '\0')
  ------------------
  |  Branch (45:6): [True: 0, False: 6.21k]
  |  Branch (45:31): [True: 0, False: 0]
  ------------------
   46|      0|		server->set.hostname = p_strdup(pool, set->hostname);
   47|  6.21k|	else
   48|  6.21k|		server->set.hostname = p_strdup(pool, my_hostdomain());
   49|  6.21k|	if (set->login_greeting != NULL && *set->login_greeting != '\0')
  ------------------
  |  Branch (49:6): [True: 0, False: 6.21k]
  |  Branch (49:37): [True: 0, False: 0]
  ------------------
   50|      0|		server->set.login_greeting = p_strdup(pool, set->login_greeting);
   51|  6.21k|	else
   52|  6.21k|		server->set.login_greeting = PACKAGE_NAME" ready.";
  ------------------
  |  |  750|  6.21k|#define PACKAGE_NAME "Dovecot"
  ------------------
   53|  6.21k|	if (set->capabilities == 0) {
  ------------------
  |  Branch (53:6): [True: 6.21k, False: 0]
  ------------------
   54|  6.21k|		server->set.capabilities = SMTP_SERVER_DEFAULT_CAPABILITIES;
  ------------------
  |  |   12|  6.21k|	(SMTP_CAPABILITY_SIZE | SMTP_CAPABILITY_ENHANCEDSTATUSCODES | \
  |  |   13|  6.21k|	 SMTP_CAPABILITY_8BITMIME | SMTP_CAPABILITY_CHUNKING)
  ------------------
   55|  6.21k|	} else  {
   56|      0|		server->set.capabilities = set->capabilities;
   57|      0|	}
   58|  6.21k|	server->set.workarounds = set->workarounds;
   59|  6.21k|	server->set.max_client_idle_time_msecs = set->max_client_idle_time_msecs;
   60|  6.21k|	server->set.max_pipelined_commands = (set->max_pipelined_commands > 0 ?
  ------------------
  |  Branch (60:40): [True: 6.21k, False: 0]
  ------------------
   61|  6.21k|		set->max_pipelined_commands : 1);
   62|  6.21k|	server->set.max_bad_commands = (set->max_bad_commands > 0 ?
  ------------------
  |  Branch (62:34): [True: 0, False: 6.21k]
  ------------------
   63|  6.21k|		set->max_bad_commands : SMTP_SERVER_DEFAULT_MAX_BAD_COMMANDS);
  ------------------
  |  |    8|  6.21k|#define SMTP_SERVER_DEFAULT_MAX_BAD_COMMANDS      10
  ------------------
   64|  6.21k|	server->set.max_recipients = set->max_recipients;
   65|  6.21k|	server->set.command_limits = set->command_limits;
   66|  6.21k|	server->set.max_message_size = set->max_message_size;
   67|       |
   68|  6.21k|	if (set->mail_param_extensions != NULL) {
  ------------------
  |  Branch (68:6): [True: 0, False: 6.21k]
  ------------------
   69|      0|		server->set.mail_param_extensions =
   70|      0|			p_strarray_dup(pool, set->mail_param_extensions);
   71|      0|	}
   72|  6.21k|	if (set->rcpt_param_extensions != NULL) {
  ------------------
  |  Branch (72:6): [True: 0, False: 6.21k]
  ------------------
   73|      0|		server->set.rcpt_param_extensions =
   74|      0|			p_strarray_dup(pool, set->rcpt_param_extensions);
   75|      0|	}
   76|  6.21k|	if (set->xclient_extensions != NULL) {
  ------------------
  |  Branch (76:6): [True: 0, False: 6.21k]
  ------------------
   77|      0|		server->set.xclient_extensions =
   78|      0|			p_strarray_dup(pool, set->xclient_extensions);
   79|      0|	}
   80|       |
   81|  6.21k|	server->set.socket_send_buffer_size = set->socket_send_buffer_size;
   82|  6.21k|	server->set.socket_recv_buffer_size = set->socket_recv_buffer_size;
   83|       |
   84|  6.21k|	server->set.tls_required = set->tls_required;
   85|  6.21k|	server->set.auth_optional = set->auth_optional;
   86|  6.21k|	server->set.rcpt_domain_optional = set->rcpt_domain_optional;
   87|  6.21k|	server->set.mail_path_allow_broken = set->mail_path_allow_broken;
   88|  6.21k|	server->set.no_greeting = set->no_greeting;
   89|  6.21k|	server->set.debug = set->debug;
   90|  6.21k|	server->set.no_state_in_reason = set->no_state_in_reason;
   91|       |
   92|       |	/* There is no event log prefix added here, since the server itself does
   93|       |	   not log anything. */
   94|  6.21k|	server->event = event_create(set->event_parent);
  ------------------
  |  |  156|  6.21k|	event_create((parent), __FILE__, __LINE__)
  ------------------
   95|  6.21k|	smtp_server_event_init(server, server->event);
   96|  6.21k|	event_set_forced_debug(server->event, set->debug);
   97|       |
   98|  6.21k|	server->conn_list = smtp_server_connection_list_init();
   99|  6.21k|	smtp_server_commands_init(server);
  100|  6.21k|	return server;
  101|  6.21k|}
smtp_server_event_init:
  104|  6.21k|{
  105|  6.21k|	event_add_category(event, &event_category_smtp_server);
  106|  6.21k|	event_add_str(event, "protocol",
  107|  6.21k|		      smtp_protocol_name(server->set.protocol));
  108|  6.21k|}
smtp_server_deinit:
  111|  6.21k|{
  112|  6.21k|	struct smtp_server *server = *_server;
  113|       |
  114|  6.21k|	connection_list_deinit(&server->conn_list);
  115|       |
  116|  6.21k|	if (server->ssl_ctx != NULL)
  ------------------
  |  Branch (116:6): [True: 0, False: 6.21k]
  ------------------
  117|      0|		ssl_iostream_context_unref(&server->ssl_ctx);
  118|  6.21k|	event_unref(&server->event);
  119|  6.21k|	pool_unref(&server->pool);
  120|  6.21k|	*_server = NULL;
  121|  6.21k|}

smtp_string_parse:
   18|  5.61k|{
   19|  5.61k|	struct smtp_parser parser;
   20|       |
   21|  5.61k|	*value_r = NULL;
   22|  5.61k|	*error_r = NULL;
   23|       |
   24|  5.61k|	if (string == NULL || *string == '\0') {
  ------------------
  |  Branch (24:6): [True: 0, False: 5.61k]
  |  Branch (24:24): [True: 2.59k, False: 3.02k]
  ------------------
   25|  2.59k|		*value_r = "";
   26|  2.59k|		return 0;
   27|  2.59k|	}
   28|       |
   29|  3.02k|	smtp_parser_init(&parser, pool_datastack_create(), string);
   30|       |
   31|  3.02k|	if (smtp_parser_parse_string(&parser, value_r) < 0) {
  ------------------
  |  Branch (31:6): [True: 1.96k, False: 1.05k]
  ------------------
   32|  1.96k|		*error_r = parser.error;
   33|  1.96k|		return -1;
   34|  1.96k|	}
   35|  1.05k|	if (parser.cur < parser.end) {
  ------------------
  |  Branch (35:6): [True: 241, False: 816]
  ------------------
   36|    241|		*error_r = "Invalid character in string";
   37|    241|		return -1;
   38|    241|	}
   39|    816|	return 1;
   40|  1.05k|}
smtp_helo_domain_parse:
  158|  7.24k|{
  159|  7.24k|	struct smtp_parser parser;
  160|  7.24k|	int ret;
  161|       |
  162|  7.24k|	smtp_parser_init(&parser, pool_datastack_create(), helo);
  163|       |
  164|  7.24k|	ret = smtp_parser_parse_domain(&parser, domain_r);
  165|  7.24k|	if (ret == 0) {
  ------------------
  |  Branch (165:6): [True: 4.97k, False: 2.27k]
  ------------------
  166|  4.97k|		if (allow_literal) {
  ------------------
  |  Branch (166:7): [True: 4.66k, False: 311]
  ------------------
  167|  4.66k|			ret = smtp_parser_parse_address_literal(
  168|  4.66k|				&parser, domain_r, NULL);
  169|  4.66k|		}
  170|  4.97k|	}
  171|       |
  172|  7.24k|	if (ret <= 0 || (parser.cur < parser.end && *parser.cur != ' '))
  ------------------
  |  Branch (172:6): [True: 5.02k, False: 2.22k]
  |  Branch (172:19): [True: 330, False: 1.89k]
  |  Branch (172:46): [True: 219, False: 111]
  ------------------
  173|  5.24k|		return -1;
  174|  2.00k|	return 0;
  175|  7.24k|}

ssl_iostream_destroy:
  157|  6.21k|{
  158|  6.21k|	struct ssl_iostream *ssl_io;
  159|       |
  160|  6.21k|	if (_ssl_io == NULL || *_ssl_io == NULL)
  ------------------
  |  Branch (160:6): [True: 0, False: 6.21k]
  |  Branch (160:25): [True: 6.21k, False: 0]
  ------------------
  161|  6.21k|		return;
  162|       |
  163|      0|	ssl_io = *_ssl_io;
  164|      0|	*_ssl_io = NULL;
  165|      0|	ssl_vfuncs->destroy(ssl_io);
  166|      0|}

fuzzer_init:
   15|  6.21k|{
   16|  6.21k|	i_zero(fuzz_ctx);
  ------------------
  |  |  249|  6.21k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   17|  6.21k|	if (!lib_is_initialized()) {
  ------------------
  |  Branch (17:6): [True: 1, False: 6.21k]
  ------------------
   18|      1|		lib_init();
   19|      1|		lib_signals_init();
   20|      1|		lib_signals_ignore(SIGPIPE, TRUE);
  ------------------
  |  |   15|      1|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      1|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   21|      1|	}
   22|  6.21k|	fuzz_ctx->fd = -1;
   23|  6.21k|}
fuzzer_deinit:
   26|  6.21k|{
   27|  6.21k|	iostream_pump_destroy(&fuzz_ctx->pump);
   28|       |	/* ensure fd gets closed, we don't care
   29|       |	   if this fails. */
   30|  6.21k|	if (fuzz_ctx->fd > -1)
  ------------------
  |  Branch (30:6): [True: 6.21k, False: 0]
  ------------------
   31|  6.21k|		(void)close(fuzz_ctx->fd);
   32|  6.21k|	if (fuzz_ctx->fd_pump > -1)
  ------------------
  |  Branch (32:6): [True: 6.21k, False: 0]
  ------------------
   33|  6.21k|		(void)close(fuzz_ctx->fd_pump);
   34|  6.21k|	if (fuzz_ctx->ioloop != NULL)
  ------------------
  |  Branch (34:6): [True: 6.21k, False: 0]
  ------------------
   35|  6.21k|		io_loop_destroy(&fuzz_ctx->ioloop);
   36|  6.21k|}
fuzzer_io_as_fd:
   64|  6.21k|{
   65|  6.21k|	int sfd[2];
   66|       |
   67|  6.21k|	if (socketpair(AF_UNIX, SOCK_STREAM, 0, sfd) < 0)
  ------------------
  |  Branch (67:6): [True: 0, False: 6.21k]
  ------------------
   68|      0|		i_fatal("socketpair() failed: %m");
   69|  6.21k|	net_set_nonblock(sfd[0], TRUE);
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   70|  6.21k|	net_set_nonblock(sfd[1], TRUE);
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   71|       |
   72|  6.21k|	struct istream *input = i_stream_create_from_data(data, size);
   73|  6.21k|	struct ostream *output = o_stream_create_fd(sfd[0], IO_BLOCK_SIZE);
  ------------------
  |  |  169|  6.21k|#  define IO_BLOCK_SIZE 8192
  ------------------
   74|  6.21k|	i_stream_set_name(input, "(fuzzer data)");
   75|  6.21k|	o_stream_set_name(output, "(fuzzer input to program)");
   76|  6.21k|	o_stream_set_no_error_handling(output, TRUE);
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   77|       |
   78|  6.21k|	fuzz_ctx->pump = iostream_pump_create(input, output);
   79|  6.21k|	fuzz_ctx->fd_pump = sfd[0];
   80|  6.21k|	fuzz_ctx->fd = sfd[1];
   81|  6.21k|	iostream_pump_set_completion_callback(fuzz_ctx->pump, pump_finished,
  ------------------
  |  |   54|  6.21k|	iostream_pump_set_completion_callback(pump, \
  |  |   55|  6.21k|		(iostream_pump_callback_t *)callback, TRUE ? context : \
  |  |  ------------------
  |  |  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (15:16): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   56|  6.21k|		CALLBACK_TYPECHECK(callback, \
  |  |  ------------------
  |  |  |  |  171|  6.21k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  6.21k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |   57|  6.21k|			void (*)(enum iostream_pump_status, typeof(context))))
  ------------------
   82|  6.21k|					      fuzz_ctx);
   83|  6.21k|	i_stream_unref(&input);
   84|  6.21k|	o_stream_unref(&output);
   85|  6.21k|	iostream_pump_start(fuzz_ctx->pump);
   86|  6.21k|	return sfd[1];
   87|  6.21k|}
fuzzer.c:pump_finished:
   40|  6.18k|{
   41|  6.18k|	struct istream *input = iostream_pump_get_input(fuzz_ctx->pump);
   42|  6.18k|	struct ostream *output = iostream_pump_get_output(fuzz_ctx->pump);
   43|       |
   44|  6.18k|	switch (status) {
  ------------------
  |  Branch (44:10): [True: 0, False: 6.18k]
  ------------------
   45|  6.18k|	case IOSTREAM_PUMP_STATUS_INPUT_EOF:
  ------------------
  |  Branch (45:2): [True: 6.18k, False: 0]
  ------------------
   46|  6.18k|		break;
   47|      0|	case IOSTREAM_PUMP_STATUS_INPUT_ERROR:
  ------------------
  |  Branch (47:2): [True: 0, False: 6.18k]
  ------------------
   48|      0|		i_error("read(%s) failed: %s", i_stream_get_name(input),
   49|      0|			i_stream_get_error(input));
   50|      0|		break;
   51|      0|	case IOSTREAM_PUMP_STATUS_OUTPUT_ERROR:
  ------------------
  |  Branch (51:2): [True: 0, False: 6.18k]
  ------------------
   52|      0|		i_error("write(%s) failed: %s", o_stream_get_name(output),
   53|      0|			o_stream_get_error(output));
   54|      0|		break;
   55|  6.18k|	};
   56|       |
   57|  6.18k|	if (shutdown(o_stream_get_fd(output), SHUT_WR) < 0)
  ------------------
  |  Branch (57:6): [True: 0, False: 6.18k]
  ------------------
   58|      0|		i_fatal("shutdown() failed: %m");
   59|  6.18k|	iostream_pump_destroy(&fuzz_ctx->pump);
   60|  6.18k|}

array_idx_modifiable_i:
    9|   554k|{
   10|   554k|	i_assert(idx < array->buffer->used / array->element_size);
  ------------------
  |  |  219|   554k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   554k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   554k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   554k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 554k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 554k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   554k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   554k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   554k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   11|   554k|	return PTR_OFFSET(array->buffer->data, idx * array->element_size);
  ------------------
  |  |   25|   554k|	((void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  ------------------
   12|   554k|}
array_idx_get_space_i:
   15|   100k|{
   16|   100k|	return buffer_get_space_unsafe(array->buffer, idx * array->element_size,
   17|   100k|				       array->element_size);
   18|   100k|}
array_idx_clear_i:
   27|   115k|{
   28|   115k|	buffer_write_zero(array->buffer, idx * array->element_size,
   29|   115k|			  array->element_size);
   30|   115k|}
array_sort_i:
  132|  5.83k|{
  133|  5.83k|	unsigned int count;
  134|       |
  135|  5.83k|	count = array_count_i(array);
  136|  5.83k|	if (count == 0)
  ------------------
  |  Branch (136:6): [True: 0, False: 5.83k]
  ------------------
  137|      0|		return;
  138|  5.83k|	qsort(buffer_get_modifiable_data(array->buffer, NULL),
  139|  5.83k|	      count, array->element_size, cmp);
  140|  5.83k|}
array_bsearch_i:
  144|   103k|{
  145|   103k|	unsigned int count;
  146|       |
  147|   103k|	count = array_count_i(array);
  148|   103k|	return bsearch(key, array->buffer->data,
  149|   103k|		       count, array->element_size, cmp);
  150|   103k|}

smtp-server-cmd-data.c:array_is_created_i:
  172|  2.76k|{
  173|  2.76k|	return array->buffer != NULL;
  174|  2.76k|}
smtp-server-reply.c:array_create_i:
  143|   115k|{
  144|   115k|	buffer_t *buffer;
  145|       |
  146|   115k|	buffer = buffer_create_dynamic_max(pool, init_count * element_size,
  147|   115k|		SIZE_MAX / element_size < UINT_MAX ? SIZE_MAX :
  ------------------
  |  Branch (147:3): [True: 0, False: 115k]
  ------------------
  148|   115k|		UINT_MAX * element_size);
  149|   115k|	array_create_from_buffer_i(array, buffer, element_size);
  150|   115k|}
smtp-server-reply.c:array_create_from_buffer_i:
  133|   115k|{
  134|   115k|	array->buffer = buffer;
  135|   115k|	array->element_size = element_size;
  136|   115k|}
smtp-server-reply.c:array_is_created_i:
  172|   238k|{
  173|   238k|	return array->buffer != NULL;
  174|   238k|}
smtp-server-command.c:array_append_i:
  209|  80.8k|{
  210|  80.8k|	buffer_append(array->buffer, data, count * array->element_size);
  211|  80.8k|}
smtp-server-command.c:array_create_i:
  143|  6.21k|{
  144|  6.21k|	buffer_t *buffer;
  145|       |
  146|  6.21k|	buffer = buffer_create_dynamic_max(pool, init_count * element_size,
  147|  6.21k|		SIZE_MAX / element_size < UINT_MAX ? SIZE_MAX :
  ------------------
  |  Branch (147:3): [True: 0, False: 6.21k]
  ------------------
  148|  6.21k|		UINT_MAX * element_size);
  149|  6.21k|	array_create_from_buffer_i(array, buffer, element_size);
  150|  6.21k|}
smtp-server-command.c:array_create_from_buffer_i:
  133|  6.21k|{
  134|  6.21k|	array->buffer = buffer;
  135|  6.21k|	array->element_size = element_size;
  136|  6.21k|}
smtp-server-command.c:array_is_created_i:
  172|   593k|{
  173|   593k|	return array->buffer != NULL;
  174|   593k|}
smtp-server-command.c:array_idx_i:
  272|   277k|{
  273|   277k|	i_assert(idx < array->buffer->used / array->element_size);
  ------------------
  |  |  219|   277k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   277k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   277k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   277k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 277k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 277k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   277k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   277k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   277k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  274|   277k|	return CONST_PTR_OFFSET(array->buffer->data, idx * array->element_size);
  ------------------
  |  |   27|   277k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  ------------------
  275|   277k|}
smtp-server-transaction.c:array_is_created_i:
  172|  73.9k|{
  173|  73.9k|	return array->buffer != NULL;
  174|  73.9k|}
smtp-server-transaction.c:array_get_modifiable_i:
  301|  2.79k|{
  302|  2.79k|	*count_r = array_count_i(array);
  303|  2.79k|	return buffer_get_modifiable_data(array->buffer, NULL);
  304|  2.79k|}
smtp-server-transaction.c:array_create_i:
  143|  2.79k|{
  144|  2.79k|	buffer_t *buffer;
  145|       |
  146|  2.79k|	buffer = buffer_create_dynamic_max(pool, init_count * element_size,
  147|  2.79k|		SIZE_MAX / element_size < UINT_MAX ? SIZE_MAX :
  ------------------
  |  Branch (147:3): [True: 0, False: 2.79k]
  ------------------
  148|  2.79k|		UINT_MAX * element_size);
  149|  2.79k|	array_create_from_buffer_i(array, buffer, element_size);
  150|  2.79k|}
smtp-server-transaction.c:array_create_from_buffer_i:
  133|  2.79k|{
  134|  2.79k|	array->buffer = buffer;
  135|  2.79k|	array->element_size = element_size;
  136|  2.79k|}
smtp-server-transaction.c:array_count_i:
  196|  47.2k|{
  197|  47.2k|	return array->buffer->used / array->element_size;
  198|  47.2k|}
smtp-server-transaction.c:array_append_i:
  209|  12.1k|{
  210|  12.1k|	buffer_append(array->buffer, data, count * array->element_size);
  211|  12.1k|}
smtp-server-transaction.c:array_get_i:
  250|  1.52k|{
  251|  1.52k|	*count_r = array_count_i(array);
  252|  1.52k|	return array->buffer->data;
  253|  1.52k|}
smtp-params.c:array_is_created_i:
  172|  16.7k|{
  173|  16.7k|	return array->buffer != NULL;
  174|  16.7k|}
smtp-server-cmd-helo.c:array_is_created_i:
  172|  6.45k|{
  173|  6.45k|	return array->buffer != NULL;
  174|  6.45k|}
smtp-server-cmd-mail.c:array_is_created_i:
  172|  12.6k|{
  173|  12.6k|	return array->buffer != NULL;
  174|  12.6k|}
smtp-server-cmd-rcpt.c:array_is_created_i:
  172|  12.9k|{
  173|  12.9k|	return array->buffer != NULL;
  174|  12.9k|}
array.c:array_count_i:
  196|   109k|{
  197|   109k|	return array->buffer->used / array->element_size;
  198|   109k|}
iostream.c:array_is_created_i:
  172|  57.6k|{
  173|  57.6k|	return array->buffer != NULL;
  174|  57.6k|}
ioloop.c:array_append_i:
  209|  44.0k|{
  210|  44.0k|	buffer_append(array->buffer, data, count * array->element_size);
  211|  44.0k|}
ioloop.c:array_delete_i:
  241|  28.3k|{
  242|  28.3k|	buffer_delete(array->buffer, idx * array->element_size,
  243|  28.3k|		      count * array->element_size);
  244|  28.3k|}
ioloop.c:array_clear_i:
  188|  9.52k|{
  189|  9.52k|	buffer_set_used_size(array->buffer, 0);
  190|  9.52k|}
ioloop.c:array_create_i:
  143|  6.21k|{
  144|  6.21k|	buffer_t *buffer;
  145|       |
  146|  6.21k|	buffer = buffer_create_dynamic_max(pool, init_count * element_size,
  147|  6.21k|		SIZE_MAX / element_size < UINT_MAX ? SIZE_MAX :
  ------------------
  |  Branch (147:3): [True: 0, False: 6.21k]
  ------------------
  148|  6.21k|		UINT_MAX * element_size);
  149|  6.21k|	array_create_from_buffer_i(array, buffer, element_size);
  150|  6.21k|}
ioloop.c:array_create_from_buffer_i:
  133|  6.21k|{
  134|  6.21k|	array->buffer = buffer;
  135|  6.21k|	array->element_size = element_size;
  136|  6.21k|}
ioloop.c:array_is_created_i:
  172|  18.6k|{
  173|  18.6k|	return array->buffer != NULL;
  174|  18.6k|}
ioloop.c:array_free_i:
  156|  6.21k|{
  157|  6.21k|	buffer_free(&array->buffer);
  158|  6.21k|}
ioloop.c:array_count_i:
  196|  37.8k|{
  197|  37.8k|	return array->buffer->used / array->element_size;
  198|  37.8k|}
ioloop-epoll.c:array_create_i:
  143|  12.4k|{
  144|  12.4k|	buffer_t *buffer;
  145|       |
  146|  12.4k|	buffer = buffer_create_dynamic_max(pool, init_count * element_size,
  147|  12.4k|		SIZE_MAX / element_size < UINT_MAX ? SIZE_MAX :
  ------------------
  |  Branch (147:3): [True: 0, False: 12.4k]
  ------------------
  148|  12.4k|		UINT_MAX * element_size);
  149|  12.4k|	array_create_from_buffer_i(array, buffer, element_size);
  150|  12.4k|}
ioloop-epoll.c:array_create_from_buffer_i:
  133|  12.4k|{
  134|  12.4k|	array->buffer = buffer;
  135|  12.4k|	array->element_size = element_size;
  136|  12.4k|}
ioloop-epoll.c:array_get_modifiable_i:
  301|  44.0k|{
  302|  44.0k|	*count_r = array_count_i(array);
  303|  44.0k|	return buffer_get_modifiable_data(array->buffer, NULL);
  304|  44.0k|}
ioloop-epoll.c:array_count_i:
  196|  44.0k|{
  197|  44.0k|	return array->buffer->used / array->element_size;
  198|  44.0k|}
ioloop-epoll.c:array_free_i:
  156|  12.4k|{
  157|  12.4k|	buffer_free(&array->buffer);
  158|  12.4k|}
ioloop-epoll.c:array_append_space_i:
  331|  12.4k|{
  332|  12.4k|	void *data;
  333|       |
  334|  12.4k|	data = buffer_append_space_unsafe(array->buffer, array->element_size);
  335|  12.4k|	memset(data, 0, array->element_size);
  336|  12.4k|	return data;
  337|  12.4k|}
ioloop-epoll.c:array_idx_i:
  272|  34.3k|{
  273|  34.3k|	i_assert(idx < array->buffer->used / array->element_size);
  ------------------
  |  |  219|  34.3k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  34.3k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  34.3k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  34.3k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 34.3k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 34.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  34.3k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  34.3k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  34.3k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  274|  34.3k|	return CONST_PTR_OFFSET(array->buffer->data, idx * array->element_size);
  ------------------
  |  |   27|  34.3k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  ------------------
  275|  34.3k|}
lib.c:array_is_created_i:
  172|      2|{
  173|      2|	return array->buffer != NULL;
  174|      2|}
lib.c:array_create_i:
  143|      1|{
  144|      1|	buffer_t *buffer;
  145|       |
  146|      1|	buffer = buffer_create_dynamic_max(pool, init_count * element_size,
  147|      1|		SIZE_MAX / element_size < UINT_MAX ? SIZE_MAX :
  ------------------
  |  Branch (147:3): [True: 0, False: 1]
  ------------------
  148|      1|		UINT_MAX * element_size);
  149|      1|	array_create_from_buffer_i(array, buffer, element_size);
  150|      1|}
lib.c:array_create_from_buffer_i:
  133|      1|{
  134|      1|	array->buffer = buffer;
  135|      1|	array->element_size = element_size;
  136|      1|}
lib.c:array_get_i:
  250|      1|{
  251|      1|	*count_r = array_count_i(array);
  252|      1|	return array->buffer->data;
  253|      1|}
lib.c:array_count_i:
  196|      1|{
  197|      1|	return array->buffer->used / array->element_size;
  198|      1|}
lib.c:array_append_space_i:
  331|      2|{
  332|      2|	void *data;
  333|       |
  334|      2|	data = buffer_append_space_unsafe(array->buffer, array->element_size);
  335|      2|	memset(data, 0, array->element_size);
  336|      2|	return data;
  337|      2|}
lib-event.c:array_is_created_i:
  172|  2.29M|{
  173|  2.29M|	return array->buffer != NULL;
  174|  2.29M|}
lib-event.c:array_create_i:
  143|   408k|{
  144|   408k|	buffer_t *buffer;
  145|       |
  146|   408k|	buffer = buffer_create_dynamic_max(pool, init_count * element_size,
  147|   408k|		SIZE_MAX / element_size < UINT_MAX ? SIZE_MAX :
  ------------------
  |  Branch (147:3): [True: 0, False: 408k]
  ------------------
  148|   408k|		UINT_MAX * element_size);
  149|   408k|	array_create_from_buffer_i(array, buffer, element_size);
  150|   408k|}
lib-event.c:array_create_from_buffer_i:
  133|   408k|{
  134|   408k|	array->buffer = buffer;
  135|   408k|	array->element_size = element_size;
  136|   408k|}
lib-event.c:array_append_i:
  209|  6.21k|{
  210|  6.21k|	buffer_append(array->buffer, data, count * array->element_size);
  211|  6.21k|}
lib-event.c:array_append_space_i:
  331|  1.11M|{
  332|  1.11M|	void *data;
  333|       |
  334|  1.11M|	data = buffer_append_space_unsafe(array->buffer, array->element_size);
  335|  1.11M|	memset(data, 0, array->element_size);
  336|  1.11M|	return data;
  337|  1.11M|}
lib-signals.c:array_is_created_i:
  172|  12.4k|{
  173|  12.4k|	return array->buffer != NULL;
  174|  12.4k|}
mempool.c:array_is_created_i:
  172|   667k|{
  173|   667k|	return array->buffer != NULL;
  174|   667k|}
priorityq.c:array_create_i:
  143|  6.21k|{
  144|  6.21k|	buffer_t *buffer;
  145|       |
  146|  6.21k|	buffer = buffer_create_dynamic_max(pool, init_count * element_size,
  147|  6.21k|		SIZE_MAX / element_size < UINT_MAX ? SIZE_MAX :
  ------------------
  |  Branch (147:3): [True: 0, False: 6.21k]
  ------------------
  148|  6.21k|		UINT_MAX * element_size);
  149|  6.21k|	array_create_from_buffer_i(array, buffer, element_size);
  150|  6.21k|}
priorityq.c:array_create_from_buffer_i:
  133|  6.21k|{
  134|  6.21k|	array->buffer = buffer;
  135|  6.21k|	array->element_size = element_size;
  136|  6.21k|}
priorityq.c:array_free_i:
  156|  6.21k|{
  157|  6.21k|	buffer_free(&array->buffer);
  158|  6.21k|}
priorityq.c:array_count_i:
  196|   197k|{
  197|   197k|	return array->buffer->used / array->element_size;
  198|   197k|}
priorityq.c:array_append_i:
  209|  36.2k|{
  210|  36.2k|	buffer_append(array->buffer, data, count * array->element_size);
  211|  36.2k|}
priorityq.c:array_get_modifiable_i:
  301|  75.8k|{
  302|  75.8k|	*count_r = array_count_i(array);
  303|  75.8k|	return buffer_get_modifiable_data(array->buffer, NULL);
  304|  75.8k|}
priorityq.c:array_delete_i:
  241|  36.2k|{
  242|  36.2k|	buffer_delete(array->buffer, idx * array->element_size,
  243|  36.2k|		      count * array->element_size);
  244|  36.2k|}
priorityq.c:array_idx_i:
  272|  79.3k|{
  273|  79.3k|	i_assert(idx < array->buffer->used / array->element_size);
  ------------------
  |  |  219|  79.3k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  79.3k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  79.3k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  79.3k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 79.3k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 79.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  79.3k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  79.3k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  79.3k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  274|  79.3k|	return CONST_PTR_OFFSET(array->buffer->data, idx * array->element_size);
  ------------------
  |  |   27|  79.3k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  ------------------
  275|  79.3k|}
var-expand.c:array_create_i:
  143|      1|{
  144|      1|	buffer_t *buffer;
  145|       |
  146|      1|	buffer = buffer_create_dynamic_max(pool, init_count * element_size,
  147|      1|		SIZE_MAX / element_size < UINT_MAX ? SIZE_MAX :
  ------------------
  |  Branch (147:3): [True: 0, False: 1]
  ------------------
  148|      1|		UINT_MAX * element_size);
  149|      1|	array_create_from_buffer_i(array, buffer, element_size);
  150|      1|}
var-expand.c:array_create_from_buffer_i:
  133|      1|{
  134|      1|	array->buffer = buffer;
  135|      1|	array->element_size = element_size;
  136|      1|}
var-expand.c:array_append_space_i:
  331|     13|{
  332|     13|	void *data;
  333|       |
  334|     13|	data = buffer_append_space_unsafe(array->buffer, array->element_size);
  335|     13|	memset(data, 0, array->element_size);
  336|     13|	return data;
  337|     13|}

base64_encode_more:
  379|  6.21k|{
  380|  6.21k|	bool crlf = HAS_ALL_BITS(enc->flags, BASE64_ENCODE_FLAG_CRLF);
  ------------------
  |  |   18|  6.21k|#define HAS_ALL_BITS(val,bits) ((~(val) & (bits)) == 0)
  ------------------
  381|  6.21k|	const unsigned char *src_c, *src_p;
  382|  6.21k|	size_t src_pos, src_left;
  383|       |
  384|  6.21k|	i_assert(!enc->finishing);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  385|  6.21k|	i_assert(!enc->finished);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  386|       |
  387|  6.21k|	src_p = src_c = src;
  388|  6.21k|	src_left = src_size;
  389|  12.4k|	while (src_left > 0) {
  ------------------
  |  Branch (389:9): [True: 6.21k, False: 6.21k]
  ------------------
  390|  6.21k|		size_t dst_avail, dst_pos, line_avail, written;
  391|       |
  392|       |		/* determine how much we can write in destination buffer */
  393|  6.21k|		dst_avail = buffer_get_avail_size(dest);
  394|  6.21k|		if (dst_avail == 0)
  ------------------
  |  Branch (394:7): [True: 0, False: 6.21k]
  ------------------
  395|      0|			break;
  396|       |
  397|       |		/* Emit pending newline immediately */
  398|  6.21k|		if (enc->pending_lf) {
  ------------------
  |  Branch (398:7): [True: 0, False: 6.21k]
  ------------------
  399|      0|			i_assert(crlf);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  400|      0|			buffer_append_c(dest, '\n');
  401|      0|			enc->pending_lf = FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  402|      0|			dst_avail--;
  403|      0|			if (dst_avail == 0)
  ------------------
  |  Branch (403:8): [True: 0, False: 0]
  ------------------
  404|      0|				break;
  405|      0|		}
  406|       |
  407|  6.21k|		i_assert(enc->max_line_len > 0);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  408|  6.21k|		i_assert(enc->cur_line_len <= enc->max_line_len);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  409|  6.21k|		line_avail = I_MIN(enc->max_line_len - enc->cur_line_len,
  ------------------
  |  |   35|  6.21k|#define I_MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 6.21k]
  |  |  ------------------
  ------------------
  410|  6.21k|				   dst_avail);
  411|       |
  412|  6.21k|		if (line_avail > 0) {
  ------------------
  |  Branch (412:7): [True: 6.21k, False: 0]
  ------------------
  413|  6.21k|			dst_pos = dest->used;
  414|  6.21k|			base64_encode_more_data(enc, src_p, src_left, &src_pos,
  415|  6.21k|						line_avail, dest);
  416|  6.21k|			i_assert(src_pos <= src_left);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  417|  6.21k|			src_p += src_pos;
  418|  6.21k|			src_left -= src_pos;
  419|  6.21k|			i_assert(dest->used >= dst_pos);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  420|  6.21k|			written = dest->used - dst_pos;
  421|       |
  422|  6.21k|			i_assert(written <= line_avail);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  423|  6.21k|			i_assert(written <= enc->max_line_len);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  424|  6.21k|			i_assert(enc->cur_line_len <=
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  425|  6.21k|				 (enc->max_line_len - written));
  426|  6.21k|			enc->cur_line_len += written;
  427|  6.21k|			dst_avail -= written;
  428|  6.21k|		}
  429|       |
  430|  6.21k|		if (dst_avail == 0)
  ------------------
  |  Branch (430:7): [True: 0, False: 6.21k]
  ------------------
  431|      0|			break;
  432|       |
  433|  6.21k|		if (src_left > 0 && enc->cur_line_len == enc->max_line_len) {
  ------------------
  |  Branch (433:7): [True: 0, False: 6.21k]
  |  Branch (433:23): [True: 0, False: 0]
  ------------------
  434|      0|			if (crlf) {
  ------------------
  |  Branch (434:8): [True: 0, False: 0]
  ------------------
  435|      0|				if (dst_avail >= 2) {
  ------------------
  |  Branch (435:9): [True: 0, False: 0]
  ------------------
  436|       |					/* emit the full CRLF sequence */
  437|      0|					buffer_append(dest, "\r\n", 2);
  438|      0|				} else {
  439|       |					/* emit CR */
  440|      0|					buffer_append_c(dest, '\r');
  441|       |					/* remember the LF */
  442|      0|					enc->pending_lf = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  443|      0|				}
  444|      0|			} else {
  445|      0|				buffer_append_c(dest, '\n');
  446|      0|			}
  447|      0|			enc->cur_line_len = 0;
  448|      0|		}
  449|  6.21k|	}
  450|       |
  451|  6.21k|	i_assert(src_p >= src_c);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  452|  6.21k|	src_pos = (src_p - src_c);
  453|  6.21k|	if (src_pos_r != NULL)
  ------------------
  |  Branch (453:6): [True: 0, False: 6.21k]
  ------------------
  454|      0|		*src_pos_r = src_pos;
  455|  6.21k|	return (src_pos == src_size);
  456|  6.21k|}
base64_encode_finish:
  459|  6.21k|{
  460|  6.21k|	const struct base64_scheme *b64 = enc->b64;
  461|  6.21k|	const char *b64enc = b64->encmap;
  462|  6.21k|	bool crlf = HAS_ALL_BITS(enc->flags, BASE64_ENCODE_FLAG_CRLF);
  ------------------
  |  |   18|  6.21k|#define HAS_ALL_BITS(val,bits) ((~(val) & (bits)) == 0)
  ------------------
  463|  6.21k|	bool padding = HAS_NO_BITS(enc->flags, BASE64_ENCODE_FLAG_NO_PADDING);
  ------------------
  |  |   12|  6.21k|#define HAS_NO_BITS(val,bits) (((val) & (bits)) == 0)
  ------------------
  464|  6.21k|	unsigned char *ptr, *end;
  465|  6.21k|	size_t dst_avail, line_avail, write_full, write;
  466|  6.21k|	unsigned int w_buf_pos = 0;
  467|       |
  468|  6.21k|	i_assert(!enc->finished);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  469|  6.21k|	enc->finishing = TRUE;
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  470|       |
  471|  6.21k|	dst_avail = 0;
  472|  6.21k|	if (dest != NULL)
  ------------------
  |  Branch (472:6): [True: 6.21k, False: 0]
  ------------------
  473|  6.21k|		dst_avail = buffer_get_avail_size(dest);
  474|       |
  475|  6.21k|	if (enc->w_buf_len > 0 || enc->pending_lf)  {
  ------------------
  |  Branch (475:6): [True: 0, False: 6.21k]
  |  Branch (475:28): [True: 0, False: 6.21k]
  ------------------
  476|      0|		if (dst_avail == 0)
  ------------------
  |  Branch (476:7): [True: 0, False: 0]
  ------------------
  477|      0|			return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  478|      0|		i_assert(enc->w_buf_len <= sizeof(enc->w_buf));
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  479|      0|	}
  480|       |
  481|  6.21k|	i_assert(enc->max_line_len > 0);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  482|  6.21k|	i_assert(enc->cur_line_len <= enc->max_line_len);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|  6.21k|	line_avail = enc->max_line_len - enc->cur_line_len;
  484|       |
  485|  6.21k|	switch (enc->sub_pos) {
  486|      0|	case 0:
  ------------------
  |  Branch (486:2): [True: 0, False: 6.21k]
  ------------------
  487|      0|		break;
  488|  6.21k|	case 1:
  ------------------
  |  Branch (488:2): [True: 6.21k, False: 0]
  ------------------
  489|  6.21k|		i_assert(enc->w_buf_len <= (sizeof(enc->w_buf) - 3));
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  490|  6.21k|		enc->w_buf[enc->w_buf_len] = b64enc[enc->buf];
  491|  6.21k|		enc->w_buf_len++;
  492|  6.21k|		if (padding) {
  ------------------
  |  Branch (492:7): [True: 6.21k, False: 0]
  ------------------
  493|  6.21k|			enc->w_buf[enc->w_buf_len + 0] =  '=';
  494|  6.21k|			enc->w_buf[enc->w_buf_len + 1] =  '=';
  495|  6.21k|			enc->w_buf_len += 2;
  496|  6.21k|		}
  497|  6.21k|		break;
  498|      0|	case 2:
  ------------------
  |  Branch (498:2): [True: 0, False: 6.21k]
  ------------------
  499|      0|		i_assert(enc->w_buf_len <= (sizeof(enc->w_buf) - 2));
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  500|      0|		enc->w_buf[enc->w_buf_len] = b64enc[enc->buf];
  501|      0|		enc->w_buf_len++;
  502|      0|		if (padding) {
  ------------------
  |  Branch (502:7): [True: 0, False: 0]
  ------------------
  503|      0|			enc->w_buf[enc->w_buf_len + 0] =  '=';
  504|      0|			enc->w_buf_len++;
  505|      0|		}
  506|      0|		break;
  507|      0|	default:
  ------------------
  |  Branch (507:2): [True: 0, False: 6.21k]
  ------------------
  508|      0|		i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
  509|  6.21k|	}
  510|  6.21k|	enc->sub_pos = 0;
  511|       |
  512|  6.21k|	write_full = write = enc->w_buf_len;
  513|  6.21k|	if (enc->pending_lf)
  ------------------
  |  Branch (513:6): [True: 0, False: 6.21k]
  ------------------
  514|      0|		write_full++;
  515|  6.21k|	if (enc->max_line_len < SIZE_MAX && line_avail < write) {
  ------------------
  |  Branch (515:6): [True: 0, False: 6.21k]
  |  Branch (515:38): [True: 0, False: 0]
  ------------------
  516|      0|		unsigned int lines;
  517|       |
  518|      0|		lines = I_MAX((write - line_avail) / enc->max_line_len, 1);
  ------------------
  |  |   36|      0|#define I_MAX(a, b)  (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  519|      0|		write_full += lines * (crlf ? 2 : 1);
  ------------------
  |  Branch (519:26): [True: 0, False: 0]
  ------------------
  520|  6.21k|	} else {
  521|  6.21k|		line_avail = write;
  522|  6.21k|	}
  523|       |
  524|  6.21k|	if (write_full == 0) {
  ------------------
  |  Branch (524:6): [True: 0, False: 6.21k]
  ------------------
  525|      0|		enc->finished = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  526|      0|		return TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  527|      0|	}
  528|       |
  529|  6.21k|	i_assert(dest != NULL);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  530|  6.21k|	if (write_full > dst_avail)
  ------------------
  |  Branch (530:6): [True: 0, False: 6.21k]
  ------------------
  531|      0|		write_full = dst_avail;
  532|       |
  533|  6.21k|	ptr = buffer_append_space_unsafe(dest, write_full);
  534|  6.21k|	end = ptr + write_full;
  535|  6.21k|	if (enc->pending_lf) {
  ------------------
  |  Branch (535:6): [True: 0, False: 6.21k]
  ------------------
  536|      0|		ptr[0] = '\n';
  537|      0|		dst_avail--;
  538|      0|		ptr++;
  539|      0|		enc->pending_lf = FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  540|      0|	}
  541|  6.21k|	if (line_avail > dst_avail)
  ------------------
  |  Branch (541:6): [True: 0, False: 6.21k]
  ------------------
  542|      0|		line_avail = dst_avail;
  543|  6.21k|	if (line_avail > 0) {
  ------------------
  |  Branch (543:6): [True: 6.21k, False: 0]
  ------------------
  544|  6.21k|		memcpy(ptr, enc->w_buf, line_avail);
  ------------------
  |  |   84|  6.21k|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
  545|  6.21k|		ptr += line_avail;
  546|  6.21k|		w_buf_pos += line_avail;
  547|  6.21k|	}
  548|  6.21k|	while (ptr < end && w_buf_pos < enc->w_buf_len) {
  ------------------
  |  Branch (548:9): [True: 0, False: 6.21k]
  |  Branch (548:22): [True: 0, False: 0]
  ------------------
  549|      0|		enc->cur_line_len = 0;
  550|      0|		if (crlf) {
  ------------------
  |  Branch (550:7): [True: 0, False: 0]
  ------------------
  551|      0|			ptr[0] = '\r';
  552|      0|			ptr++;
  553|      0|			if (ptr == end) {
  ------------------
  |  Branch (553:8): [True: 0, False: 0]
  ------------------
  554|      0|				enc->pending_lf = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  555|      0|				break;
  556|      0|			}
  557|      0|		}
  558|      0|		ptr[0] = '\n';
  559|      0|		ptr++;
  560|      0|		if (ptr == end)
  ------------------
  |  Branch (560:7): [True: 0, False: 0]
  ------------------
  561|      0|			break;
  562|       |
  563|      0|		write = I_MIN(enc->w_buf_len - w_buf_pos, enc->max_line_len);
  ------------------
  |  |   35|      0|#define I_MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  564|      0|		write = I_MIN(write, (size_t)(end - ptr));
  ------------------
  |  |   35|      0|#define I_MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  565|      0|		memcpy(ptr, &enc->w_buf[w_buf_pos], write);
  ------------------
  |  |   84|      0|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
  566|      0|		ptr += write;
  567|      0|		w_buf_pos += write;
  568|      0|		enc->cur_line_len += write;
  569|      0|		i_assert(ptr <= end);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  570|      0|	}
  571|  6.21k|	i_assert(ptr == end);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  572|  6.21k|	if (w_buf_pos < enc->w_buf_len) {
  ------------------
  |  Branch (572:6): [True: 0, False: 6.21k]
  ------------------
  573|      0|		enc->w_buf_len -= w_buf_pos;
  574|      0|		memmove(enc->w_buf, enc->w_buf + w_buf_pos, enc->w_buf_len);
  575|      0|		return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  576|      0|	}
  577|  6.21k|	if (enc->pending_lf)
  ------------------
  |  Branch (577:6): [True: 0, False: 6.21k]
  ------------------
  578|      0|		return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  579|  6.21k|	enc->finished = TRUE;
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  580|  6.21k|	return TRUE;
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  581|  6.21k|}
base64.c:base64_encode_get_out_size:
   57|  6.21k|{
   58|  6.21k|	size_t res_size = enc->w_buf_len;
   59|       |
   60|  6.21k|	i_assert(enc->w_buf_len <= sizeof(enc->w_buf));
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   61|       |
   62|  6.21k|	if (src_size == 0)
  ------------------
  |  Branch (62:6): [True: 0, False: 6.21k]
  ------------------
   63|      0|		return res_size;
   64|       |
   65|       |	/* Handle sub-position */
   66|  6.21k|	switch (enc->sub_pos) {
   67|  6.21k|	case 0:
  ------------------
  |  Branch (67:2): [True: 6.21k, False: 0]
  ------------------
   68|  6.21k|		break;
   69|      0|	case 1:
  ------------------
  |  Branch (69:2): [True: 0, False: 6.21k]
  ------------------
   70|      0|		res_size++;
   71|      0|		src_size--;
   72|      0|		if (src_size == 0)
  ------------------
  |  Branch (72:7): [True: 0, False: 0]
  ------------------
   73|      0|			return res_size;
   74|       |		/* fall through */
   75|      0|	case 2:
  ------------------
  |  Branch (75:2): [True: 0, False: 6.21k]
  ------------------
   76|      0|		res_size += 2;
   77|      0|		src_size--;
   78|      0|		break;
   79|      0|	default:
  ------------------
  |  Branch (79:2): [True: 0, False: 6.21k]
  ------------------
   80|      0|		i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
   81|  6.21k|	}
   82|       |
   83|       |	/* We're now at a 3-byte boundary */
   84|  6.21k|	if (src_size == 0)
  ------------------
  |  Branch (84:6): [True: 0, False: 6.21k]
  ------------------
   85|      0|		return res_size;
   86|       |
   87|       |	/* Calculate size we can append to the output from remaining input */
   88|  6.21k|	res_size += ((src_size) / 3) * 4;
   89|  6.21k|	switch (src_size % 3) {
  ------------------
  |  Branch (89:10): [True: 0, False: 6.21k]
  ------------------
   90|      0|	case 0:
  ------------------
  |  Branch (90:2): [True: 0, False: 6.21k]
  ------------------
   91|      0|		break;
   92|  6.21k|	case 1:
  ------------------
  |  Branch (92:2): [True: 6.21k, False: 0]
  ------------------
   93|  6.21k|		res_size += 1;
   94|  6.21k|		break;
   95|      0|	case 2:
  ------------------
  |  Branch (95:2): [True: 0, False: 6.21k]
  ------------------
   96|      0|		res_size += 2;
   97|      0|		break;
   98|  6.21k|	}
   99|  6.21k|	return res_size;
  100|  6.21k|}
base64.c:base64_encode_more_data:
  221|  6.21k|{
  222|  6.21k|	const struct base64_scheme *b64 = enc->b64;
  223|  6.21k|	const char *b64enc = b64->encmap;
  224|  6.21k|	size_t res_size;
  225|  6.21k|	unsigned char *start, *ptr, *end;
  226|  6.21k|	size_t src_pos;
  227|       |
  228|  6.21k|	i_assert(!enc->pending_lf);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  229|       |
  230|       |	/* determine how much we can write in destination buffer */
  231|  6.21k|	if (dst_avail == 0) {
  ------------------
  |  Branch (231:6): [True: 0, False: 6.21k]
  ------------------
  232|      0|		*src_pos_r = 0;
  233|      0|		return;
  234|      0|	}
  235|       |
  236|       |	/* pre-allocate space in the destination buffer */
  237|  6.21k|	res_size = base64_encode_get_out_size(enc, src_size);
  238|  6.21k|	if (res_size > dst_avail)
  ------------------
  |  Branch (238:6): [True: 0, False: 6.21k]
  ------------------
  239|      0|		res_size = dst_avail;
  240|       |
  241|  6.21k|	start = buffer_append_space_unsafe(dest, res_size);
  242|  6.21k|	end = start + res_size;
  243|  6.21k|	ptr = start;
  244|       |
  245|       |	/* write bytes not written in previous call */
  246|  6.21k|	i_assert(enc->w_buf_len <= sizeof(enc->w_buf));
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  247|  6.21k|	if (enc->w_buf_len > res_size) {
  ------------------
  |  Branch (247:6): [True: 0, False: 6.21k]
  ------------------
  248|      0|		memcpy(ptr, enc->w_buf, res_size);
  ------------------
  |  |   84|      0|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
  249|      0|		ptr += res_size;
  250|      0|		enc->w_buf_len -= res_size;
  251|      0|		memmove(enc->w_buf, enc->w_buf + res_size, enc->w_buf_len);
  252|  6.21k|	} else if (enc->w_buf_len > 0) {
  ------------------
  |  Branch (252:13): [True: 0, False: 6.21k]
  ------------------
  253|      0|		memcpy(ptr, enc->w_buf, enc->w_buf_len);
  ------------------
  |  |   84|      0|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
  254|      0|		ptr += enc->w_buf_len;
  255|      0|		enc->w_buf_len = 0;
  256|      0|	}
  257|  6.21k|	if (ptr == end) {
  ------------------
  |  Branch (257:6): [True: 0, False: 6.21k]
  ------------------
  258|      0|		*src_pos_r = 0;
  259|      0|		return;
  260|      0|	}
  261|  6.21k|	i_assert(enc->w_buf_len == 0);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  262|  6.21k|	i_assert(src_size != 0);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  263|       |
  264|       |	/* Handle sub-position */
  265|  6.21k|	src_pos = 0;
  266|  6.21k|	switch (enc->sub_pos) {
  267|  6.21k|	case 0:
  ------------------
  |  Branch (267:2): [True: 6.21k, False: 0]
  ------------------
  268|  6.21k|		break;
  269|      0|	case 1:
  ------------------
  |  Branch (269:2): [True: 0, False: 6.21k]
  ------------------
  270|      0|		i_assert(ptr < end);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  271|      0|		ptr[0] = b64enc[enc->buf | (src_c[src_pos] >> 4)];
  272|      0|		ptr++;
  273|      0|		enc->buf = (src_c[src_pos] & 0x0f) << 2;
  274|      0|		src_pos++;
  275|      0|		if (src_pos == src_size || ptr == end) {
  ------------------
  |  Branch (275:7): [True: 0, False: 0]
  |  Branch (275:30): [True: 0, False: 0]
  ------------------
  276|      0|			enc->sub_pos = 2;
  277|      0|			*src_pos_r = src_pos;
  278|      0|			return;
  279|      0|		}
  280|       |		/* fall through */
  281|      0|	case 2:
  ------------------
  |  Branch (281:2): [True: 0, False: 6.21k]
  ------------------
  282|      0|		ptr[0] = b64enc[enc->buf | ((src_c[src_pos] & 0xc0) >> 6)];
  283|      0|		enc->w_buf[0] = b64enc[src_c[src_pos] & 0x3f];
  284|      0|		ptr++;
  285|      0|		src_pos++;
  286|      0|		if (ptr < end) {
  ------------------
  |  Branch (286:7): [True: 0, False: 0]
  ------------------
  287|      0|			ptr[0] = enc->w_buf[0];
  288|      0|			ptr++;
  289|      0|			enc->w_buf_len = 0;
  290|      0|		} else {
  291|      0|			enc->sub_pos = 0;
  292|      0|			enc->w_buf_len = 1;
  293|      0|			*src_pos_r = src_pos;
  294|      0|			return;
  295|      0|		}
  296|      0|		break;
  297|      0|	default:
  ------------------
  |  Branch (297:2): [True: 0, False: 6.21k]
  ------------------
  298|      0|		i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
  299|  6.21k|	}
  300|  6.21k|	enc->sub_pos = 0;
  301|       |
  302|       |	/* We're now at a 3-byte boundary */
  303|  6.21k|	if (src_pos == src_size) {
  ------------------
  |  Branch (303:6): [True: 0, False: 6.21k]
  ------------------
  304|      0|		i_assert(ptr == end);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  305|      0|		*src_pos_r = src_pos;
  306|      0|		return;
  307|      0|	}
  308|       |
  309|       |	/* Convert the bulk */
  310|  37.2k|	for (; src_size - src_pos > 2 && &ptr[3] < end;
  ------------------
  |  Branch (310:9): [True: 31.0k, False: 6.21k]
  |  Branch (310:35): [True: 31.0k, False: 0]
  ------------------
  311|  31.0k|	     src_pos += 3, ptr += 4) {
  312|  31.0k|		ptr[0] = b64enc[src_c[src_pos] >> 2];
  313|  31.0k|		ptr[1] = b64enc[((src_c[src_pos] & 0x03) << 4) |
  314|  31.0k|				(src_c[src_pos+1] >> 4)];
  315|  31.0k|		ptr[2] = b64enc[((src_c[src_pos+1] & 0x0f) << 2) |
  316|  31.0k|				((src_c[src_pos+2] & 0xc0) >> 6)];
  317|  31.0k|		ptr[3] = b64enc[src_c[src_pos+2] & 0x3f];
  318|  31.0k|	}
  319|       |
  320|       |	/* Convert the bytes beyond the last 3-byte boundary and update state
  321|       |	   for next call */
  322|  6.21k|	switch (src_size - src_pos) {
  323|      0|	case 0:
  ------------------
  |  Branch (323:2): [True: 0, False: 6.21k]
  ------------------
  324|      0|		enc->sub_pos = 0;
  325|      0|		enc->buf = 0;
  326|      0|		break;
  327|  6.21k|	case 1:
  ------------------
  |  Branch (327:2): [True: 6.21k, False: 0]
  ------------------
  328|  6.21k|		enc->sub_pos = 1;
  329|  6.21k|		enc->w_buf[0] = b64enc[src_c[src_pos] >> 2];
  330|  6.21k|		enc->w_buf_len = 1;
  331|  6.21k|		enc->buf = (src_c[src_pos] & 0x03) << 4;
  332|  6.21k|		src_pos++;
  333|  6.21k|		break;
  334|      0|	case 2:
  ------------------
  |  Branch (334:2): [True: 0, False: 6.21k]
  ------------------
  335|      0|		enc->sub_pos = 2;
  336|      0|		enc->w_buf[0] = b64enc[src_c[src_pos] >> 2];
  337|      0|		enc->w_buf[1] = b64enc[((src_c[src_pos] & 0x03) << 4) |
  338|      0|				       (src_c[src_pos+1] >> 4)];
  339|      0|		enc->w_buf_len = 2;
  340|      0|		enc->buf = (src_c[src_pos+1] & 0x0f) << 2;
  341|      0|		src_pos += 2;
  342|      0|		break;
  343|      0|	default:
  ------------------
  |  Branch (343:2): [True: 0, False: 6.21k]
  ------------------
  344|       |		/* hit the end of the destination buffer */
  345|      0|		enc->sub_pos = 0;
  346|      0|		enc->w_buf[0] = b64enc[src_c[src_pos] >> 2];
  347|      0|		enc->w_buf[1] = b64enc[((src_c[src_pos] & 0x03) << 4) |
  348|      0|				       (src_c[src_pos+1] >> 4)];
  349|      0|		enc->w_buf[2] = b64enc[((src_c[src_pos+1] & 0x0f) << 2) |
  350|      0|				       ((src_c[src_pos+2] & 0xc0) >> 6)];
  351|      0|		enc->w_buf[3] = b64enc[src_c[src_pos+2] & 0x3f];
  352|      0|		enc->w_buf_len = 4;
  353|      0|		enc->buf = 0;
  354|      0|		src_pos += 3;
  355|  6.21k|	}
  356|       |
  357|       |	/* fill the remaining allocated space */
  358|  6.21k|	i_assert(ptr <= end);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  359|  6.21k|	res_size = end - ptr;
  360|  6.21k|	i_assert(enc->w_buf_len <= sizeof(enc->w_buf));
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  361|  6.21k|	if (enc->w_buf_len > res_size) {
  ------------------
  |  Branch (361:6): [True: 0, False: 6.21k]
  ------------------
  362|      0|		memcpy(ptr, enc->w_buf, res_size);
  ------------------
  |  |   84|      0|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
  363|      0|		ptr += res_size;
  364|      0|		enc->w_buf_len -= res_size;
  365|      0|		memmove(enc->w_buf, enc->w_buf + res_size, enc->w_buf_len);
  366|  6.21k|	} else if (enc->w_buf_len > 0) {
  ------------------
  |  Branch (366:13): [True: 6.21k, False: 0]
  ------------------
  367|  6.21k|		memcpy(ptr, enc->w_buf, enc->w_buf_len);
  ------------------
  |  |   84|  6.21k|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
  368|  6.21k|		ptr += enc->w_buf_len;
  369|  6.21k|		enc->w_buf_len = 0;
  370|  6.21k|	}
  371|       |
  372|  6.21k|	i_assert(ptr == end);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  373|  6.21k|	*src_pos_r = src_pos;
  374|  6.21k|}

smtp-server-connection.c:base64_encode:
  286|  6.21k|{
  287|  6.21k|	base64_scheme_encode(&base64_scheme, 0, 0, src, src_size, dest);
  288|  6.21k|}
smtp-server-connection.c:base64_scheme_encode:
  213|  6.21k|{
  214|  6.21k|	struct base64_encoder enc;
  215|       |
  216|  6.21k|	base64_encode_init(&enc, b64, flags, max_line_len);
  217|  6.21k|	base64_encode_more(&enc, src, src_size, NULL, dest);
  218|  6.21k|	base64_encode_finish(&enc, dest);
  219|  6.21k|}
smtp-server-connection.c:base64_encode_init:
   64|  6.21k|{
   65|  6.21k|	i_zero(enc);
  ------------------
  |  |  249|  6.21k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   66|  6.21k|	enc->b64 = b64;
   67|  6.21k|	enc->flags = flags;
   68|  6.21k|	enc->max_line_len = (max_line_len == 0 ? SIZE_MAX : max_line_len);
  ------------------
  |  Branch (68:23): [True: 6.21k, False: 0]
  ------------------
   69|  6.21k|}

nearest_power:
   16|   186k|{
   17|   186k|	i_assert(num <= ((size_t)1 << (CHAR_BIT*sizeof(size_t) - 1)));
  ------------------
  |  |  219|   186k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   186k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   186k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   186k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 186k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 186k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   186k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   186k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   186k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   18|       |
   19|   186k|	if (num == 0)
  ------------------
  |  Branch (19:6): [True: 0, False: 186k]
  ------------------
   20|      0|		return 1;
   21|       |
   22|   186k|	return 1UL << BITS_REQUIRED(num - 1);
  ------------------
  |  |   10|   186k|#define BITS_REQUIRED(x)	bits_required64(x)
  ------------------
   23|   186k|}

bits.c:bits_required64:
   49|   186k|{
   50|   186k|	return num == 0 ? 0 : 64 - __builtin_clzll(num);
  ------------------
  |  Branch (50:9): [True: 54, False: 186k]
  ------------------
   51|   186k|}

buffer_create_dynamic:
  161|   306k|{
  162|   306k|	return buffer_create_dynamic_max(pool, init_size, SIZE_MAX);
  163|   306k|}
buffer_create_dynamic_max:
  167|   863k|{
  168|   863k|	struct real_buffer *buf;
  169|       |
  170|       |#ifdef DEBUG
  171|       |	/* we increment this by 1 later on, so if it's SIZE_MAX
  172|       |	   it turns into 0 and hides a potential bug.
  173|       |
  174|       |	   Too scary to use in production for now, though. This
  175|       |	   can change in future. */
  176|       |	i_assert(init_size < SIZE_MAX);
  177|       |#endif
  178|       |
  179|   863k|	buf = p_new(pool, struct real_buffer, 1);
  ------------------
  |  |   97|   863k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|   863k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|   863k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|   863k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|   863k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  180|   863k|	buf->pool = pool;
  181|   863k|	buf->dynamic = TRUE;
  ------------------
  |  |   15|   863k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   863k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  182|   863k|	buf->max_size = max_size;
  183|       |	/* buffer_alloc() reserves +1 for str_c() NIL, so add +1 here to
  184|       |	   init_size so we can actually write that much to the buffer without
  185|       |	   realloc */
  186|   863k|	buffer_alloc(buf, init_size+1);
  187|   863k|	return &buf->buf;
  188|   863k|}
buffer_free:
  191|   264k|{
  192|   264k|	if (*_buf == NULL)
  ------------------
  |  Branch (192:6): [True: 123k, False: 141k]
  ------------------
  193|   123k|		return;
  194|   141k|	struct real_buffer *buf = container_of(*_buf, struct real_buffer, buf);
  ------------------
  |  |   30|   141k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|   141k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|   141k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|   141k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|   141k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|   141k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  195|       |
  196|   141k|	*_buf = NULL;
  197|   141k|	if (buf->alloced)
  ------------------
  |  Branch (197:6): [True: 141k, False: 0]
  ------------------
  198|   141k|		p_free(buf->pool, buf->w_buffer);
  ------------------
  |  |  131|   141k|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|   141k|#  define STMT_START do
  |  |  ------------------
  |  |  132|   141k|		p_free_internal(pool, mem);	\
  |  |  133|   141k|		(mem) = NULL;			\
  |  |  134|   141k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|   141k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  199|   141k|	if (buf->pool != NULL)
  ------------------
  |  Branch (199:6): [True: 141k, False: 0]
  ------------------
  200|   141k|		p_free(buf->pool, buf);
  ------------------
  |  |  131|   141k|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|   141k|#  define STMT_START do
  |  |  ------------------
  |  |  132|   141k|		p_free_internal(pool, mem);	\
  |  |  133|   141k|		(mem) = NULL;			\
  |  |  134|   141k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|   141k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  201|   141k|}
buffer_write:
  225|  16.3k|{
  226|  16.3k|	struct real_buffer *buf = container_of(_buf, struct real_buffer, buf);
  ------------------
  |  |   30|  16.3k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  16.3k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  16.3k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  16.3k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  16.3k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  16.3k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  227|       |
  228|  16.3k|	buffer_check_limits(buf, pos, data_size);
  229|  16.3k|	if (data_size > 0)
  ------------------
  |  Branch (229:6): [True: 16.3k, False: 0]
  ------------------
  230|  16.3k|		memcpy(buf->w_buffer + pos, data, data_size);
  231|  16.3k|}
buffer_append:
  234|  1.12M|{
  235|  1.12M|	struct real_buffer *buf = container_of(_buf, struct real_buffer, buf);
  ------------------
  |  |   30|  1.12M|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  1.12M|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  1.12M|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  1.12M|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  1.12M|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  1.12M|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  236|       |
  237|  1.12M|	if (data_size > 0) {
  ------------------
  |  Branch (237:6): [True: 1.08M, False: 43.0k]
  ------------------
  238|  1.08M|		size_t pos = buf->used;
  239|  1.08M|		buffer_check_append_limits(buf, data_size);
  240|  1.08M|		memcpy(buf->w_buffer + pos, data, data_size);
  241|  1.08M|	}
  242|  1.12M|}
buffer_append_c:
  245|   334k|{
  246|   334k|	struct real_buffer *buf = container_of(_buf, struct real_buffer, buf);
  ------------------
  |  |   30|   334k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|   334k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|   334k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|   334k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|   334k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|   334k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  247|   334k|	size_t pos = buf->used;
  248|       |
  249|   334k|	buffer_check_append_limits(buf, 1);
  250|   334k|	buf->w_buffer[pos] = chr;
  251|   334k|}
buffer_insert:
  255|  19.5k|{
  256|  19.5k|	struct real_buffer *buf = container_of(_buf, struct real_buffer, buf);
  ------------------
  |  |   30|  19.5k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  19.5k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  19.5k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  19.5k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  19.5k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  19.5k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  257|       |
  258|  19.5k|	if (pos >= buf->used)
  ------------------
  |  Branch (258:6): [True: 10.1k, False: 9.44k]
  ------------------
  259|  10.1k|		buffer_write(_buf, pos, data, data_size);
  260|  9.44k|	else if (data_size > 0) {
  ------------------
  |  Branch (260:11): [True: 9.44k, False: 0]
  ------------------
  261|  9.44k|		buffer_copy(_buf, pos + data_size, _buf, pos, SIZE_MAX);
  262|  9.44k|		memcpy(buf->w_buffer + pos, data, data_size);
  263|  9.44k|	}
  264|  19.5k|}
buffer_delete:
  267|  64.5k|{
  268|  64.5k|	struct real_buffer *buf = container_of(_buf, struct real_buffer, buf);
  ------------------
  |  |   30|  64.5k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  64.5k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  64.5k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  64.5k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  64.5k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  64.5k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  269|  64.5k|	size_t end_size;
  270|       |
  271|  64.5k|	if (pos >= buf->used)
  ------------------
  |  Branch (271:6): [True: 0, False: 64.5k]
  ------------------
  272|      0|		return;
  273|  64.5k|	end_size = buf->used - pos;
  274|       |
  275|  64.5k|	if (size < end_size) {
  ------------------
  |  Branch (275:6): [True: 0, False: 64.5k]
  ------------------
  276|       |		/* delete from between */
  277|      0|		end_size -= size;
  278|      0|		memmove(buf->w_buffer + pos,
  279|      0|			buf->w_buffer + pos + size, end_size);
  280|  64.5k|	} else {
  281|       |		/* delete the rest of the buffer */
  282|  64.5k|		end_size = 0;
  283|  64.5k|	}
  284|       |
  285|  64.5k|	buffer_set_used_size(_buf, pos + end_size);
  286|  64.5k|}
buffer_write_zero:
  323|   115k|{
  324|   115k|	struct real_buffer *buf = container_of(_buf, struct real_buffer, buf);
  ------------------
  |  |   30|   115k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|   115k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|   115k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|   115k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|   115k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|   115k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  325|       |
  326|   115k|	buffer_check_limits(buf, pos, data_size);
  327|   115k|	memset(buf->w_buffer + pos, 0, data_size);
  328|   115k|}
buffer_copy:
  353|  9.44k|{
  354|  9.44k|	struct real_buffer *dest = container_of(_dest, struct real_buffer, buf);
  ------------------
  |  |   30|  9.44k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  9.44k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  9.44k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  9.44k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  9.44k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  9.44k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  355|  9.44k|	const struct real_buffer *src =
  356|  9.44k|		container_of(_src, const struct real_buffer, buf);
  ------------------
  |  |   30|  9.44k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  9.44k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  9.44k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  9.44k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  9.44k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  9.44k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  357|  9.44k|	size_t max_size;
  358|       |
  359|  9.44k|	i_assert(src_pos <= src->used);
  ------------------
  |  |  219|  9.44k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  9.44k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  9.44k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  9.44k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 9.44k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 9.44k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  9.44k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  9.44k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  9.44k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  360|       |
  361|  9.44k|	max_size = src->used - src_pos;
  362|  9.44k|	if (copy_size > max_size)
  ------------------
  |  Branch (362:6): [True: 9.44k, False: 0]
  ------------------
  363|  9.44k|		copy_size = max_size;
  364|       |
  365|  9.44k|	buffer_check_limits(dest, dest_pos, copy_size);
  366|  9.44k|	i_assert(src->r_buffer != NULL);
  ------------------
  |  |  219|  9.44k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  9.44k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  9.44k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  9.44k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 9.44k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 9.44k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  9.44k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  9.44k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  9.44k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  367|       |
  368|  9.44k|	if (src == dest) {
  ------------------
  |  Branch (368:6): [True: 9.44k, False: 0]
  ------------------
  369|  9.44k|		memmove(dest->w_buffer + dest_pos,
  370|  9.44k|			CONST_PTR_OFFSET(src->r_buffer, src_pos), copy_size);
  ------------------
  |  |   27|  9.44k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  ------------------
  371|  9.44k|	} else {
  372|      0|		memcpy(dest->w_buffer + dest_pos,
  373|      0|		       CONST_PTR_OFFSET(src->r_buffer, src_pos), copy_size);
  ------------------
  |  |   27|      0|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  ------------------
  374|      0|	}
  375|  9.44k|}
buffer_get_space_unsafe:
  384|  1.26M|{
  385|  1.26M|	struct real_buffer *buf = container_of(_buf, struct real_buffer, buf);
  ------------------
  |  |   30|  1.26M|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  1.26M|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  1.26M|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  1.26M|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  1.26M|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  1.26M|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  386|       |
  387|  1.26M|	buffer_check_limits(buf, pos, size);
  388|  1.26M|	return buf->w_buffer + pos;
  389|  1.26M|}
buffer_append_space_unsafe:
  392|  1.13M|{
  393|       |	/* NOTE: can't use buffer_check_append_limits() here because it doesn't
  394|       |	   guarantee that the buffer is zero-filled. */
  395|  1.13M|	return buffer_get_space_unsafe(buf, buf->used, size);
  396|  1.13M|}
buffer_get_modifiable_data:
  399|  1.00M|{
  400|  1.00M|	const struct real_buffer *buf =
  401|  1.00M|		container_of(_buf, const struct real_buffer, buf);
  ------------------
  |  |   30|  1.00M|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  1.00M|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  1.00M|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  1.00M|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  1.00M|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  1.00M|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  402|       |
  403|  1.00M|	if (used_size_r != NULL)
  ------------------
  |  Branch (403:6): [True: 0, False: 1.00M]
  ------------------
  404|      0|		*used_size_r = buf->used;
  405|  1.00M|	i_assert(buf->used == 0 || buf->w_buffer != NULL);
  ------------------
  |  |  219|  1.00M|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  1.00M|#  define STMT_START do
  |  |  ------------------
  |  |  220|  1.00M|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  2.01M|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1.00M]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 1.00M]
  |  |  |  |  |  Branch (202:45): [True: 1.00M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  1.00M|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  1.00M|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.00M|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  406|  1.00M|	return buf->w_buffer;
  407|  1.00M|}
buffer_set_used_size:
  410|   119k|{
  411|   119k|	struct real_buffer *buf = container_of(_buf, struct real_buffer, buf);
  ------------------
  |  |   30|   119k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|   119k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|   119k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|   119k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|   119k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|   119k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  412|       |
  413|   119k|	i_assert(used_size <= buf->alloc);
  ------------------
  |  |  219|   119k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   119k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   119k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   119k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 119k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 119k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   119k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   119k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   119k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  414|       |
  415|   119k|	if (buf->used > buf->dirty)
  ------------------
  |  Branch (415:6): [True: 48.4k, False: 71.3k]
  ------------------
  416|  48.4k|		buf->dirty = buf->used;
  417|       |
  418|   119k|	buf->used = used_size;
  419|   119k|}
buffer_get_size:
  432|   365k|{
  433|   365k|	const struct real_buffer *buf =
  434|   365k|		container_of(_buf, const struct real_buffer, buf);
  ------------------
  |  |   30|   365k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|   365k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|   365k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|   365k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|   365k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|   365k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  435|       |
  436|   365k|	return buf->alloc;
  437|   365k|}
buffer_get_writable_size:
  440|  65.2k|{
  441|  65.2k|	const struct real_buffer *buf =
  442|  65.2k|		container_of(_buf, const struct real_buffer, buf);
  ------------------
  |  |   30|  65.2k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  65.2k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  65.2k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  65.2k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  65.2k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  65.2k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  443|       |
  444|       |	/* Use buf->writable_size instead of buf->alloc to reserve +1 for
  445|       |	   str_c() NUL in buffer_check_limits(). Otherwise the caller might
  446|       |	   increase the buffer's alloc size unnecessarily when it just wants
  447|       |	   to access the entire buffer. */
  448|  65.2k|	return buf->writable_size;
  449|  65.2k|}
buffer_get_avail_size:
  452|  12.4k|{
  453|  12.4k|	const struct real_buffer *buf =
  454|  12.4k|		container_of(_buf, const struct real_buffer, buf);
  ------------------
  |  |   30|  12.4k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  12.4k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  12.4k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  12.4k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  12.4k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  12.4k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  455|       |
  456|  12.4k|	i_assert(buf->alloc >= buf->used);
  ------------------
  |  |  219|  12.4k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  12.4k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  12.4k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  12.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 12.4k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 12.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  12.4k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  12.4k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.4k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  457|  12.4k|	return ((buf->dynamic ? SIZE_MAX : buf->alloc) - buf->used);
  ------------------
  |  Branch (457:11): [True: 12.4k, False: 0]
  ------------------
  458|  12.4k|}
buffer.c:buffer_alloc:
   34|   870k|{
   35|   870k|	i_assert(buf->w_buffer == NULL || buf->alloced);
  ------------------
  |  |  219|   870k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   870k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   870k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   876k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 870k]
  |  |  |  |  |  Branch (202:45): [True: 863k, False: 6.54k]
  |  |  |  |  |  Branch (202:45): [True: 6.54k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   870k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   870k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   870k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   36|       |
   37|   870k|	if (size == buf->alloc)
  ------------------
  |  Branch (37:6): [True: 0, False: 870k]
  ------------------
   38|      0|		return;
   39|       |
   40|   870k|	i_assert(size > buf->alloc);
  ------------------
  |  |  219|   870k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   870k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   870k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   870k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 870k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 870k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   870k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   870k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   870k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   41|       |
   42|   870k|	if (buf->w_buffer == NULL)
  ------------------
  |  Branch (42:6): [True: 863k, False: 6.54k]
  ------------------
   43|   863k|		buf->w_buffer = p_malloc(buf->pool, size);
   44|  6.54k|	else
   45|  6.54k|		buf->w_buffer = p_realloc(buf->pool, buf->w_buffer, buf->alloc, size);
   46|   870k|	buf->alloc = size;
   47|   870k|	buf->writable_size = size-1; /* -1 for str_c() NUL */
   48|       |
   49|   870k|	buf->r_buffer = buf->w_buffer;
   50|   870k|	buf->alloced = TRUE;
  ------------------
  |  |   15|   870k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   870k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   51|   870k|}
buffer.c:buffer_check_limits:
   55|  1.41M|{
   56|  1.41M|	size_t new_size;
   57|       |
   58|  1.41M|	if (unlikely(buf->max_size - pos < data_size))
  ------------------
  |  |  202|  1.41M|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 1.41M]
  |  |  |  Branch (202:44): [True: 0, False: 1.41M]
  |  |  ------------------
  ------------------
   59|      0|		i_panic("Buffer write out of range (%zu + %zu)", pos, data_size);
   60|       |
   61|  1.41M|	new_size = pos + data_size;
   62|       |
   63|  1.41M|	if (new_size > buf->used && buf->used < buf->dirty) {
  ------------------
  |  Branch (63:6): [True: 1.32M, False: 87.6k]
  |  Branch (63:30): [True: 7.77k, False: 1.31M]
  ------------------
   64|       |		/* clear used..dirty area */
   65|  7.77k|		size_t max = I_MIN(I_MIN(buf->alloc, buf->dirty), new_size);
  ------------------
  |  |   35|  15.5k|#define I_MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 1.55k, False: 6.21k]
  |  |  |  Branch (35:25): [True: 0, False: 7.77k]
  |  |  |  Branch (35:38): [True: 0, False: 1.55k]
  |  |  ------------------
  ------------------
   66|       |
   67|  7.77k|		memset(buf->w_buffer + buf->used, 0, max - buf->used);
   68|  7.77k|	}
   69|       |
   70|       |	/* Use buf->writable_size instead of buf->alloc to always keep +1 byte
   71|       |	   available in case str_c() is called for this buffer. This is mainly
   72|       |	   for cases where the buffer is allocated from data stack, and str_c()
   73|       |	   is called in a separate stack frame. */
   74|  1.41M|	if (new_size > buf->writable_size) {
  ------------------
  |  Branch (74:6): [True: 6.54k, False: 1.40M]
  ------------------
   75|  6.54k|		if (unlikely(!buf->dynamic)) {
  ------------------
  |  |  202|  6.54k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 6.54k]
  |  |  |  Branch (202:44): [True: 0, False: 6.54k]
  |  |  ------------------
  ------------------
   76|      0|			i_panic("Buffer full (%zu > %zu, pool %s)",
   77|      0|				pos + data_size, buf->alloc,
   78|      0|				buf->pool == NULL ? "<none>" :
  ------------------
  |  Branch (78:5): [True: 0, False: 0]
  ------------------
   79|      0|				pool_get_name(buf->pool));
   80|      0|		}
   81|       |
   82|  6.54k|		size_t new_alloc_size =
   83|  6.54k|			pool_get_exp_grown_size(buf->pool, buf->alloc,
   84|  6.54k|						new_size + 1);
   85|  6.54k|		if (new_alloc_size > buf->max_size) {
  ------------------
  |  Branch (85:7): [True: 0, False: 6.54k]
  ------------------
   86|       |			/* limit to max_size, but do include +1 for
   87|       |			   str_c() NUL */
   88|      0|			new_alloc_size = buf->max_size + 1;
   89|      0|		}
   90|  6.54k|		buffer_alloc(buf, new_alloc_size);
   91|  6.54k|	}
   92|       |#if 0
   93|       |	else if (new_size > buf->used && buf->alloced &&
   94|       |		 !buf->pool->alloconly_pool && !buf->pool->datastack_pool) {
   95|       |		void *new_buf;
   96|       |
   97|       |		/* buffer's size increased: move the buffer's memory elsewhere.
   98|       |		   this should help catch bugs where old pointers are tried to
   99|       |		   be used to access the buffer's memory */
  100|       |		new_buf = p_malloc(buf->pool, buf->alloc);
  101|       |		memcpy(new_buf, buf->w_buffer, buf->alloc);
  102|       |		p_free(buf->pool, buf->w_buffer);
  103|       |
  104|       |		buf->w_buffer = new_buf;
  105|       |		buf->r_buffer = new_buf;
  106|       |	}
  107|       |#endif
  108|       |
  109|  1.41M|	if (new_size > buf->used)
  ------------------
  |  Branch (109:6): [True: 1.32M, False: 87.6k]
  ------------------
  110|  1.32M|		buf->used = new_size;
  111|  1.41M|	i_assert(buf->used <= buf->alloc);
  ------------------
  |  |  219|  1.41M|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  1.41M|#  define STMT_START do
  |  |  ------------------
  |  |  220|  1.41M|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  1.41M|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1.41M]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1.41M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  1.41M|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  1.41M|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.41M|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  112|  1.41M|	i_assert(buf->w_buffer != NULL);
  ------------------
  |  |  219|  1.41M|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  1.41M|#  define STMT_START do
  |  |  ------------------
  |  |  220|  1.41M|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  1.41M|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1.41M]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1.41M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  1.41M|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  1.41M|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.41M|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  113|  1.41M|}
buffer.c:buffer_check_append_limits:
  117|  1.41M|{
  118|       |	/* Fast path: See if data to be appended fits into allocated buffer.
  119|       |	   If it does, we don't even need to memset() the dirty buffer since
  120|       |	   it's going to be filled with the newly appended data. */
  121|  1.41M|	if (buf->writable_size - buf->used < data_size)
  ------------------
  |  Branch (121:6): [True: 6.53k, False: 1.41M]
  ------------------
  122|  6.53k|		buffer_check_limits(buf, buf->used, data_size);
  123|  1.41M|	else
  124|  1.41M|		buf->used += data_size;
  125|  1.41M|}

connection_input_halt:
  270|  84.8k|{
  271|  84.8k|	io_remove(&conn->io);
  272|  84.8k|	timeout_remove(&conn->to);
  273|  84.8k|}
connection_input_resume:
  301|  38.1k|{
  302|  38.1k|	connection_input_resume_full(conn, TRUE);
  ------------------
  |  |   15|  38.1k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  38.1k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  303|  38.1k|}
connection_update_event:
  427|  6.21k|{
  428|  6.21k|	string_t *prefix;
  429|       |
  430|  6.21k|	prefix = t_str_new(64);
  431|  6.21k|	str_append(prefix, "conn");
  432|  6.21k|	if (strlen(conn->label) > 0) {
  ------------------
  |  Branch (432:6): [True: 6.21k, False: 0]
  ------------------
  433|  6.21k|		str_append_c(prefix, ' ');
  ------------------
  |  |   54|  6.21k|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|  6.21k|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|  6.21k|			(unsigned char)(chr), (chr)))
  ------------------
  434|  6.21k|		str_append(prefix, conn->label);
  435|  6.21k|	}
  436|  6.21k|	str_append(prefix, ": ");
  437|  6.21k|	event_set_append_log_prefix(conn->event, str_c(prefix));
  438|       |
  439|  6.21k|	if (conn->local_ip.family > 0) {
  ------------------
  |  Branch (439:6): [True: 0, False: 6.21k]
  ------------------
  440|      0|		event_add_str(conn->event, conn->list->set.client ?
  ------------------
  |  Branch (440:30): [True: 0, False: 0]
  ------------------
  441|      0|			      "source_ip" : "local_ip",
  442|      0|			      net_ip2addr(&conn->local_ip));
  443|      0|	}
  444|       |
  445|  6.21k|	if (conn->remote_ip.family > 0) {
  ------------------
  |  Branch (445:6): [True: 0, False: 6.21k]
  ------------------
  446|      0|		event_add_str(conn->event, conn->list->set.client ?
  ------------------
  |  Branch (446:30): [True: 0, False: 0]
  ------------------
  447|      0|			      "dest_ip" : "remote_ip",
  448|      0|			      net_ip2addr(&conn->remote_ip));
  449|      0|	}
  450|  6.21k|	if (conn->remote_port > 0) {
  ------------------
  |  Branch (450:6): [True: 0, False: 6.21k]
  ------------------
  451|      0|		event_add_int(conn->event, conn->list->set.client ?
  ------------------
  |  Branch (451:30): [True: 0, False: 0]
  ------------------
  452|      0|			      "dest_port" : "remote_port",
  453|      0|			      conn->remote_port);
  454|      0|	}
  455|       |
  456|  6.21k|	if (conn->remote_pid != (pid_t)-1)
  ------------------
  |  Branch (456:6): [True: 6.21k, False: 0]
  ------------------
  457|  6.21k|		event_add_int(conn->event, "remote_pid", conn->remote_pid);
  458|  6.21k|	if (conn->remote_uid != (uid_t)-1)
  ------------------
  |  Branch (458:6): [True: 6.21k, False: 0]
  ------------------
  459|  6.21k|		event_add_int(conn->event, "remote_uid", conn->remote_uid);
  460|  6.21k|	if (conn->remote_gid != (gid_t)-1)
  ------------------
  |  Branch (460:6): [True: 6.21k, False: 0]
  ------------------
  461|  6.21k|		event_add_int(conn->event, "remote_gid", conn->remote_gid);
  462|  6.21k|}
connection_update_properties:
  465|  6.21k|{
  466|  6.21k|	int fd = (conn->fd_in < 0 ? conn->fd_out : conn->fd_in);
  ------------------
  |  Branch (466:12): [True: 0, False: 6.21k]
  ------------------
  467|  6.21k|	struct net_unix_cred cred;
  468|       |
  469|  6.21k|	if (conn->remote_ip.family != 0) {
  ------------------
  |  Branch (469:6): [True: 0, False: 6.21k]
  ------------------
  470|       |		/* remote IP was already set */
  471|  6.21k|	} else if (conn->unix_peer_checked) {
  ------------------
  |  Branch (471:13): [True: 0, False: 6.21k]
  ------------------
  472|       |		/* already checked */
  473|  6.21k|	} else if (fd < 0) {
  ------------------
  |  Branch (473:13): [True: 0, False: 6.21k]
  ------------------
  474|       |		/* not connected yet - wait */
  475|  6.21k|	} else {
  476|  6.21k|		if (net_getpeername(fd, &conn->remote_ip,
  ------------------
  |  Branch (476:7): [True: 6.21k, False: 0]
  ------------------
  477|  6.21k|				    &conn->remote_port) == 0) {
  478|       |			/* either TCP or UNIX socket connection */
  479|  6.21k|			errno = 0;
  480|  6.21k|		}
  481|       |
  482|  6.21k|		if (conn->remote_ip.family != 0) {
  ------------------
  |  Branch (482:7): [True: 0, False: 6.21k]
  ------------------
  483|       |			/* TCP connection */
  484|      0|			i_assert(conn->remote_port != 0);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  485|  6.21k|		} else if (errno == ENOTSOCK) {
  ------------------
  |  Branch (485:14): [True: 0, False: 6.21k]
  ------------------
  486|       |			/* getpeername() already found out this can't be a UNIX
  487|       |			   socket connection */
  488|  6.21k|		} else if (net_getunixcred(fd, &cred) == 0) {
  ------------------
  |  Branch (488:14): [True: 6.21k, False: 0]
  ------------------
  489|  6.21k|			conn->remote_pid = cred.pid;
  490|  6.21k|			conn->remote_uid = cred.uid;
  491|  6.21k|			conn->remote_gid = cred.gid;
  492|  6.21k|			conn->have_unix_credentials = TRUE;
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  493|  6.21k|		}
  494|  6.21k|		conn->unix_peer_checked = TRUE;
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  495|  6.21k|	}
  496|       |
  497|  6.21k|	connection_update_property_label(conn);
  498|  6.21k|	connection_update_label(conn);
  499|  6.21k|	connection_update_stream_names(conn);
  500|  6.21k|	connection_update_event(conn);
  501|       |
  502|  6.21k|	conn->name = (conn->base_name != NULL ?
  ------------------
  |  Branch (502:16): [True: 0, False: 6.21k]
  ------------------
  503|  6.21k|		      conn->base_name : conn->property_label);
  504|  6.21k|}
connection_init_server:
  645|  6.21k|{
  646|  6.21k|	i_assert(!list->set.client);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  647|       |
  648|  6.21k|	connection_init_full(list, conn, name, fd_in, fd_out);
  649|       |
  650|  6.21k|	struct event_passthrough *e = event_create_passthrough(conn->event)->
  ------------------
  |  |  176|  6.21k|	event_create_passthrough((parent), __FILE__, __LINE__)
  ------------------
  651|  6.21k|		set_name("client_connection_connected");
  652|       |	/* fd_out differs from fd_in only for stdin/stdout. Keep the logging
  653|       |	   output nice and clean by logging only the fd_in. If it's 0, it'll
  654|       |	   also be obvious that fd_out=1. */
  655|  6.21k|	e_debug(e->event(), "Server accepted connection (fd=%d)", fd_in);
  ------------------
  |  |   61|  6.21k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  6.21k|	struct event *_tmp_event = (_event); \
  |  |   63|  6.21k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  6.21k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  6.21k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 6.21k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  6.21k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  6.21k|	else \
  |  |   66|  6.21k|		event_send_abort(_tmp_event); \
  |  |   67|  6.21k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  656|       |
  657|  6.21k|	connection_init_streams(conn);
  658|       |	/* Client has finished connecting to server, so record it
  659|       |	   here. */
  660|  6.21k|	conn->connect_finished = ioloop_timeval;
  661|       |
  662|  6.21k|	if (conn->v.init != NULL)
  ------------------
  |  Branch (662:6): [True: 0, False: 6.21k]
  ------------------
  663|      0|		conn->v.init(conn);
  664|  6.21k|}
connection_init_server_ip:
  671|  6.21k|{
  672|  6.21k|	if (remote_ip != NULL && remote_ip->family != 0)
  ------------------
  |  Branch (672:6): [True: 0, False: 6.21k]
  |  Branch (672:27): [True: 0, False: 0]
  ------------------
  673|      0|		conn->remote_ip = *remote_ip;
  674|  6.21k|	if (remote_port != 0)
  ------------------
  |  Branch (674:6): [True: 0, False: 6.21k]
  ------------------
  675|      0|		conn->remote_port = remote_port;
  676|       |
  677|  6.21k|	connection_init_server(list, conn, name, fd_in, fd_out);
  678|  6.21k|}
connection_update_counters:
  863|  12.4k|{
  864|  12.4k|	if (conn->input != NULL)
  ------------------
  |  Branch (864:6): [True: 12.4k, False: 0]
  ------------------
  865|  12.4k|		event_add_int(conn->event, "net_in_bytes", conn->input->v_offset);
  866|  12.4k|	if (conn->output != NULL)
  ------------------
  |  Branch (866:6): [True: 12.4k, False: 0]
  ------------------
  867|  12.4k|		event_add_int(conn->event, "net_out_bytes", conn->output->offset);
  868|  12.4k|}
connection_disconnect:
  871|  12.4k|{
  872|  12.4k|	if (conn->disconnected)
  ------------------
  |  Branch (872:6): [True: 6.21k, False: 6.21k]
  ------------------
  873|  6.21k|		return;
  874|  6.21k|	connection_update_counters(conn);
  875|       |	/* client connects to a Server, and Server gets connection from Client
  876|       |	 */
  877|  6.21k|	const char *ename = conn->list->set.client ?
  ------------------
  |  Branch (877:22): [True: 0, False: 6.21k]
  ------------------
  878|      0|		"server_connection_disconnected" :
  879|  6.21k|		"client_connection_disconnected";
  880|       |
  881|  6.21k|	struct event_passthrough *e = event_create_passthrough(conn->event)->
  ------------------
  |  |  176|  6.21k|	event_create_passthrough((parent), __FILE__, __LINE__)
  ------------------
  882|  6.21k|		set_name(ename)->
  883|  6.21k|		add_str("reason", connection_disconnect_reason(conn));
  884|  6.21k|	e_debug(e->event(), "Disconnected: %s (fd=%d)",
  ------------------
  |  |   61|  6.21k|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |   62|  6.21k|	struct event *_tmp_event = (_event); \
  |  |   63|  6.21k|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|  6.21k|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  6.21k|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 6.21k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  6.21k|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|  6.21k|	else \
  |  |   66|  6.21k|		event_send_abort(_tmp_event); \
  |  |   67|  6.21k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  885|  6.21k|		connection_disconnect_reason(conn), conn->fd_in);
  886|       |
  887|  6.21k|	conn->last_input = 0;
  888|  6.21k|	i_zero(&conn->last_input_tv);
  ------------------
  |  |  249|  6.21k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  889|  6.21k|	timeout_remove(&conn->to);
  890|  6.21k|	io_remove(&conn->io);
  891|  6.21k|	i_stream_close(conn->input);
  892|  6.21k|	i_stream_destroy(&conn->input);
  893|  6.21k|	o_stream_close(conn->output);
  894|  6.21k|	o_stream_destroy(&conn->output);
  895|  6.21k|	if (conn->fd_in == conn->fd_out)
  ------------------
  |  Branch (895:6): [True: 6.21k, False: 0]
  ------------------
  896|  6.21k|		(void)shutdown(conn->fd_out, SHUT_RDWR);
  897|  6.21k|	fd_close_maybe_stdio(&conn->fd_in, &conn->fd_out);
  898|  6.21k|	conn->disconnected = TRUE;
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  899|  6.21k|}
connection_deinit:
  902|  6.21k|{
  903|  6.21k|	i_assert(conn->list->connections_count > 0);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  904|       |
  905|  6.21k|	conn->list->connections_count--;
  906|  6.21k|	DLLIST_REMOVE(&conn->list->connections, conn);
  ------------------
  |  |   28|  6.21k|	DLLIST_REMOVE_FULL(list, item, prev, next)
  |  |  ------------------
  |  |  |  |   15|  6.21k|#define DLLIST_REMOVE_FULL(list, item, prev, next) STMT_START { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  ------------------
  |  |  |  |   16|  6.21k|	if ((item)->prev != NULL) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (16:6): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  |  |   17|  6.21k|		(item)->prev->next = (item)->next; \
  |  |  |  |   18|  6.21k|	else if ((*list) == item) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:11): [True: 6.21k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   19|  6.21k|		*(list) = (item)->next; \
  |  |  |  |   20|  6.21k|	if ((item)->next != NULL) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (20:6): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  |  |   21|      0|		(item)->next->prev = (item)->prev; \
  |  |  |  |   22|      0|		(item)->next = NULL; \
  |  |  |  |   23|      0|	} \
  |  |  |  |   24|  6.21k|	(item)->prev = NULL; \
  |  |  |  |   25|  6.21k|	} STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  907|       |
  908|  6.21k|	connection_disconnect(conn);
  909|  6.21k|	i_free(conn->base_name);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  910|  6.21k|	i_free(conn->label);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  911|  6.21k|	i_free(conn->property_label);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  912|  6.21k|	event_unref(&conn->event);
  913|  6.21k|	conn->list = NULL;
  914|  6.21k|}
connection_disconnect_reason:
  959|  6.21k|{
  960|  6.21k|	switch (conn->disconnect_reason) {
  ------------------
  |  Branch (960:10): [True: 0, False: 6.21k]
  ------------------
  961|  3.75k|	case CONNECTION_DISCONNECT_DEINIT:
  ------------------
  |  Branch (961:2): [True: 3.75k, False: 2.45k]
  ------------------
  962|  3.75k|		return "Deinitializing";
  963|      0|	case CONNECTION_DISCONNECT_CONNECT_TIMEOUT: {
  ------------------
  |  Branch (963:2): [True: 0, False: 6.21k]
  ------------------
  964|      0|		unsigned int msecs =
  965|      0|			conn->list->set.client_connect_timeout_msecs;
  966|      0|		return t_strdup_printf("connect(%s) timed out in %u.%03u secs",
  967|      0|				       conn->name, msecs/1000, msecs%1000);
  968|      0|	}
  969|      0|	case CONNECTION_DISCONNECT_IDLE_TIMEOUT:
  ------------------
  |  Branch (969:2): [True: 0, False: 6.21k]
  ------------------
  970|      0|		return "Idle timeout";
  971|      0|	case CONNECTION_DISCONNECT_CONN_CLOSED:
  ------------------
  |  Branch (971:2): [True: 0, False: 6.21k]
  ------------------
  972|      0|		if (conn->input == NULL)
  ------------------
  |  Branch (972:7): [True: 0, False: 0]
  ------------------
  973|      0|			return t_strdup_printf("connect(%s) failed: %m",
  974|      0|						conn->name);
  975|       |		/* fall through */
  976|  2.45k|	case CONNECTION_DISCONNECT_NOT:
  ------------------
  |  Branch (976:2): [True: 2.45k, False: 3.75k]
  ------------------
  977|  2.45k|	case CONNECTION_DISCONNECT_BUFFER_FULL:
  ------------------
  |  Branch (977:2): [True: 0, False: 6.21k]
  ------------------
  978|  2.45k|		return io_stream_get_disconnect_reason(conn->input, conn->output);
  979|      0|	case CONNECTION_DISCONNECT_HANDSHAKE_FAILED:
  ------------------
  |  Branch (979:2): [True: 0, False: 6.21k]
  ------------------
  980|      0|		return "Handshake failed";
  981|  6.21k|	}
  982|      0|	i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
  983|  6.21k|}
connection_set_handlers:
 1009|  6.21k|{
 1010|  6.21k|	connection_input_halt(conn);
 1011|  6.21k|	i_assert(vfuncs->destroy != NULL);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1012|  6.21k|	conn->v = *vfuncs;
 1013|  6.21k|        if (conn->v.input == NULL)
  ------------------
  |  Branch (1013:13): [True: 0, False: 6.21k]
  ------------------
 1014|      0|                conn->v.input = connection_input_default;
 1015|  6.21k|        if (conn->v.input_line == NULL)
  ------------------
  |  Branch (1015:13): [True: 6.21k, False: 0]
  ------------------
 1016|  6.21k|                conn->v.input_line = connection_input_line_default;
 1017|  6.21k|        if (conn->v.handshake_args == NULL)
  ------------------
  |  Branch (1017:13): [True: 6.21k, False: 0]
  ------------------
 1018|  6.21k|                conn->v.handshake_args = connection_handshake_args_default;
 1019|  6.21k|        if (conn->v.idle_timeout == NULL)
  ------------------
  |  Branch (1019:13): [True: 6.21k, False: 0]
  ------------------
 1020|  6.21k|                conn->v.idle_timeout = connection_idle_timeout;
 1021|  6.21k|        if (conn->v.connect_timeout == NULL)
  ------------------
  |  Branch (1021:13): [True: 6.21k, False: 0]
  ------------------
 1022|  6.21k|                conn->v.connect_timeout = connection_connect_timeout;
 1023|  6.21k|	if (!conn->disconnected)
  ------------------
  |  Branch (1023:6): [True: 0, False: 6.21k]
  ------------------
 1024|      0|		connection_input_resume_full(conn, FALSE);
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
 1025|  6.21k|}
connection_set_default_handlers:
 1028|  6.21k|{
 1029|  6.21k|	connection_set_handlers(conn, &conn->list->v);
 1030|  6.21k|}
connection_list_init:
 1054|  6.21k|{
 1055|  6.21k|	struct connection_list *list;
 1056|       |
 1057|  6.21k|	i_assert(vfuncs->input != NULL ||
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:45): [True: 6.21k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1058|  6.21k|		 set->input_full_behavior != CONNECTION_BEHAVIOR_ALLOW);
 1059|  6.21k|	i_assert(set->major_version == 0 ||
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 6.21k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1060|  6.21k|		 (set->service_name_in != NULL &&
 1061|  6.21k|		  set->service_name_out != NULL &&
 1062|  6.21k|		  set->output_max_size != 0));
 1063|       |
 1064|  6.21k|	list = i_new(struct connection_list, 1);
  ------------------
  |  |    8|  6.21k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  6.21k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  6.21k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  6.21k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1065|  6.21k|	list->set = *set;
 1066|  6.21k|	list->v = *vfuncs;
 1067|       |
 1068|  6.21k|	return list;
 1069|  6.21k|}
connection_list_deinit:
 1072|  6.21k|{
 1073|  6.21k|	struct connection_list *list = *_list;
 1074|  6.21k|	struct connection *conn;
 1075|       |
 1076|  6.21k|	*_list = NULL;
 1077|       |
 1078|  9.97k|	while (list->connections != NULL) {
  ------------------
  |  Branch (1078:9): [True: 3.75k, False: 6.21k]
  ------------------
 1079|  3.75k|		conn = list->connections;
 1080|  3.75k|		connection_closed(conn, CONNECTION_DISCONNECT_DEINIT);
 1081|  3.75k|		i_assert(conn != list->connections);
  ------------------
  |  |  219|  3.75k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  3.75k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  3.75k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  3.75k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 3.75k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 3.75k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  3.75k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  3.75k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  3.75k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1082|  3.75k|	}
 1083|  6.21k|	i_free(list);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1084|  6.21k|}
connection.c:connection_closed:
   34|  3.75k|{
   35|  3.75k|	conn->disconnect_reason = reason;
   36|  3.75k|	conn->v.destroy(conn);
   37|  3.75k|}
connection.c:connection_input_resume_full:
  277|  44.3k|{
  278|  44.3k|	i_assert(!conn->disconnected);
  ------------------
  |  |  219|  44.3k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  44.3k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  44.3k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  44.3k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 44.3k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 44.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  44.3k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  44.3k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  44.3k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  279|       |
  280|  44.3k|	if (conn->io != NULL) {
  ------------------
  |  Branch (280:6): [True: 0, False: 44.3k]
  ------------------
  281|       |		/* do nothing */
  282|  44.3k|	} else if (conn->input != NULL) {
  ------------------
  |  Branch (282:13): [True: 44.3k, False: 0]
  ------------------
  283|  44.3k|		conn->io = io_add_istream_to(conn->ioloop, conn->input,
  ------------------
  |  |   95|  44.3k|	io_add_istream_to(ioloop, input, __FILE__, __LINE__ - \
  |  |   96|  44.3k|		CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
  |  |  ------------------
  |  |  |  |  171|  44.3k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  44.3k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  44.3k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  44.3k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |   97|  44.3k|		(io_callback_t *)callback, context)
  ------------------
  284|  44.3k|					     *conn->v.input, conn);
  285|  44.3k|		if (set_io_pending)
  ------------------
  |  Branch (285:7): [True: 38.1k, False: 6.21k]
  ------------------
  286|  38.1k|			io_set_pending(conn->io);
  287|  44.3k|	} else if (conn->fd_in != -1) {
  ------------------
  |  Branch (287:13): [True: 0, False: 0]
  ------------------
  288|      0|		conn->io = io_add_to(conn->ioloop, conn->fd_in, IO_READ,
  ------------------
  |  |   68|      0|	io_add_to(ioloop, fd, condition, __FILE__, __LINE__ - \
  |  |   69|      0|		CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
  |  |  ------------------
  |  |  |  |  171|      0|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|      0|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |   70|      0|		(io_callback_t *)callback, context)
  ------------------
  289|      0|				     *conn->v.input, conn);
  290|      0|		if (set_io_pending)
  ------------------
  |  Branch (290:7): [True: 0, False: 0]
  ------------------
  291|      0|			io_set_pending(conn->io);
  292|      0|	}
  293|  44.3k|	if (conn->input_idle_timeout_secs != 0 && conn->to == NULL) {
  ------------------
  |  Branch (293:6): [True: 0, False: 44.3k]
  |  Branch (293:44): [True: 0, False: 0]
  ------------------
  294|      0|		conn->to = timeout_add_to(conn->ioloop,
  ------------------
  |  |  134|      0|	timeout_add_to(ioloop, msecs, __FILE__, __LINE__ - \
  |  |  135|      0|		CALLBACK_TYPECHECK(callback, void (*)(typeof(context))) - \
  |  |  ------------------
  |  |  |  |  171|      0|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|      0|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  136|      0|		COMPILE_ERROR_IF_TRUE(__builtin_constant_p(msecs) && \
  |  |  ------------------
  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [True: 0, False: 0]
  |  |  |  |  |  Branch (180:25): [True: 0, False: 0]
  |  |  |  |  |  Branch (180:25): [True: 0, False: 0]
  |  |  |  |  |  Branch (180:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  137|      0|				      ((msecs) > 0 && (msecs) < 1000)), \
  |  |  138|      0|		(io_callback_t *)callback, context)
  ------------------
  295|      0|					  conn->input_idle_timeout_secs*1000,
  296|      0|					  *conn->v.idle_timeout, conn);
  297|      0|	}
  298|  44.3k|}
connection.c:connection_update_property_label:
  306|  6.21k|{
  307|  6.21k|	const char *label;
  308|       |
  309|  6.21k|	if (conn->remote_ip.family == 0) {
  ------------------
  |  Branch (309:6): [True: 6.21k, False: 0]
  ------------------
  310|  6.21k|		if (conn->remote_uid == (uid_t)-1)
  ------------------
  |  Branch (310:7): [True: 0, False: 6.21k]
  ------------------
  311|      0|			label = NULL;
  312|  6.21k|		else if (conn->remote_pid != (pid_t)-1) {
  ------------------
  |  Branch (312:12): [True: 6.21k, False: 0]
  ------------------
  313|  6.21k|			label = t_strdup_printf("pid=%ld,uid=%ld",
  314|  6.21k|						(long)conn->remote_pid,
  315|  6.21k|						(long)conn->remote_uid);
  316|  6.21k|		} else {
  317|      0|			label = t_strdup_printf("uid=%ld",
  318|      0|						(long)conn->remote_uid);
  319|      0|		}
  320|  6.21k|	} else if (conn->remote_ip.family == AF_INET6) {
  ------------------
  |  Branch (320:13): [True: 0, False: 0]
  ------------------
  321|      0|		label = t_strdup_printf("[%s]:%u",
  322|      0|					net_ip2addr(&conn->remote_ip),
  323|      0|					conn->remote_port);
  324|      0|	} else {
  325|      0|		label = t_strdup_printf("%s:%u",
  326|      0|					net_ip2addr(&conn->remote_ip),
  327|      0|					conn->remote_port);
  328|      0|	}
  329|       |
  330|  6.21k|	i_assert(label != NULL || conn->property_label == NULL);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:45): [True: 6.21k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  331|  6.21k|	if (conn->property_label != NULL &&
  ------------------
  |  Branch (331:6): [True: 0, False: 6.21k]
  ------------------
  332|  6.21k|	    strcmp(conn->property_label, label) != 0) {
  ------------------
  |  Branch (332:6): [True: 0, False: 0]
  ------------------
  333|      0|		e_debug(conn->event, "Updated peer address to %s", label);
  ------------------
  |  |   61|      0|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |   62|      0|	struct event *_tmp_event = (_event); \
  |  |   63|      0|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|      0|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|      0|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|      0|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|      0|	else \
  |  |   66|      0|		event_send_abort(_tmp_event); \
  |  |   67|      0|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  334|      0|	}
  335|       |
  336|  6.21k|	i_free(conn->property_label);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  337|  6.21k|	conn->property_label = i_strdup(label);
  338|  6.21k|}
connection.c:connection_update_label:
  341|  6.21k|{
  342|  6.21k|	bool unix_socket = conn->unix_socket ||
  ------------------
  |  Branch (342:21): [True: 0, False: 6.21k]
  ------------------
  343|  6.21k|		(conn->remote_ip.family == 0 && conn->remote_uid != (uid_t)-1);
  ------------------
  |  Branch (343:4): [True: 6.21k, False: 0]
  |  Branch (343:35): [True: 6.21k, False: 0]
  ------------------
  344|  6.21k|	string_t *label;
  345|       |
  346|  6.21k|	label = t_str_new(64);
  347|  6.21k|	if (conn->base_name != NULL)
  ------------------
  |  Branch (347:6): [True: 0, False: 6.21k]
  ------------------
  348|      0|		str_append(label, conn->base_name);
  349|  6.21k|	if (conn->property_label != NULL) {
  ------------------
  |  Branch (349:6): [True: 6.21k, False: 0]
  ------------------
  350|  6.21k|		if (str_len(label) == 0)
  ------------------
  |  Branch (350:7): [True: 6.21k, False: 0]
  ------------------
  351|  6.21k|			str_append(label, conn->property_label);
  352|      0|		else {
  353|      0|			str_append(label, " (");
  354|      0|			str_append(label, conn->property_label);
  355|      0|			str_append(label, ")");
  356|      0|		}
  357|  6.21k|	}
  358|  6.21k|	if (str_len(label) == 0) {
  ------------------
  |  Branch (358:6): [True: 0, False: 6.21k]
  ------------------
  359|      0|		if (conn->fd_in >= 0 &&
  ------------------
  |  Branch (359:7): [True: 0, False: 0]
  ------------------
  360|      0|		    (conn->fd_in == conn->fd_out || conn->fd_out < 0))
  ------------------
  |  Branch (360:8): [True: 0, False: 0]
  |  Branch (360:39): [True: 0, False: 0]
  ------------------
  361|      0|			str_printfa(label, "fd=%d", conn->fd_in);
  362|      0|		else if (conn->fd_in < 0 && conn->fd_out >= 0)
  ------------------
  |  Branch (362:12): [True: 0, False: 0]
  |  Branch (362:31): [True: 0, False: 0]
  ------------------
  363|      0|			str_printfa(label, "fd=%d", conn->fd_out);
  364|      0|		else if (conn->fd_in >= 0 && conn->fd_out >= 0) {
  ------------------
  |  Branch (364:12): [True: 0, False: 0]
  |  Branch (364:32): [True: 0, False: 0]
  ------------------
  365|      0|			str_printfa(label, "fd_in=%d,fd_out=%d",
  366|      0|				    conn->fd_in, conn->fd_out);
  367|      0|		}
  368|      0|	}
  369|  6.21k|	if (unix_socket && str_len(label) > 0)
  ------------------
  |  Branch (369:6): [True: 6.21k, False: 0]
  |  Branch (369:21): [True: 6.21k, False: 0]
  ------------------
  370|  6.21k|		str_insert(label, 0, "unix:");
  371|  6.21k|	if (conn->list->set.log_connection_id) {
  ------------------
  |  Branch (371:6): [True: 6.21k, False: 0]
  ------------------
  372|  6.21k|		if (str_len(label) > 0)
  ------------------
  |  Branch (372:7): [True: 6.21k, False: 0]
  ------------------
  373|  6.21k|			str_append_c(label, ' ');
  ------------------
  |  |   54|  6.21k|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|  6.21k|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|  6.21k|			(unsigned char)(chr), (chr)))
  ------------------
  374|  6.21k|		str_printfa(label, "[%u]", conn->id);
  375|  6.21k|	}
  376|       |
  377|  6.21k|	i_free(conn->label);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  378|  6.21k|	conn->label = i_strdup(str_c(label));
  379|  6.21k|}
connection.c:connection_update_stream_names:
  413|  12.4k|{
  414|  12.4k|	if (conn->input != NULL) {
  ------------------
  |  Branch (414:6): [True: 6.21k, False: 6.21k]
  ------------------
  415|  6.21k|		i_stream_set_name(
  416|  6.21k|			conn->input,
  417|  6.21k|			connection_create_stream_name(conn, conn->fd_in));
  418|  6.21k|	}
  419|  12.4k|	if (conn->output != NULL) {
  ------------------
  |  Branch (419:6): [True: 6.21k, False: 6.21k]
  ------------------
  420|  6.21k|		o_stream_set_name(
  421|  6.21k|			conn->output,
  422|  6.21k|			connection_create_stream_name(conn, conn->fd_out));
  423|  6.21k|	}
  424|  12.4k|}
connection.c:connection_create_stream_name:
  383|  12.4k|{
  384|  12.4k|	string_t *name;
  385|       |
  386|  12.4k|	name = t_str_new(64);
  387|  12.4k|	str_append(name, "(conn");
  388|  12.4k|	if (conn->unix_socket ||
  ------------------
  |  Branch (388:6): [True: 0, False: 12.4k]
  ------------------
  389|  12.4k|	    (conn->remote_ip.family == 0 && conn->remote_uid != (uid_t)-1))
  ------------------
  |  Branch (389:7): [True: 12.4k, False: 0]
  |  Branch (389:38): [True: 12.4k, False: 0]
  ------------------
  390|  12.4k|		str_append(name, ":unix");
  391|  12.4k|	if (conn->base_name != NULL) {
  ------------------
  |  Branch (391:6): [True: 0, False: 12.4k]
  ------------------
  392|      0|		str_append_c(name, ':');
  ------------------
  |  |   54|      0|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|      0|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|      0|			(unsigned char)(chr), (chr)))
  ------------------
  393|      0|		str_append(name, conn->base_name);
  394|  12.4k|	} else if (conn->property_label != NULL) {
  ------------------
  |  Branch (394:13): [True: 12.4k, False: 0]
  ------------------
  395|  12.4k|		str_append_c(name, ':');
  ------------------
  |  |   54|  12.4k|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|  12.4k|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|  12.4k|			(unsigned char)(chr), (chr)))
  ------------------
  396|  12.4k|		str_append(name, conn->property_label);
  397|  12.4k|	} else if (fd >= 0) {
  ------------------
  |  Branch (397:13): [True: 0, False: 0]
  ------------------
  398|      0|		str_printfa(name, ":fd=%d", fd);
  399|      0|	}
  400|  12.4k|	if (conn->list->set.log_connection_id) {
  ------------------
  |  Branch (400:6): [True: 12.4k, False: 0]
  ------------------
  401|  12.4k|		if (str_len(name) == 5)
  ------------------
  |  Branch (401:7): [True: 0, False: 12.4k]
  ------------------
  402|      0|			str_append_c(name, ':');
  ------------------
  |  |   54|      0|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|      0|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|      0|			(unsigned char)(chr), (chr)))
  ------------------
  403|  12.4k|		else
  404|  12.4k|			str_append_c(name, ',');
  ------------------
  |  |   54|  12.4k|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|  12.4k|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|  12.4k|			(unsigned char)(chr), (chr)))
  ------------------
  405|  12.4k|		str_printfa(name, "id=%u", conn->id);
  406|  12.4k|	}
  407|  12.4k|	str_append_c(name, ')');
  ------------------
  |  |   54|  12.4k|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|  12.4k|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|  12.4k|			(unsigned char)(chr), (chr)))
  ------------------
  408|       |
  409|  12.4k|	return str_c(name);
  410|  12.4k|}
connection.c:connection_init_full:
  592|  6.21k|{
  593|  6.21k|	if (conn->id == 0) {
  ------------------
  |  Branch (593:6): [True: 6.21k, False: 0]
  ------------------
  594|  6.21k|		if (list->id_counter == 0)
  ------------------
  |  Branch (594:7): [True: 6.21k, False: 0]
  ------------------
  595|  6.21k|			list->id_counter++;
  596|  6.21k|		conn->id = list->id_counter++;
  597|  6.21k|	}
  598|       |
  599|  6.21k|	i_zero(&conn->connect_started);
  ------------------
  |  |  249|  6.21k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  600|  6.21k|	i_zero(&conn->connect_finished);
  ------------------
  |  |  249|  6.21k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  601|       |
  602|  6.21k|	conn->ioloop = current_ioloop;
  603|  6.21k|	conn->fd_in = fd_in;
  604|  6.21k|	conn->fd_out = fd_out;
  605|  6.21k|	conn->disconnected = TRUE;
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  606|  6.21k|	conn->remote_uid = (uid_t)-1;
  607|  6.21k|	conn->remote_gid = (gid_t)-1;
  608|  6.21k|	conn->remote_pid = (pid_t)-1;
  609|       |
  610|  6.21k|	i_free(conn->base_name);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  611|  6.21k|	conn->base_name = i_strdup(name);
  612|       |
  613|  6.21k|	if (list->set.input_idle_timeout_secs != 0 &&
  ------------------
  |  Branch (613:6): [True: 0, False: 6.21k]
  ------------------
  614|  6.21k|	    conn->input_idle_timeout_secs == 0) {
  ------------------
  |  Branch (614:6): [True: 0, False: 0]
  ------------------
  615|      0|		conn->input_idle_timeout_secs =
  616|      0|			list->set.input_idle_timeout_secs;
  617|      0|	}
  618|       |
  619|  6.21k|	if (conn->event == NULL)
  ------------------
  |  Branch (619:6): [True: 6.21k, False: 0]
  ------------------
  620|  6.21k|		conn->event = event_create(conn->event_parent);
  ------------------
  |  |  156|  6.21k|	event_create((parent), __FILE__, __LINE__)
  ------------------
  621|  6.21k|	if (list->set.debug)
  ------------------
  |  Branch (621:6): [True: 0, False: 6.21k]
  ------------------
  622|      0|		event_set_forced_debug(conn->event, TRUE);
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  623|       |
  624|  6.21k|	if (conn->list != NULL) {
  ------------------
  |  Branch (624:6): [True: 0, False: 6.21k]
  ------------------
  625|      0|		i_assert(conn->list == list);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  626|  6.21k|	} else {
  627|  6.21k|		conn->list = list;
  628|  6.21k|		DLLIST_PREPEND(&list->connections, conn);
  ------------------
  |  |   13|  6.21k|	DLLIST_PREPEND_FULL(list, item, prev, next)
  |  |  ------------------
  |  |  |  |    5|  6.21k|#define DLLIST_PREPEND_FULL(list, item, prev, next) STMT_START { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  ------------------
  |  |  |  |    6|  6.21k|	(item)->prev = NULL; \
  |  |  |  |    7|  6.21k|	(item)->next = *(list); \
  |  |  |  |    8|  6.21k|	if (*(list) != NULL) (*(list))->prev = (item); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (8:6): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  |  |    9|  6.21k|	*(list) = (item); \
  |  |  |  |   10|  6.21k|	} STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  629|  6.21k|		list->connections_count++;
  630|  6.21k|	}
  631|       |
  632|  6.21k|	connection_update_properties(conn);
  633|  6.21k|	connection_set_default_handlers(conn);
  634|  6.21k|}
connection.c:connection_init_streams:
  507|  6.21k|{
  508|  6.21k|	const struct connection_settings *set = &conn->list->set;
  509|       |
  510|  6.21k|	i_assert(conn->io == NULL);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  511|  6.21k|	i_assert(conn->input == NULL);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  512|  6.21k|	i_assert(conn->output == NULL);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  513|  6.21k|	i_assert(conn->to == NULL);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  514|       |
  515|  6.21k|	i_zero(&conn->handshake_finished);
  ------------------
  |  |  249|  6.21k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  516|  6.21k|	conn->version_received = set->major_version == 0;
  517|       |
  518|  6.21k|	if (set->input_max_size != 0) {
  ------------------
  |  Branch (518:6): [True: 6.21k, False: 0]
  ------------------
  519|  6.21k|		if (conn->unix_socket)
  ------------------
  |  Branch (519:7): [True: 0, False: 6.21k]
  ------------------
  520|      0|			conn->input = i_stream_create_unix(conn->fd_in,
  521|      0|							   set->input_max_size);
  522|  6.21k|		else
  523|  6.21k|			conn->input = i_stream_create_fd(conn->fd_in,
  524|  6.21k|							 set->input_max_size);
  525|  6.21k|		i_stream_switch_ioloop_to(conn->input, conn->ioloop);
  526|  6.21k|	}
  527|  6.21k|	if (set->output_max_size != 0) {
  ------------------
  |  Branch (527:6): [True: 6.21k, False: 0]
  ------------------
  528|  6.21k|		if (conn->unix_socket)
  ------------------
  |  Branch (528:7): [True: 0, False: 6.21k]
  ------------------
  529|      0|			conn->output = o_stream_create_unix(conn->fd_out,
  530|      0|							    set->output_max_size);
  531|  6.21k|		else
  532|  6.21k|			conn->output = o_stream_create_fd(conn->fd_out,
  533|  6.21k|							  set->output_max_size);
  534|  6.21k|		o_stream_set_no_error_handling(conn->output, TRUE);
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  535|  6.21k|		o_stream_set_finish_via_child(conn->output, FALSE);
  ------------------
  |  |   11|  6.21k|#  define FALSE (!1)
  ------------------
  536|  6.21k|		o_stream_switch_ioloop_to(conn->output, conn->ioloop);
  537|  6.21k|	}
  538|  6.21k|	connection_update_stream_names(conn);
  539|       |
  540|  6.21k|	conn->disconnected = FALSE;
  ------------------
  |  |   11|  6.21k|#  define FALSE (!1)
  ------------------
  541|  6.21k|	i_assert(conn->to == NULL);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  542|  6.21k|	connection_input_resume_full(conn, FALSE);
  ------------------
  |  |   11|  6.21k|#  define FALSE (!1)
  ------------------
  543|  6.21k|	i_assert(conn->to != NULL || conn->input_idle_timeout_secs == 0);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  12.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:45): [True: 6.21k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  544|  6.21k|	if (set->major_version != 0 && !set->dont_send_version) {
  ------------------
  |  Branch (544:6): [True: 0, False: 6.21k]
  |  Branch (544:33): [True: 0, False: 0]
  ------------------
  545|      0|		e_debug(conn->event, "Sending version handshake");
  ------------------
  |  |   61|      0|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |   62|      0|	struct event *_tmp_event = (_event); \
  |  |   63|      0|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|      0|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|      0|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|      0|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|      0|	else \
  |  |   66|      0|		event_send_abort(_tmp_event); \
  |  |   67|      0|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  546|      0|		o_stream_nsend_str(conn->output, t_strdup_printf(
  547|      0|			"VERSION\t%s\t%u\t%u\n", set->service_name_out,
  548|      0|			set->major_version, set->minor_version));
  549|      0|	}
  550|  6.21k|}

t_push:
  150|   249k|{
  151|   249k|	struct stack_frame *frame;
  152|       |
  153|   249k|	i_assert(marker != NULL);
  ------------------
  |  |  219|   249k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   249k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   249k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   249k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 249k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 249k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   249k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   249k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   249k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  154|       |
  155|   249k|	if (unlikely(!data_stack_initialized)) {
  ------------------
  |  |  202|   249k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 249k]
  |  |  |  Branch (202:44): [True: 0, False: 249k]
  |  |  ------------------
  ------------------
  156|       |		/* kludgy, but allow this before initialization */
  157|      0|		data_stack_init();
  158|      0|		return t_push(marker);
  159|      0|	}
  160|       |
  161|       |	/* allocate new block */
  162|   249k|	frame = t_buffer_get(sizeof(*frame));
  163|   249k|	frame->prev = current_frame;
  164|   249k|	current_frame = frame;
  165|       |
  166|       |	/* mark our current position */
  167|   249k|	current_frame->block = current_block;
  168|   249k|	current_frame->block_space_left = current_block->left;
  169|   249k|	current_frame->last_alloc_size = 0;
  170|   249k|	current_frame->marker = marker;
  171|       |#ifdef DEBUG
  172|       |	current_frame->alloc_bytes = 0;
  173|       |	current_frame->alloc_count = 0;
  174|       |#endif
  175|       |
  176|   249k|	t_buffer_alloc(sizeof(*frame));
  177|       |
  178|   249k|#ifndef STATIC_CHECKER
  179|   249k|	return data_stack_frame_id++;
  180|       |#else
  181|       |	struct data_stack_frame *ds_frame = i_new(struct data_stack_frame, 1);
  182|       |	ds_frame->id = data_stack_frame_id++;
  183|       |	return ds_frame;
  184|       |#endif
  185|   249k|}
t_push_named:
  188|  64.5k|{
  189|  64.5k|	data_stack_frame_t ret = t_push(format);
  190|       |#ifdef DEBUG
  191|       |	va_list args;
  192|       |	va_start(args, format);
  193|       |	current_frame->marker = p_strdup_vprintf(unsafe_data_stack_pool, format, args);
  194|       |	va_end(args);
  195|       |#else
  196|  64.5k|	(void)format; /* unused in non-DEBUG builds */
  197|  64.5k|#endif
  198|       |
  199|  64.5k|	return ret;
  200|  64.5k|}
t_pop_last_unsafe:
  280|   249k|{
  281|   249k|	size_t block_space_left;
  282|       |
  283|   249k|	if (unlikely(current_frame == NULL))
  ------------------
  |  |  202|   249k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 249k]
  |  |  |  Branch (202:44): [True: 0, False: 249k]
  |  |  ------------------
  ------------------
  284|      0|		i_panic("t_pop() called with empty stack");
  285|       |
  286|   249k|	data_stack_last_buffer_reset(FALSE);
  ------------------
  |  |   11|   249k|#  define FALSE (!1)
  ------------------
  287|       |#ifdef DEBUG
  288|       |	t_pop_verify();
  289|       |#endif
  290|       |
  291|       |	/* Usually the block doesn't change. If it doesn't, the next pointer
  292|       |	   must also be NULL. */
  293|   249k|	if (current_block != current_frame->block) {
  ------------------
  |  Branch (293:6): [True: 281, False: 249k]
  ------------------
  294|    281|		current_block = current_frame->block;
  295|    281|		if (current_block->next != NULL) {
  ------------------
  |  Branch (295:7): [True: 281, False: 0]
  ------------------
  296|       |			/* free unused blocks */
  297|    281|			free_blocks(current_block->next);
  298|    281|			current_block->next = NULL;
  299|    281|		}
  300|    281|	}
  301|   249k|	block_canary_check(current_block);
  ------------------
  |  |   27|   249k|#  define block_canary_check(block) do { ; } while(0)
  |  |  ------------------
  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  ------------------
  ------------------
  302|       |
  303|       |	/* current_frame points inside the stack frame that will be freed.
  304|       |	   make sure it's not accessed after it's already freed/cleaned. */
  305|   249k|	block_space_left = current_frame->block_space_left;
  306|   249k|	current_frame = current_frame->prev;
  307|       |
  308|       |#ifdef DEBUG
  309|       |	size_t start_pos, end_pos;
  310|       |
  311|       |	start_pos = current_block->size - block_space_left;
  312|       |	end_pos = current_block->size - current_block->left_lowwater;
  313|       |	i_assert(end_pos >= start_pos);
  314|       |	memset(STACK_BLOCK_DATA(current_block) + start_pos, CLEAR_CHR,
  315|       |	       end_pos - start_pos);
  316|       |	current_block->left_lowwater = block_space_left;
  317|       |#endif
  318|       |
  319|   249k|	current_block->left = block_space_left;
  320|       |
  321|   249k|	data_stack_frame_id--;
  322|   249k|}
t_pop:
  325|   249k|{
  326|   249k|	t_pop_last_unsafe();
  327|   249k|#ifndef STATIC_CHECKER
  328|   249k|	if (unlikely(data_stack_frame_id != *id))
  ------------------
  |  |  202|   249k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 249k]
  |  |  |  Branch (202:44): [True: 0, False: 249k]
  |  |  ------------------
  ------------------
  329|      0|		return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  330|   249k|	*id = 0;
  331|       |#else
  332|       |	unsigned int frame_id = (*id)->id;
  333|       |	i_free_and_null(*id);
  334|       |
  335|       |	if (unlikely(data_stack_frame_id != frame_id))
  336|       |		return FALSE;
  337|       |#endif
  338|   249k|	return TRUE;
  ------------------
  |  |   15|   249k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   249k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  339|   249k|}
t_malloc_no0:
  544|   115k|{
  545|   115k|	return t_malloc_real(size, TRUE);
  ------------------
  |  |   15|   115k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   115k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  546|   115k|}
t_malloc0:
  549|   794k|{
  550|   794k|	void *mem;
  551|       |
  552|   794k|	mem = t_malloc_real(size, TRUE);
  ------------------
  |  |   15|   794k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   794k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  553|   794k|	memset(mem, 0, size);
  554|   794k|	return mem;
  555|   794k|}
t_try_realloc:
  559|  11.1k|{
  560|  11.1k|	size_t debug_adjust = 0, last_alloc_size;
  561|  11.1k|	unsigned char *after_last_alloc;
  562|       |
  563|  11.1k|	if (unlikely(size == 0 || size > SSIZE_T_MAX))
  ------------------
  |  |  202|  22.2k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 11.1k]
  |  |  |  Branch (202:45): [True: 0, False: 11.1k]
  |  |  |  Branch (202:45): [True: 0, False: 11.1k]
  |  |  ------------------
  ------------------
  564|      0|		i_panic("Trying to allocate %zu bytes", size);
  565|  11.1k|	block_canary_check(current_block);
  ------------------
  |  |   27|  11.1k|#  define block_canary_check(block) do { ; } while(0)
  |  |  ------------------
  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  ------------------
  ------------------
  566|  11.1k|	data_stack_last_buffer_reset(TRUE);
  ------------------
  |  |   15|  11.1k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  11.1k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  567|       |
  568|  11.1k|	last_alloc_size = current_frame->last_alloc_size;
  569|       |
  570|       |	/* see if we're trying to grow the memory we allocated last */
  571|  11.1k|	after_last_alloc = data_stack_after_last_alloc(current_block);
  572|       |#ifdef DEBUG
  573|       |	debug_adjust = MEM_ALIGN(sizeof(size_t));
  574|       |#endif
  575|  11.1k|	if (after_last_alloc - last_alloc_size + debug_adjust == mem) {
  ------------------
  |  Branch (575:6): [True: 11.0k, False: 122]
  ------------------
  576|       |		/* yeah, see if we have space to grow */
  577|  11.0k|		size_t new_alloc_size, alloc_growth;
  578|       |
  579|  11.0k|		new_alloc_size = ALLOC_SIZE(size);
  ------------------
  |  |   28|  11.0k|#  define ALLOC_SIZE(size) MEM_ALIGN(size)
  |  |  ------------------
  |  |  |  |   22|  11.0k|	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  732|  11.0k|#define MEM_ALIGN_SIZE 8
  |  |  |  |  ------------------
  |  |  |  |               	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  732|  11.0k|#define MEM_ALIGN_SIZE 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  580|  11.0k|		alloc_growth = (new_alloc_size - last_alloc_size);
  581|       |#ifdef DEBUG
  582|       |		size_t old_raw_size; /* sorry, non-C99 users - add braces if you need them */
  583|       |		old_raw_size = *(size_t *)PTR_OFFSET(mem, -(ptrdiff_t)MEM_ALIGN(sizeof(size_t)));
  584|       |		i_assert(ALLOC_SIZE(old_raw_size) == last_alloc_size);
  585|       |		/* Only check one byte for over-run, that catches most
  586|       |		   offenders who are likely to use t_try_realloc() */
  587|       |		i_assert(((unsigned char*)mem)[old_raw_size] == CLEAR_CHR);
  588|       |#endif
  589|       |
  590|  11.0k|		if (current_block->left >= alloc_growth) {
  ------------------
  |  Branch (590:7): [True: 10.8k, False: 127]
  ------------------
  591|       |			/* just shrink the available size */
  592|  10.8k|			current_block->left -= alloc_growth;
  593|  10.8k|			current_frame->last_alloc_size = new_alloc_size;
  594|       |#ifdef DEBUG
  595|       |			if (current_block->left < current_block->left_lowwater)
  596|       |				current_block->left_lowwater = current_block->left;
  597|       |			/* All reallocs are permanent by definition
  598|       |			   However, they don't count as a new allocation */
  599|       |			current_frame->alloc_bytes += alloc_growth;
  600|       |			*(size_t *)PTR_OFFSET(mem, -(ptrdiff_t)MEM_ALIGN(sizeof(size_t))) = size;
  601|       |			memset(PTR_OFFSET(mem, size), CLEAR_CHR,
  602|       |			       new_alloc_size - size - MEM_ALIGN(sizeof(size_t)));
  603|       |#endif
  604|  10.8k|			return TRUE;
  ------------------
  |  |   15|  10.8k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  10.8k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  605|  10.8k|		}
  606|  11.0k|	}
  607|       |
  608|    249|	return FALSE;
  ------------------
  |  |   11|    249|#  define FALSE (!1)
  ------------------
  609|  11.1k|}
t_get_bytes_available:
  612|  5.92k|{
  613|  5.92k|	block_canary_check(current_block);
  ------------------
  |  |   27|  5.92k|#  define block_canary_check(block) do { ; } while(0)
  |  |  ------------------
  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  ------------------
  ------------------
  614|  5.92k|#ifndef DEBUG
  615|  5.92k|	const unsigned int min_extra = 0;
  616|       |#else
  617|       |	const unsigned int min_extra = SENTRY_COUNT + MEM_ALIGN(sizeof(size_t));
  618|       |	if (current_block->left < min_extra)
  619|       |		return 0;
  620|       |#endif
  621|  5.92k|	size_t size = current_block->left - min_extra;
  622|  5.92k|	i_assert(ALLOC_SIZE(size) == current_block->left);
  ------------------
  |  |  219|  5.92k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  5.92k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  5.92k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  5.92k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 5.92k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 5.92k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  5.92k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  5.92k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  5.92k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  623|  5.92k|	return size;
  624|  5.92k|}
t_buffer_get:
  627|   784k|{
  628|   784k|	void *ret;
  629|       |
  630|   784k|	ret = t_malloc_real(size, FALSE);
  ------------------
  |  |   11|   784k|#  define FALSE (!1)
  ------------------
  631|       |
  632|   784k|	last_buffer_size = size;
  633|   784k|	last_buffer_block = current_block;
  634|   784k|	return ret;
  635|   784k|}
t_buffer_alloc:
  654|   644k|{
  655|   644k|	i_assert(last_buffer_block != NULL);
  ------------------
  |  |  219|   644k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   644k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   644k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   644k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 644k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 644k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   644k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   644k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   644k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  656|   644k|	i_assert(last_buffer_size >= size);
  ------------------
  |  |  219|   644k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   644k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   644k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   644k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 644k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 644k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   644k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   644k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   644k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  657|   644k|	i_assert(current_block->left >= size);
  ------------------
  |  |  219|   644k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   644k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   644k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   644k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 644k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 644k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   644k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   644k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   644k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  658|       |
  659|       |	/* we've already reserved the space, now we just mark it used */
  660|   644k|	(void)t_malloc_real(size, TRUE);
  ------------------
  |  |   15|   644k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   644k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  661|   644k|}
data_stack_get_alloc_size:
  712|     21|{
  713|     21|	struct stack_block *block;
  714|     21|	size_t size = 0;
  715|       |
  716|     21|	i_assert(current_block->next == NULL);
  ------------------
  |  |  219|     21|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|     21|#  define STMT_START do
  |  |  ------------------
  |  |  220|     21|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|     21|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 21]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 21]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|     21|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|     21|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|     21|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  717|       |
  718|     80|	for (block = current_block; block != NULL; block = block->prev)
  ------------------
  |  Branch (718:30): [True: 59, False: 21]
  ------------------
  719|     59|		size += block->size;
  720|     21|	return size;
  721|     21|}
data_stack_get_used_size:
  724|     21|{
  725|     21|	struct stack_block *block;
  726|     21|	size_t size = 0;
  727|       |
  728|     21|	i_assert(current_block->next == NULL);
  ------------------
  |  |  219|     21|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|     21|#  define STMT_START do
  |  |  ------------------
  |  |  220|     21|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|     21|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 21]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 21]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|     21|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|     21|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|     21|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  729|       |
  730|     80|	for (block = current_block; block != NULL; block = block->prev)
  ------------------
  |  Branch (730:30): [True: 59, False: 21]
  ------------------
  731|     59|		size += block->size - block->left;
  732|     21|	return size;
  733|     21|}
data_stack_free_unused:
  736|     44|{
  737|     44|	free(unused_block);
  738|     44|	unused_block = NULL;
  739|     44|}
data_stack_init:
  742|      1|{
  743|      1|	if (data_stack_initialized) {
  ------------------
  |  Branch (743:6): [True: 0, False: 1]
  ------------------
  744|       |		/* already initialized (we did auto-initialization in
  745|       |		   t_malloc/t_push) */
  746|      0|		return;
  747|      0|	}
  748|      1|	data_stack_initialized = TRUE;
  ------------------
  |  |   15|      1|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      1|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  749|      1|	data_stack_frame_id = 1;
  750|       |
  751|      1|	outofmem_area.block.size = outofmem_area.block.left =
  752|      1|		sizeof(outofmem_area) - sizeof(outofmem_area.block);
  753|      1|	outofmem_area.block.canary = BLOCK_CANARY;
  ------------------
  |  |   26|      1|#  define BLOCK_CANARY NULL
  ------------------
  754|       |
  755|      1|	current_block = mem_block_alloc(INITIAL_STACK_SIZE);
  ------------------
  |  |   16|      1|#  define INITIAL_STACK_SIZE (1024*32)
  ------------------
  756|      1|	current_frame = NULL;
  757|       |
  758|      1|	last_buffer_block = NULL;
  759|      1|	last_buffer_size = 0;
  760|       |
  761|      1|	root_frame_id = t_push("data_stack_init");
  762|      1|}
data-stack.c:data_stack_last_buffer_reset:
  111|  2.60M|{
  112|  2.60M|	if (last_buffer_block != NULL) {
  ------------------
  |  Branch (112:6): [True: 784k, False: 1.81M]
  ------------------
  113|       |#ifdef DEBUG
  114|       |		unsigned char *last_alloc_end, *p, *pend;
  115|       |
  116|       |		/* We assume that this function gets called before
  117|       |		   current_block changes. */
  118|       |		i_assert(last_buffer_block == current_block);
  119|       |
  120|       |		last_alloc_end = data_stack_after_last_alloc(current_block);
  121|       |		p = last_alloc_end + MEM_ALIGN(sizeof(size_t)) + last_buffer_size;
  122|       |		pend = last_alloc_end + ALLOC_SIZE(last_buffer_size);
  123|       |#endif
  124|       |		/* reset t_buffer_get() mark - not really needed but makes it
  125|       |		   easier to notice if t_malloc()/t_push()/t_pop() is called
  126|       |		   between t_buffer_get() and t_buffer_alloc().
  127|       |		   do this before we get to i_panic() to avoid recursive
  128|       |		   panics. */
  129|   784k|		last_buffer_block = NULL;
  130|       |
  131|       |#ifdef DEBUG
  132|       |		/* NOTE: If the below panic triggers, it may also be due to an
  133|       |		   internal bug in data-stack (since this is rather complex). While
  134|       |		   debugging whether that is the case, it's a good idea to change the
  135|       |		   i_panic() to abort(). Otherwise the i_panic() changes the
  136|       |		   data-stack's internal state and complicates debugging. */
  137|       |		while (p < pend)
  138|       |			if (*p++ != CLEAR_CHR)
  139|       |				i_panic("t_buffer_get(): buffer overflow");
  140|       |
  141|       |		if (!preserve_data) {
  142|       |			p = last_alloc_end;
  143|       |			memset(p, CLEAR_CHR, SENTRY_COUNT);
  144|       |		}
  145|       |#endif
  146|   784k|	}
  147|  2.60M|}
data-stack.c:free_blocks:
  215|    281|{
  216|    281|	struct stack_block *next;
  217|       |
  218|       |	/* free all the blocks, except if any of them is bigger than
  219|       |	   unused_block, replace it */
  220|    575|	while (block != NULL) {
  ------------------
  |  Branch (220:9): [True: 294, False: 281]
  ------------------
  221|    294|		block_canary_check(block);
  ------------------
  |  |   27|    294|#  define block_canary_check(block) do { ; } while(0)
  |  |  ------------------
  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  ------------------
  ------------------
  222|    294|		next = block->next;
  223|       |
  224|       |#ifdef DEBUG
  225|       |		memset(STACK_BLOCK_DATA(block), CLEAR_CHR, block->size);
  226|       |#endif
  227|       |
  228|    294|		if (block == &outofmem_area.block)
  ------------------
  |  Branch (228:7): [True: 0, False: 294]
  ------------------
  229|      0|			;
  230|    294|		else if (unused_block == NULL ||
  ------------------
  |  Branch (230:12): [True: 281, False: 13]
  ------------------
  231|    294|			 block->size > unused_block->size) {
  ------------------
  |  Branch (231:5): [True: 13, False: 0]
  ------------------
  232|    294|			free(unused_block);
  233|    294|			unused_block = block;
  234|    294|		} else {
  235|      0|			free(block);
  236|      0|		}
  237|       |
  238|    294|		block = next;
  239|    294|	}
  240|    281|}
data-stack.c:t_malloc_real:
  451|  2.33M|{
  452|  2.33M|	void *ret;
  453|  2.33M|	size_t alloc_size;
  454|  2.33M|	bool warn = FALSE;
  ------------------
  |  |   11|  2.33M|#  define FALSE (!1)
  ------------------
  455|       |#ifdef DEBUG
  456|       |	int old_errno = errno;
  457|       |#endif
  458|       |
  459|  2.33M|	if (unlikely(size == 0 || size > SSIZE_T_MAX))
  ------------------
  |  |  202|  4.67M|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 2.33M]
  |  |  |  Branch (202:45): [True: 0, False: 2.33M]
  |  |  |  Branch (202:45): [True: 0, False: 2.33M]
  |  |  ------------------
  ------------------
  460|      0|		i_panic("Trying to allocate %zu bytes", size);
  461|       |
  462|  2.33M|	if (unlikely(!data_stack_initialized)) {
  ------------------
  |  |  202|  2.33M|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 2.33M]
  |  |  |  Branch (202:44): [True: 0, False: 2.33M]
  |  |  ------------------
  ------------------
  463|       |		/* kludgy, but allow this before initialization */
  464|      0|		data_stack_init();
  465|      0|	}
  466|  2.33M|	block_canary_check(current_block);
  ------------------
  |  |   27|  2.33M|#  define block_canary_check(block) do { ; } while(0)
  |  |  ------------------
  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  ------------------
  ------------------
  467|       |
  468|       |	/* allocate only aligned amount of memory so alignment comes
  469|       |	   always properly */
  470|  2.33M|	alloc_size = ALLOC_SIZE(size);
  ------------------
  |  |   28|  2.33M|#  define ALLOC_SIZE(size) MEM_ALIGN(size)
  |  |  ------------------
  |  |  |  |   22|  2.33M|	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  732|  2.33M|#define MEM_ALIGN_SIZE 8
  |  |  |  |  ------------------
  |  |  |  |               	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  732|  2.33M|#define MEM_ALIGN_SIZE 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  471|       |#ifdef DEBUG
  472|       |	if(permanent) {
  473|       |		current_frame->alloc_bytes += alloc_size;
  474|       |		current_frame->alloc_count++;
  475|       |	}
  476|       |#endif
  477|  2.33M|	data_stack_last_buffer_reset(TRUE);
  ------------------
  |  |   15|  2.33M|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  2.33M|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  478|       |
  479|  2.33M|	if (permanent) {
  ------------------
  |  Branch (479:6): [True: 1.55M, False: 784k]
  ------------------
  480|       |		/* used for t_try_realloc() */
  481|  1.55M|		current_frame->last_alloc_size = alloc_size;
  482|  1.55M|	}
  483|       |
  484|  2.33M|	if (current_block->left < alloc_size) {
  ------------------
  |  Branch (484:6): [True: 294, False: 2.33M]
  ------------------
  485|    294|		struct stack_block *block;
  486|       |
  487|       |		/* current block is full, see if we can use the unused_block */
  488|    294|		if (unused_block != NULL && unused_block->size >= alloc_size) {
  ------------------
  |  Branch (488:7): [True: 273, False: 21]
  |  Branch (488:31): [True: 273, False: 0]
  ------------------
  489|    273|			block = unused_block;
  490|    273|			unused_block = NULL;
  491|    273|			mem_block_reset(block);
  492|    273|		} else {
  493|       |			/* current block is full, allocate a new one */
  494|     21|			block = mem_block_alloc(alloc_size);
  495|     21|			warn = TRUE;
  ------------------
  |  |   15|     21|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|     21|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  496|     21|		}
  497|       |
  498|       |		/* The newly allocated block will replace the current_block,
  499|       |		   i.e. current_block always points to the last element in
  500|       |		   the linked list. */
  501|    294|		block->prev = current_block;
  502|    294|		current_block->next = block;
  503|    294|		current_block = block;
  504|    294|	}
  505|       |
  506|       |	/* enough space in current block, use it */
  507|  2.33M|	ret = data_stack_after_last_alloc(current_block);
  508|       |
  509|       |#ifdef DEBUG
  510|       |	if (current_block->left - alloc_size < current_block->left_lowwater)
  511|       |		current_block->left_lowwater = current_block->left - alloc_size;
  512|       |#endif
  513|  2.33M|	if (permanent)
  ------------------
  |  Branch (513:6): [True: 1.55M, False: 784k]
  ------------------
  514|  1.55M|		current_block->left -= alloc_size;
  515|       |
  516|  2.33M|	if (warn) T_BEGIN {
  ------------------
  |  |   68|     21|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|     21|#  define STMT_START do
  |  |  ------------------
  |  |   69|     21|		data_stack_frame_t _data_stack_cur_id = t_push(__FILE__ ":" T_XSTRING(__LINE__));
  |  |  ------------------
  |  |  |  |   66|     21|#define T_XSTRING(x)	T_STRING(x)	/* expand and then stringify */
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|     21|#define T_STRING(x)	#x
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (516:6): [True: 21, False: 2.33M]
  ------------------
  517|       |		/* sending event can cause errno changes. */
  518|       |#ifdef DEBUG
  519|       |		i_assert(errno == old_errno);
  520|       |#else
  521|     42|		int old_errno = errno;
  522|     42|#endif
  523|       |		/* warn after allocation, so if e_debug() wants to
  524|       |		   allocate more memory we don't go to infinite loop */
  525|     42|		data_stack_send_grow_event(alloc_size);
  526|       |		/* reset errno back to what it was */
  527|     42|		errno = old_errno;
  528|     42|	} T_END;
  ------------------
  |  |   71|     21|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|     21|#  define STMT_START do
  |  |  ------------------
  |  |   72|     21|		if (unlikely(!t_pop(&_data_stack_cur_id))) \
  |  |  ------------------
  |  |  |  |  202|     21|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 21]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 21]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   73|     21|			i_panic("Leaked t_pop() call"); \
  |  |   74|     21|	} STMT_END; \
  |  |  ------------------
  |  |  |  |   64|     21|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   75|     21|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|     21|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  529|       |#ifdef DEBUG
  530|       |	memcpy(ret, &size, sizeof(size));
  531|       |	ret = PTR_OFFSET(ret, MEM_ALIGN(sizeof(size)));
  532|       |	/* make sure the sentry contains CLEAR_CHRs. it might not if we
  533|       |	   had used t_buffer_get(). */
  534|       |	memset(PTR_OFFSET(ret, size), CLEAR_CHR,
  535|       |	       MEM_ALIGN(size + SENTRY_COUNT) - size);
  536|       |
  537|       |	/* we rely on errno not changing. it shouldn't. */
  538|       |	i_assert(errno == old_errno);
  539|       |#endif
  540|  2.33M|	return ret;
  541|  2.33M|}
data-stack.c:mem_block_reset:
  357|    295|{
  358|    295|	block->prev = NULL;
  359|    295|	block->next = NULL;
  360|    295|	block->left = block->size;
  361|       |#ifdef DEBUG
  362|       |	block->left_lowwater = block->size;
  363|       |#endif
  364|    295|}
data-stack.c:data_stack_send_grow_event:
  399|     21|{
  400|     21|	if (event_datastack_deinitialized) {
  ------------------
  |  Branch (400:6): [True: 0, False: 21]
  ------------------
  401|       |		/* already in the deinitialization code -
  402|       |		   don't send more events */
  403|      0|		return;
  404|      0|	}
  405|     21|	if (event_datastack == NULL)
  ------------------
  |  Branch (405:6): [True: 1, False: 20]
  ------------------
  406|      1|		event_datastack = event_create(NULL);
  ------------------
  |  |  156|      1|	event_create((parent), __FILE__, __LINE__)
  ------------------
  407|     21|	event_set_name(event_datastack, "data_stack_grow");
  408|     21|	event_add_int(event_datastack, "alloc_size", data_stack_get_alloc_size());
  409|     21|	event_add_int(event_datastack, "used_size", data_stack_get_used_size());
  410|     21|	event_add_int(event_datastack, "last_alloc_size", last_alloc_size);
  411|     21|	event_add_int(event_datastack, "last_block_size", current_block->size);
  412|       |#ifdef DEBUG
  413|       |	event_add_int(event_datastack, "frame_alloc_bytes",
  414|       |		      current_frame->alloc_bytes);
  415|       |	event_add_int(event_datastack, "frame_alloc_count",
  416|       |		      current_frame->alloc_count);
  417|       |#endif
  418|     21|	event_add_str(event_datastack, "frame_marker", current_frame->marker);
  419|       |
  420|       |	/* It's possible that the data stack gets grown and shrunk rapidly.
  421|       |	   Try to avoid doing expensive work if the event isn't even used for
  422|       |	   anything. Note that at this point all the event fields must be
  423|       |	   set already that might potentially be used by the filters. */
  424|     21|	if (!event_want_debug(event_datastack))
  ------------------
  |  |   94|     21|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  ------------------
  |  |  |  |   93|     21|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  ------------------
  ------------------
  |  Branch (424:6): [True: 21, False: 0]
  ------------------
  425|     21|		return;
  426|       |
  427|       |	/* Getting backtrace is potentially inefficient, so do it after
  428|       |	   checking if the event is wanted. Note that this prevents using the
  429|       |	   backtrace field in event field comparisons. */
  430|      0|	const char *backtrace, *error;
  431|      0|	if (backtrace_get(&backtrace, &error) == 0)
  ------------------
  |  Branch (431:6): [True: 0, False: 0]
  ------------------
  432|      0|		event_add_str(event_datastack, "backtrace", backtrace);
  433|      0|	else
  434|      0|		event_add_str(event_datastack, "backtrace_error", error);
  435|       |
  436|      0|	string_t *str = t_str_new(128);
  437|      0|	str_printfa(str, "total_used=%zu, total_alloc=%zu, last_alloc_size=%zu",
  438|      0|		    data_stack_get_used_size(),
  439|      0|		    data_stack_get_alloc_size(),
  440|      0|		    last_alloc_size);
  441|       |#ifdef DEBUG
  442|       |	str_printfa(str, ", frame_bytes=%llu, frame_alloc_count=%u",
  443|       |		    current_frame->alloc_bytes, current_frame->alloc_count);
  444|       |#endif
  445|      0|	e_debug(event_datastack, "Growing data stack by %zu for '%s' (%s)",
  ------------------
  |  |   61|      0|#define e_debug(_event, ...) STMT_START { \
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |   62|      0|	struct event *_tmp_event = (_event); \
  |  |   63|      0|	if (event_want_debug(_tmp_event)) \
  |  |  ------------------
  |  |  |  |   94|      0|#define event_want_debug(_event) event_want_level((_event), LOG_TYPE_DEBUG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|      0|#define event_want_level(_event, level) event_want_level((_event), (level), __FILE__, __LINE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (93:41): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|      0|		e_debug(_tmp_event, __FILE__, __LINE__, __VA_ARGS__); \
  |  |   65|      0|	else \
  |  |   66|      0|		event_send_abort(_tmp_event); \
  |  |   67|      0|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  446|      0|		current_block->size, current_frame->marker,
  447|      0|		str_c(str));
  448|      0|}
data-stack.c:data_stack_after_last_alloc:
  106|  2.35M|{
  107|  2.35M|	return STACK_BLOCK_DATA(block) + (block->size - block->left);
  ------------------
  |  |   50|  2.35M|	(block->data + (SIZEOF_MEMBLOCK - sizeof(struct stack_block)))
  |  |  ------------------
  |  |  |  |   47|  2.35M|#define SIZEOF_MEMBLOCK MEM_ALIGN(sizeof(struct stack_block))
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  2.35M|	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  732|  2.35M|#define MEM_ALIGN_SIZE 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  732|  2.35M|#define MEM_ALIGN_SIZE 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  108|  2.35M|}
data-stack.c:mem_block_alloc:
  367|     22|{
  368|     22|	struct stack_block *block;
  369|     22|	size_t prev_size, alloc_size;
  370|       |
  371|     22|	prev_size = current_block == NULL ? 0 : current_block->size;
  ------------------
  |  Branch (371:14): [True: 1, False: 21]
  ------------------
  372|       |	/* Use INITIAL_STACK_SIZE without growing it to nearest power. */
  373|     22|	alloc_size = prev_size == 0 ? min_size :
  ------------------
  |  Branch (373:15): [True: 1, False: 21]
  ------------------
  374|     22|		nearest_power(MALLOC_ADD(prev_size, min_size));
  ------------------
  |  |   47|     21|	malloc_add_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  ------------------
  375|       |
  376|       |	/* nearest_power() returns 2^n values, so alloc_size can't be
  377|       |	   anywhere close to SIZE_MAX */
  378|     22|	block = malloc(SIZEOF_MEMBLOCK + alloc_size);
  ------------------
  |  |   47|     22|#define SIZEOF_MEMBLOCK MEM_ALIGN(sizeof(struct stack_block))
  |  |  ------------------
  |  |  |  |   22|     22|	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  732|     22|#define MEM_ALIGN_SIZE 8
  |  |  |  |  ------------------
  |  |  |  |               	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  732|     22|#define MEM_ALIGN_SIZE 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  379|     22|	if (unlikely(block == NULL)) {
  ------------------
  |  |  202|     22|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 22]
  |  |  |  Branch (202:44): [True: 0, False: 22]
  |  |  ------------------
  ------------------
  380|      0|		if (outofmem) {
  ------------------
  |  Branch (380:7): [True: 0, False: 0]
  ------------------
  381|      0|			if (min_size > outofmem_area.block.left)
  ------------------
  |  Branch (381:8): [True: 0, False: 0]
  ------------------
  382|      0|				abort();
  383|      0|			return &outofmem_area.block;
  384|      0|		}
  385|      0|		outofmem = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  386|      0|		i_panic("data stack: Out of memory when allocating %zu bytes",
  387|      0|			alloc_size + SIZEOF_MEMBLOCK);
  ------------------
  |  |   47|      0|#define SIZEOF_MEMBLOCK MEM_ALIGN(sizeof(struct stack_block))
  |  |  ------------------
  |  |  |  |   22|      0|	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  732|      0|#define MEM_ALIGN_SIZE 8
  |  |  |  |  ------------------
  |  |  |  |               	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  732|      0|#define MEM_ALIGN_SIZE 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  388|      0|	}
  389|     22|	block->size = alloc_size;
  390|     22|	block->canary = BLOCK_CANARY;
  ------------------
  |  |   26|     22|#  define BLOCK_CANARY NULL
  ------------------
  391|     22|	mem_block_reset(block);
  392|       |#ifdef DEBUG
  393|       |	memset(STACK_BLOCK_DATA(block), CLEAR_CHR, alloc_size);
  394|       |#endif
  395|     22|	return block;
  396|     22|}

event_filter_init:
 1188|      1|{
 1189|      1|	event_category_register_callback(event_filter_category_registered);
 1190|      1|}
event-filter.c:event_filter_category_registered:
 1174|      1|{
 1175|      1|	const bool add = category->internal != NULL;
 1176|      1|	struct event_filter_query_internal *query;
 1177|      1|	struct event_filter *filter;
 1178|       |
 1179|      1|	for (filter = event_filters; filter != NULL; filter = filter->next) {
  ------------------
  |  Branch (1179:31): [True: 0, False: 1]
  ------------------
 1180|      0|		array_foreach_modifiable(&filter->queries, query) {
  ------------------
  |  |   87|      0|	for (const void *elem ## _end = \
  |  |   88|      0|		(const char *)(elem = ARRAY_TYPE_CAST_MODIFIABLE(array) \
  |  |  ------------------
  |  |  |  |   54|      0|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  |  |   89|      0|			buffer_get_modifiable_data((array)->arr.buffer, NULL)) + \
  |  |   90|      0|			(array)->arr.buffer->used; \
  |  |   91|      0|	     elem != elem ## _end; (elem)++)
  |  |  ------------------
  |  |  |  Branch (91:7): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1181|      0|			event_filter_query_update_category(query, query->expr,
 1182|      0|							   category, add);
 1183|      0|		}
 1184|      0|	}
 1185|      1|}

event_want_log_level:
  274|  1.90M|{
  275|  1.90M|	struct failure_context ctx = { .type = LOG_TYPE_DEBUG };
  276|       |
  277|  1.90M|	if (level >= event->min_log_level) {
  ------------------
  |  Branch (277:6): [True: 0, False: 1.90M]
  ------------------
  278|       |		/* Always log when level is at least this high */
  279|      0|		return TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  280|      0|	}
  281|       |
  282|  1.90M|	if (event->debug_level_checked_filter_counter == event_filter_replace_counter) {
  ------------------
  |  Branch (282:6): [True: 1.40M, False: 505k]
  ------------------
  283|       |		/* Log filters haven't changed since we last checked this, so
  284|       |		   we can rely on the last cached value. FIXME: this doesn't
  285|       |		   work correctly if event changes and the change affects
  286|       |		   whether the filters would match. */
  287|  1.40M|		return event->sending_debug_log;
  288|  1.40M|	}
  289|   505k|	event->debug_level_checked_filter_counter =
  290|   505k|		event_filter_replace_counter;
  291|       |
  292|   505k|	if (event->forced_debug) {
  ------------------
  |  Branch (292:6): [True: 0, False: 505k]
  ------------------
  293|       |		/* Debugging is forced for this event (and its children) */
  294|      0|		event->sending_debug_log = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  295|   505k|	} else if (global_debug_log_filter != NULL &&
  ------------------
  |  Branch (295:13): [True: 0, False: 505k]
  ------------------
  296|   505k|		   event_filter_match_source(global_debug_log_filter, event,
  ------------------
  |  Branch (296:6): [True: 0, False: 0]
  ------------------
  297|      0|					     source_filename, source_linenum, &ctx)) {
  298|       |		/* log_debug filter matched */
  299|      0|		event->sending_debug_log = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  300|   505k|	} else if (global_core_log_filter != NULL &&
  ------------------
  |  Branch (300:13): [True: 0, False: 505k]
  ------------------
  301|   505k|		   event_filter_match_source(global_core_log_filter, event,
  ------------------
  |  Branch (301:6): [True: 0, False: 0]
  ------------------
  302|      0|					     source_filename, source_linenum, &ctx)) {
  303|       |		/* log_core_filter matched */
  304|      0|		event->sending_debug_log = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  305|   505k|	} else {
  306|   505k|		event->sending_debug_log = FALSE;
  ------------------
  |  |   11|   505k|#  define FALSE (!1)
  ------------------
  307|   505k|	}
  308|   505k|	return event->sending_debug_log;
  309|  1.90M|}
event_want_level:
  315|  1.90M|{
  316|  1.90M|	if (event_want_log_level(event, level, source_filename, source_linenum))
  ------------------
  |  Branch (316:6): [True: 0, False: 1.90M]
  ------------------
  317|      0|		return TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  318|       |
  319|       |	/* see if debug send filtering matches */
  320|  1.90M|	if (global_debug_send_filter != NULL) {
  ------------------
  |  Branch (320:6): [True: 0, False: 1.90M]
  ------------------
  321|      0|		struct failure_context ctx = { .type = LOG_TYPE_DEBUG };
  322|       |
  323|      0|		if (event_filter_match_source(global_debug_send_filter, event,
  ------------------
  |  Branch (323:7): [True: 0, False: 0]
  ------------------
  324|      0|					      source_filename, source_linenum,
  325|      0|					      &ctx))
  326|      0|			return TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  327|      0|	}
  328|  1.90M|	return FALSE;
  ------------------
  |  |   11|  1.90M|#  define FALSE (!1)
  ------------------
  329|  1.90M|}
event_set_forced_debug:
  411|  12.4k|{
  412|  12.4k|	if (force)
  ------------------
  |  Branch (412:6): [True: 0, False: 12.4k]
  ------------------
  413|      0|		event->forced_debug = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  414|  12.4k|	event_recalculate_debug_level(event);
  415|  12.4k|	return event;
  416|  12.4k|}

fd_close_on_exec:
   13|  6.21k|{
   14|  6.21k|	int flags;
   15|       |
   16|  6.21k|	flags = fcntl(fd, F_GETFD, 0);
   17|  6.21k|	if (flags < 0)
  ------------------
  |  Branch (17:6): [True: 0, False: 6.21k]
  ------------------
   18|      0|		i_fatal("fcntl(F_GETFD, %d) failed: %m", fd);
   19|       |
   20|  6.21k|	flags = set ? (flags | FD_CLOEXEC) : (flags & ~FD_CLOEXEC);
  ------------------
  |  Branch (20:10): [True: 6.21k, False: 0]
  ------------------
   21|  6.21k|	if (fcntl(fd, F_SETFD, flags) < 0)
  ------------------
  |  Branch (21:6): [True: 0, False: 6.21k]
  ------------------
   22|      0|		i_fatal("fcntl(F_SETFD, %d) failed: %m", fd);
   23|  6.21k|}
fd_set_nonblock:
  106|  18.6k|{
  107|  18.6k|	int flags;
  108|       |
  109|  18.6k|	i_assert(fd > -1);
  ------------------
  |  |  219|  18.6k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  18.6k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  18.6k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  18.6k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 18.6k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 18.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  18.6k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  18.6k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  18.6k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  110|       |
  111|  18.6k|	flags = fcntl(fd, F_GETFL, 0);
  112|  18.6k|	if (flags < 0)
  ------------------
  |  Branch (112:6): [True: 0, False: 18.6k]
  ------------------
  113|      0|		i_fatal("fcntl(%d, F_GETFL) failed: %m", fd);
  114|       |
  115|  18.6k|	if (nonblock)
  ------------------
  |  Branch (115:6): [True: 18.6k, False: 0]
  ------------------
  116|  18.6k|		flags |= O_NONBLOCK;
  117|      0|	else
  118|      0|		flags &= ENUM_NEGATE(O_NONBLOCK);
  ------------------
  |  |  288|      0|	((unsigned int)(~(x)) + COMPILE_ERROR_IF_TRUE(sizeof((x)) > sizeof(int) || (x) < 0 || (x) > INT_MAX))
  |  |  ------------------
  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  119|       |
  120|  18.6k|	if (fcntl(fd, F_SETFL, flags) < 0)
  ------------------
  |  Branch (120:6): [True: 0, False: 18.6k]
  ------------------
  121|      0|		i_fatal("fcntl(%d, F_SETFL) failed: %m", fd);
  122|  18.6k|}
fd_close_maybe_stdio:
  125|  6.21k|{
  126|  6.21k|	int *fdp[2] = { fd_in, fd_out };
  127|       |
  128|  6.21k|	if (*fd_in == *fd_out)
  ------------------
  |  Branch (128:6): [True: 6.21k, False: 0]
  ------------------
  129|  6.21k|		*fd_in = -1;
  130|       |
  131|  18.6k|	for (unsigned int i = 0; i < N_ELEMENTS(fdp); i++) {
  ------------------
  |  |   19|  18.6k|	(sizeof(arr) / sizeof((arr)[0]))
  ------------------
  |  Branch (131:27): [True: 12.4k, False: 6.21k]
  ------------------
  132|  12.4k|		if (*fdp[i] == -1)
  ------------------
  |  Branch (132:7): [True: 6.21k, False: 6.21k]
  ------------------
  133|  6.21k|			;
  134|  6.21k|		else if (*fdp[i] > 1)
  ------------------
  |  Branch (134:12): [True: 6.21k, False: 0]
  ------------------
  135|  6.21k|			i_close_fd(fdp[i]);
  ------------------
  |  |   24|  6.21k|#define i_close_fd(fd) i_close_fd_path((fd), NULL)
  |  |  ------------------
  |  |  |  |   23|  6.21k|#define i_close_fd_path(fd, path) i_close_fd_path((fd), (path), #fd, __func__, __FILE__, __LINE__)
  |  |  ------------------
  ------------------
  136|      0|		else if (dup2(dev_null_fd, *fdp[i]) == *fdp[i])
  ------------------
  |  Branch (136:12): [True: 0, False: 0]
  ------------------
  137|      0|			*fdp[i] = -1;
  138|      0|		else
  139|      0|			i_fatal("dup2(/dev/null, %d) failed: %m", *fdp[i]);
  140|  12.4k|	}
  141|  6.21k|}
i_close_fd_path:
  146|  6.21k|{
  147|  6.21k|	int saved_errno;
  148|       |
  149|  6.21k|	if (*fd == -1)
  ------------------
  |  Branch (149:6): [True: 0, False: 6.21k]
  ------------------
  150|      0|		return;
  151|       |
  152|  6.21k|	if (unlikely(*fd <= 0)) {
  ------------------
  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  ------------------
  ------------------
  153|      0|		i_panic("%s: close(%s%s%s) @ %s:%d attempted with fd=%d",
  154|      0|			func, arg,
  155|      0|			(path == NULL) ? "" : " = ",
  ------------------
  |  Branch (155:4): [True: 0, False: 0]
  ------------------
  156|      0|			(path == NULL) ? "" : path,
  ------------------
  |  Branch (156:4): [True: 0, False: 0]
  ------------------
  157|      0|			file, line, *fd);
  158|      0|	}
  159|       |
  160|  6.21k|	saved_errno = errno;
  161|       |	/* Ignore ECONNRESET because we don't really care about it here,
  162|       |	   as we are closing the socket down in any case. There might be
  163|       |	   unsent data but nothing we can do about that. */
  164|  6.21k|	if (unlikely(close(*fd) < 0 && errno != ECONNRESET))
  ------------------
  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  Branch (202:45): [True: 0, False: 6.21k]
  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  165|      0|		i_error("%s: close(%s%s%s) @ %s:%d failed (fd=%d): %m",
  166|      0|			func, arg,
  167|      0|			(path == NULL) ? "" : " = ",
  ------------------
  |  Branch (167:4): [True: 0, False: 0]
  ------------------
  168|      0|			(path == NULL) ? "" : path,
  ------------------
  |  Branch (168:4): [True: 0, False: 0]
  ------------------
  169|      0|			file, line, *fd);
  170|  6.21k|	errno = saved_errno;
  171|       |
  172|  6.21k|	*fd = -1;
  173|  6.21k|}

guid_128_host_hash_get:
   42|      1|{
   43|      1|	unsigned char full_hash[SHA1_RESULTLEN];
   44|       |
   45|      1|	sha1_get_digest(host, strlen(host), full_hash);
   46|      1|	memcpy(hash_r, full_hash + sizeof(full_hash)-GUID_128_HOST_HASH_SIZE,
  ------------------
  |  |   84|      1|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
   47|      1|	       GUID_128_HOST_HASH_SIZE);
   48|      1|}
guid_128_generate:
   51|  6.21k|{
   52|       |#if GUID_128_HOST_HASH_SIZE != 4
   53|       |#  error GUID_128_HOST_HASH_SIZE must be 4
   54|       |#endif
   55|  6.21k|	static struct timespec ts = { 0, 0 };
   56|  6.21k|	static uint8_t guid_static[8];
   57|  6.21k|	uint32_t pid;
   58|       |
   59|       |	/* we'll use the current time in nanoseconds as the initial 64bit
   60|       |	   counter. */
   61|  6.21k|	if (ts.tv_sec == 0) {
  ------------------
  |  Branch (61:6): [True: 1, False: 6.21k]
  ------------------
   62|      1|		if (clock_gettime(CLOCK_REALTIME, &ts) < 0)
  ------------------
  |  Branch (62:7): [True: 0, False: 1]
  ------------------
   63|      0|			i_fatal("clock_gettime() failed: %m");
   64|      1|		pid = getpid();
   65|       |
   66|      1|		guid_static[0] = (pid & 0x000000ff);
   67|      1|		guid_static[1] = (pid & 0x0000ff00) >> 8;
   68|      1|		guid_static[2] = (pid & 0x00ff0000) >> 16;
   69|      1|		guid_static[3] = (pid & 0xff000000) >> 24;
   70|      1|		guid_128_host_hash_get(my_hostdomain(), guid_static+4);
   71|  6.21k|	} else if (ioloop_timeval.tv_sec > ts.tv_sec ||
  ------------------
  |  Branch (71:13): [True: 44, False: 6.17k]
  ------------------
   72|  6.21k|		   (ioloop_timeval.tv_sec == ts.tv_sec &&
  ------------------
  |  Branch (72:7): [True: 6.17k, False: 0]
  ------------------
   73|  6.21k|		    ioloop_timeval.tv_usec * 1000 > ts.tv_nsec)) {
  ------------------
  |  Branch (73:7): [True: 6.17k, False: 0]
  ------------------
   74|       |		/* use ioloop's time since we have it. it doesn't provide any
   75|       |		   more uniqueness, but it allows finding out more reliably
   76|       |		   when a GUID was created. */
   77|  6.21k|		ts.tv_sec = ioloop_timeval.tv_sec;
   78|  6.21k|		ts.tv_nsec = ioloop_timeval.tv_usec*1000;
   79|  6.21k|	} else if (ts.tv_nsec < 999999999L) {
  ------------------
  |  Branch (79:13): [True: 0, False: 0]
  ------------------
   80|      0|		ts.tv_nsec++;
   81|      0|	} else {
   82|      0|		ts.tv_sec++;
   83|      0|		ts.tv_nsec = 0;
   84|      0|	}
   85|       |
   86|  6.21k|	guid_r[0] = (ts.tv_nsec & 0x000000ff);
   87|  6.21k|	guid_r[1] = (ts.tv_nsec & 0x0000ff00) >> 8;
   88|  6.21k|	guid_r[2] = (ts.tv_nsec & 0x00ff0000) >> 16;
   89|  6.21k|	guid_r[3] = (ts.tv_nsec & 0xff000000) >> 24;
   90|  6.21k|	guid_r[4] = (ts.tv_sec & 0x000000ff);
   91|  6.21k|	guid_r[5] = (ts.tv_sec & 0x0000ff00) >> 8;
   92|  6.21k|	guid_r[6] = (ts.tv_sec & 0x00ff0000) >> 16;
   93|  6.21k|	guid_r[7] = (ts.tv_sec & 0xff000000) >> 24;
   94|  6.21k|	memcpy(guid_r + 8, guid_static, 8);
  ------------------
  |  |   84|  6.21k|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
   95|  6.21k|}

hostpid_init:
   18|      1|{
   19|      1|	static char pid[MAX_INT_STRLEN];
   20|      1|	char hostname[256];
   21|      1|	const char *value;
   22|       |
   23|       |	/* allow calling hostpid_init() multiple times to reset hostname */
   24|      1|	i_free_and_null(my_hostname_dup);
  ------------------
  |  |   27|      1|#define i_free_and_null(mem) i_free(mem)
  |  |  ------------------
  |  |  |  |   19|      1|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  135|      1|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|      1|	STMT_START { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   63|      1|#  define STMT_START do
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  132|      1|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  |  |  133|      1|		(mem) = NULL;			\
  |  |  |  |  |  |  |  |  134|      1|	} STMT_END
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   64|      1|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   25|      1|	i_free_and_null(my_domain);
  ------------------
  |  |   27|      1|#define i_free_and_null(mem) i_free(mem)
  |  |  ------------------
  |  |  |  |   19|      1|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  135|      1|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|      1|	STMT_START { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   63|      1|#  define STMT_START do
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  132|      1|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  |  |  133|      1|		(mem) = NULL;			\
  |  |  |  |  |  |  |  |  134|      1|	} STMT_END
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   64|      1|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   26|       |
   27|      1|	value = getenv(MY_HOSTNAME_ENV);
  ------------------
  |  |    6|      1|#define MY_HOSTNAME_ENV "DOVECOT_HOSTNAME"
  ------------------
   28|      1|	if (value == NULL) {
  ------------------
  |  Branch (28:6): [True: 1, False: 0]
  ------------------
   29|      1|		if (gethostname(hostname, sizeof(hostname)-1) < 0)
  ------------------
  |  Branch (29:7): [True: 0, False: 1]
  ------------------
   30|      0|			i_fatal("gethostname() failed: %m");
   31|      1|		hostname[sizeof(hostname)-1] = '\0';
   32|      1|		value = hostname;
   33|      1|	}
   34|       |
   35|      1|	if (value[0] == '\0' ||
  ------------------
  |  Branch (35:6): [True: 0, False: 1]
  ------------------
   36|      1|	    strcspn(value, HOSTNAME_DISALLOWED_CHARS) != strlen(value))
  ------------------
  |  |    9|      1|#define HOSTNAME_DISALLOWED_CHARS "/\r\n\t"
  ------------------
  |  Branch (36:6): [True: 0, False: 1]
  ------------------
   37|      0|		i_fatal("Invalid system hostname: '%s'", value);
   38|      1|	my_hostname_dup = i_strdup(value);
   39|      1|	my_hostname = my_hostname_dup;
   40|       |
   41|      1|	i_snprintf(pid, sizeof(pid), "%lld", (long long)getpid());
   42|      1|	my_pid = pid;
   43|      1|}
my_hostdomain:
   52|  6.21k|{
   53|  6.21k|	struct hostent *hent;
   54|  6.21k|	const char *name;
   55|       |
   56|  6.21k|	if (my_domain == NULL) {
  ------------------
  |  Branch (56:6): [True: 1, False: 6.21k]
  ------------------
   57|      1|		name = getenv(MY_HOSTDOMAIN_ENV);
  ------------------
  |  |    7|      1|#define MY_HOSTDOMAIN_ENV "DOVECOT_HOSTDOMAIN"
  ------------------
   58|      1|		if (name == NULL) {
  ------------------
  |  Branch (58:7): [True: 1, False: 0]
  ------------------
   59|      1|			hent = gethostbyname(my_hostname);
   60|      1|			name = hent != NULL ? hent->h_name : NULL;
  ------------------
  |  Branch (60:11): [True: 1, False: 0]
  ------------------
   61|      1|			if (name == NULL) {
  ------------------
  |  Branch (61:8): [True: 0, False: 1]
  ------------------
   62|       |				/* failed, use just the hostname */
   63|      0|				name = my_hostname;
   64|      0|			}
   65|      1|		}
   66|      1|		my_domain = i_strdup(name);
   67|      1|	}
   68|  6.21k|	return my_domain;
   69|  6.21k|}

i_malloc:
    8|  8.82k|{
    9|  8.82k|	return p_malloc(default_pool, size);
   10|  8.82k|}
i_realloc:
   13|  12.1k|{
   14|  12.1k|	return p_realloc(default_pool, mem, old_size, new_size);
   15|  12.1k|}
i_strdup:
   18|   343k|{
   19|   343k|	return p_strdup(default_pool, str);
   20|   343k|}
i_strdup_until:
   33|   184k|{
   34|   184k|	return p_strdup_until(default_pool, str, end);
   35|   184k|}
i_strdup_vprintf:
   55|  20.8k|{
   56|  20.8k|	return p_strdup_vprintf(default_pool, format, args);
   57|  20.8k|}

io_loop_handler_init:
   23|  6.21k|{
   24|  6.21k|	struct ioloop_handler_context *ctx;
   25|       |
   26|  6.21k|	ioloop->handler_context = ctx = i_new(struct ioloop_handler_context, 1);
  ------------------
  |  |    8|  6.21k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  6.21k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  6.21k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  6.21k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   27|       |
   28|  6.21k|	i_array_init(&ctx->events, initial_fd_count);
  ------------------
  |  |   46|  6.21k|	p_array_init(array, default_pool, init_count)
  |  |  ------------------
  |  |  |  |   44|  6.21k|	array_create(array, pool, sizeof(**(array)->v), init_count)
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  6.21k|	array_create_i(&(array)->arr, pool, element_size, init_count)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   29|  6.21k|	i_array_init(&ctx->fd_index, initial_fd_count);
  ------------------
  |  |   46|  6.21k|	p_array_init(array, default_pool, init_count)
  |  |  ------------------
  |  |  |  |   44|  6.21k|	array_create(array, pool, sizeof(**(array)->v), init_count)
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  6.21k|	array_create_i(&(array)->arr, pool, element_size, init_count)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   30|       |
   31|  6.21k|	ctx->epfd = epoll_create(initial_fd_count);
   32|  6.21k|	if (ctx->epfd < 0) {
  ------------------
  |  Branch (32:6): [True: 0, False: 6.21k]
  ------------------
   33|      0|		if (errno != EMFILE)
  ------------------
  |  Branch (33:7): [True: 0, False: 0]
  ------------------
   34|      0|			i_fatal("epoll_create(): %m");
   35|      0|		else {
   36|      0|			i_fatal("epoll_create(): %m (you may need to increase "
   37|      0|				"/proc/sys/fs/epoll/max_user_instances)");
   38|      0|		}
   39|      0|	}
   40|  6.21k|	fd_close_on_exec(ctx->epfd, TRUE);
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   41|  6.21k|}
io_loop_handler_deinit:
   44|  6.21k|{
   45|  6.21k|	struct ioloop_handler_context *ctx = ioloop->handler_context;
   46|  6.21k|	struct io_list **list;
   47|  6.21k|	unsigned int i, count;
   48|       |
   49|  6.21k|	list = array_get_modifiable(&ctx->fd_index, &count);
  ------------------
  |  |  306|  6.21k|	ARRAY_TYPE_CAST_MODIFIABLE(array) \
  |  |  ------------------
  |  |  |  |   54|  6.21k|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  |  |  307|  6.21k|		array_get_modifiable_i(&(array)->arr, count)
  ------------------
   50|  49.7k|	for (i = 0; i < count; i++)
  ------------------
  |  Branch (50:14): [True: 43.5k, False: 6.21k]
  ------------------
   51|  43.5k|		i_free(list[i]);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  43.5k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  43.5k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  43.5k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  43.5k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  43.5k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  43.5k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   52|       |
   53|  6.21k|	if (close(ctx->epfd) < 0)
  ------------------
  |  Branch (53:6): [True: 0, False: 6.21k]
  ------------------
   54|      0|		i_error("close(epoll) failed: %m");
   55|  6.21k|	array_free(&ioloop->handler_context->fd_index);
  ------------------
  |  |  160|  6.21k|	array_free_i(&(array)->arr)
  ------------------
   56|  6.21k|	array_free(&ioloop->handler_context->events);
  ------------------
  |  |  160|  6.21k|	array_free_i(&(array)->arr)
  ------------------
   57|  6.21k|	i_free(ioloop->handler_context);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   58|  6.21k|}
io_loop_handle_add:
   87|  93.5k|{
   88|  93.5k|	struct ioloop_handler_context *ctx = io->io.ioloop->handler_context;
   89|  93.5k|	struct io_list **list;
   90|  93.5k|	struct epoll_event event;
   91|  93.5k|	int op;
   92|  93.5k|	bool first;
   93|       |
   94|  93.5k|	list = array_idx_get_space(&ctx->fd_index, io->fd);
  ------------------
  |  |  317|  93.5k|	ARRAY_TYPE_CAST_MODIFIABLE(array) \
  |  |  ------------------
  |  |  |  |   54|  93.5k|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  |  |  318|  93.5k|		array_idx_get_space_i(&(array)->arr, idx)
  ------------------
   95|  93.5k|	if (*list == NULL)
  ------------------
  |  Branch (95:6): [True: 12.4k, False: 81.0k]
  ------------------
   96|  12.4k|		*list = i_new(struct io_list, 1);
  ------------------
  |  |    8|  12.4k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  12.4k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  12.4k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  12.4k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  12.4k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  12.4k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   97|       |
   98|  93.5k|	first = ioloop_iolist_add(*list, io);
   99|       |
  100|  93.5k|	i_zero(&event);
  ------------------
  |  |  249|  93.5k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  93.5k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  93.5k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  101|  93.5k|	event.data.ptr = *list;
  102|  93.5k|	event.events = epoll_event_mask(*list);
  103|       |
  104|  93.5k|	op = first ? EPOLL_CTL_ADD : EPOLL_CTL_MOD;
  ------------------
  |  Branch (104:7): [True: 49.0k, False: 44.4k]
  ------------------
  105|       |
  106|  93.5k|	if (epoll_ctl(ctx->epfd, op, io->fd, &event) < 0) {
  ------------------
  |  Branch (106:6): [True: 0, False: 93.5k]
  ------------------
  107|      0|		if (errno == EPERM && op == EPOLL_CTL_ADD) {
  ------------------
  |  Branch (107:7): [True: 0, False: 0]
  |  Branch (107:25): [True: 0, False: 0]
  ------------------
  108|      0|			i_panic("epoll_ctl(add, %d) failed: %m "
  109|      0|				"(fd doesn't support epoll%s)", io->fd,
  110|      0|				io->fd != STDIN_FILENO ? "" :
  ------------------
  |  Branch (110:5): [True: 0, False: 0]
  ------------------
  111|      0|				" - instead of '<file', try 'cat file|'");
  112|      0|		}
  113|      0|		i_panic("epoll_ctl(%s, %d) failed: %m",
  114|      0|			op == EPOLL_CTL_ADD ? "add" : "mod", io->fd);
  ------------------
  |  Branch (114:4): [True: 0, False: 0]
  ------------------
  115|      0|	}
  116|       |
  117|  93.5k|	if (first) {
  ------------------
  |  Branch (117:6): [True: 49.0k, False: 44.4k]
  ------------------
  118|       |		/* allow epoll_wait() to return the maximum number of events
  119|       |		   by keeping space allocated for each file descriptor */
  120|  49.0k|		if (ctx->deleted_count > 0)
  ------------------
  |  Branch (120:7): [True: 36.6k, False: 12.4k]
  ------------------
  121|  36.6k|			ctx->deleted_count--;
  122|  12.4k|		else
  123|  12.4k|			array_append_zero(&ctx->events);
  ------------------
  |  |  341|  12.4k|	(void)array_append_space_i(&(array)->arr)
  ------------------
  124|  49.0k|	}
  125|  93.5k|}
io_loop_handle_remove:
  128|  93.5k|{
  129|  93.5k|	struct ioloop_handler_context *ctx = io->io.ioloop->handler_context;
  130|  93.5k|	struct io_list **list;
  131|  93.5k|	struct epoll_event event;
  132|  93.5k|	int op;
  133|  93.5k|	bool last;
  134|       |
  135|  93.5k|	list = array_idx_modifiable(&ctx->fd_index, io->fd);
  ------------------
  |  |  312|  93.5k|	ARRAY_TYPE_CAST_MODIFIABLE(array) \
  |  |  ------------------
  |  |  |  |   54|  93.5k|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  |  |  313|  93.5k|		array_idx_modifiable_i(&(array)->arr, idx)
  ------------------
  136|  93.5k|	last = ioloop_iolist_del(*list, io);
  137|       |
  138|  93.5k|	if (!closed) {
  ------------------
  |  Branch (138:6): [True: 93.5k, False: 0]
  ------------------
  139|  93.5k|		i_zero(&event);
  ------------------
  |  |  249|  93.5k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  93.5k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  93.5k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  140|  93.5k|		event.data.ptr = *list;
  141|  93.5k|		event.events = epoll_event_mask(*list);
  142|       |
  143|  93.5k|		op = last ? EPOLL_CTL_DEL : EPOLL_CTL_MOD;
  ------------------
  |  Branch (143:8): [True: 49.0k, False: 44.4k]
  ------------------
  144|       |
  145|  93.5k|		if (epoll_ctl(ctx->epfd, op, io->fd, &event) < 0) {
  ------------------
  |  Branch (145:7): [True: 0, False: 93.5k]
  ------------------
  146|      0|			const char *errstr = t_strdup_printf(
  147|      0|				"epoll_ctl(%s, %d) failed: %m",
  148|      0|				op == EPOLL_CTL_DEL ? "del" : "mod", io->fd);
  ------------------
  |  Branch (148:5): [True: 0, False: 0]
  ------------------
  149|      0|			if (errno != ENOSPC && errno != ENOMEM)
  ------------------
  |  Branch (149:8): [True: 0, False: 0]
  |  Branch (149:27): [True: 0, False: 0]
  ------------------
  150|      0|				i_panic("%s", errstr);
  151|      0|			else
  152|      0|				i_error("%s", errstr);
  153|      0|		}
  154|  93.5k|	}
  155|  93.5k|	if (last) {
  ------------------
  |  Branch (155:6): [True: 49.0k, False: 44.4k]
  ------------------
  156|       |		/* since we're not freeing memory in any case, just increase
  157|       |		   deleted counter so next handle_add() can just decrease it
  158|       |		   instead of appending to the events array */
  159|  49.0k|		ctx->deleted_count++;
  160|  49.0k|	}
  161|  93.5k|	i_free(io);
  ------------------
  |  |   19|  93.5k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  93.5k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  93.5k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  93.5k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  93.5k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  93.5k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  93.5k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  93.5k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  162|  93.5k|}
io_loop_handler_run_internal:
  165|  37.8k|{
  166|  37.8k|	struct ioloop_handler_context *ctx = ioloop->handler_context;
  167|  37.8k|	struct epoll_event *events;
  168|  37.8k|	const struct epoll_event *event;
  169|  37.8k|	struct io_list *list;
  170|  37.8k|	struct io_file *io;
  171|  37.8k|	struct timeval tv;
  172|  37.8k|	unsigned int events_count;
  173|  37.8k|	int msecs, ret, i, j;
  174|  37.8k|	bool call;
  175|       |
  176|  37.8k|	i_assert(ctx != NULL);
  ------------------
  |  |  219|  37.8k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  37.8k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  37.8k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  37.8k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 37.8k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 37.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  37.8k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  37.8k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  37.8k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  177|       |
  178|       |        /* get the time left for next timeout task */
  179|  37.8k|	msecs = io_loop_run_get_wait_time(ioloop, &tv);
  180|       |
  181|  37.8k|	events = array_get_modifiable(&ctx->events, &events_count);
  ------------------
  |  |  306|  37.8k|	ARRAY_TYPE_CAST_MODIFIABLE(array) \
  |  |  ------------------
  |  |  |  |   54|  37.8k|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  |  |  307|  37.8k|		array_get_modifiable_i(&(array)->arr, count)
  ------------------
  182|  37.8k|	if (ioloop->io_files != NULL && events_count > ctx->deleted_count) {
  ------------------
  |  Branch (182:6): [True: 34.0k, False: 3.72k]
  |  Branch (182:34): [True: 34.0k, False: 0]
  ------------------
  183|  34.0k|		ret = epoll_wait(ctx->epfd, events, events_count, msecs);
  184|  34.0k|		if (ret < 0 && errno != EINTR)
  ------------------
  |  Branch (184:7): [True: 0, False: 34.0k]
  |  Branch (184:18): [True: 0, False: 0]
  ------------------
  185|      0|			i_fatal("epoll_wait(): %m");
  186|  34.0k|	} else {
  187|       |		/* no I/Os, but we should have some timeouts.
  188|       |		   just wait for them. */
  189|  3.72k|		i_assert(msecs >= 0);
  ------------------
  |  |  219|  3.72k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  3.72k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  3.72k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  3.72k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 3.72k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 3.72k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  3.72k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  3.72k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  3.72k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  190|  3.72k|		i_sleep_intr_msecs(msecs);
  191|  3.72k|		ret = 0;
  192|  3.72k|	}
  193|       |
  194|       |	/* execute timeout handlers */
  195|  37.8k|        io_loop_handle_timeouts(ioloop);
  196|       |
  197|  37.8k|	if (!ioloop->running)
  ------------------
  |  Branch (197:6): [True: 0, False: 37.8k]
  ------------------
  198|      0|		return;
  199|       |
  200|  71.6k|	for (i = 0; i < ret; i++) {
  ------------------
  |  Branch (200:14): [True: 34.3k, False: 37.2k]
  ------------------
  201|       |		/* io_loop_handle_add() may cause events array reallocation,
  202|       |		   so we have use array_idx() */
  203|  34.3k|		event = array_idx(&ctx->events, i);
  ------------------
  |  |  287|  34.3k|	ARRAY_TYPE_CAST_CONST(array)array_idx_i(&(array)->arr, idx)
  |  |  ------------------
  |  |  |  |   52|  34.3k|	(typeof(*(array)->v))
  |  |  ------------------
  ------------------
  204|  34.3k|		list = event->data.ptr;
  205|       |
  206|   136k|		for (j = 0; j < IOLOOP_IOLIST_IOS_PER_FD; j++) {
  ------------------
  |  Branch (206:15): [True: 102k, False: 33.7k]
  ------------------
  207|   102k|			io = list->ios[j];
  208|   102k|			if (io == NULL)
  ------------------
  |  Branch (208:8): [True: 67.9k, False: 34.5k]
  ------------------
  209|  67.9k|				continue;
  210|       |
  211|  34.5k|			call = FALSE;
  ------------------
  |  |   11|  34.5k|#  define FALSE (!1)
  ------------------
  212|  34.5k|			if ((event->events & (EPOLLHUP | EPOLLERR)) != 0)
  ------------------
  |  Branch (212:8): [True: 0, False: 34.5k]
  ------------------
  213|      0|				call = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  214|  34.5k|			else if ((io->io.condition & IO_READ) != 0)
  ------------------
  |  Branch (214:13): [True: 224, False: 34.3k]
  ------------------
  215|    224|				call = (event->events & EPOLLIN) != 0;
  216|  34.3k|			else if ((io->io.condition & IO_WRITE) != 0)
  ------------------
  |  Branch (216:13): [True: 34.3k, False: 0]
  ------------------
  217|  34.3k|				call = (event->events & EPOLLOUT) != 0;
  218|      0|			else if ((io->io.condition & IO_ERROR) != 0)
  ------------------
  |  Branch (218:13): [True: 0, False: 0]
  ------------------
  219|      0|				call = (event->events & IO_EPOLL_ERROR) != 0;
  ------------------
  |  |   60|      0|#define IO_EPOLL_ERROR (EPOLLERR | EPOLLHUP)
  ------------------
  220|       |
  221|  34.5k|			if (call) {
  ------------------
  |  Branch (221:8): [True: 34.3k, False: 204]
  ------------------
  222|  34.3k|				io_loop_call_io(&io->io);
  223|  34.3k|				if (!ioloop->running)
  ------------------
  |  Branch (223:9): [True: 548, False: 33.7k]
  ------------------
  224|    548|					return;
  225|  34.3k|			}
  226|  34.5k|		}
  227|  34.3k|	}
  228|  37.8k|}
ioloop-epoll.c:epoll_event_mask:
   65|   187k|{
   66|   187k|	int events = 0, i;
   67|   187k|	struct io_file *io;
   68|       |
   69|   748k|	for (i = 0; i < IOLOOP_IOLIST_IOS_PER_FD; i++) {
  ------------------
  |  Branch (69:14): [True: 561k, False: 187k]
  ------------------
   70|   561k|		io = list->ios[i];
   71|       |
   72|   561k|		if (io == NULL)
  ------------------
  |  Branch (72:7): [True: 378k, False: 182k]
  ------------------
   73|   378k|			continue;
   74|       |
   75|   182k|		if ((io->io.condition & IO_READ) != 0)
  ------------------
  |  Branch (75:7): [True: 80.7k, False: 101k]
  ------------------
   76|  80.7k|			events |= IO_EPOLL_INPUT;
  ------------------
  |  |   61|  80.7k|#define IO_EPOLL_INPUT (EPOLLIN | EPOLLPRI | IO_EPOLL_ERROR)
  |  |  ------------------
  |  |  |  |   60|  80.7k|#define IO_EPOLL_ERROR (EPOLLERR | EPOLLHUP)
  |  |  ------------------
  ------------------
   77|   182k|		if ((io->io.condition & IO_WRITE) != 0)
  ------------------
  |  Branch (77:7): [True: 101k, False: 80.7k]
  ------------------
   78|   101k|			events |= IO_EPOLL_OUTPUT;
  ------------------
  |  |   62|   101k|#define IO_EPOLL_OUTPUT	(EPOLLOUT | IO_EPOLL_ERROR)
  |  |  ------------------
  |  |  |  |   60|   101k|#define IO_EPOLL_ERROR (EPOLLERR | EPOLLHUP)
  |  |  ------------------
  ------------------
   79|   182k|		if ((io->io.condition & IO_ERROR) != 0)
  ------------------
  |  Branch (79:7): [True: 0, False: 182k]
  ------------------
   80|      0|			events |= IO_EPOLL_ERROR;
  ------------------
  |  |   60|      0|#define IO_EPOLL_ERROR (EPOLLERR | EPOLLHUP)
  ------------------
   81|   182k|	}
   82|       |
   83|   187k|	return events;
   84|   187k|}

ioloop_iolist_add:
   12|  93.5k|{
   13|  93.5k|	int i, idx;
   14|       |
   15|  93.5k|	if ((io->io.condition & IO_READ) != 0)
  ------------------
  |  Branch (15:6): [True: 55.3k, False: 38.1k]
  ------------------
   16|  55.3k|		idx = IOLOOP_IOLIST_INPUT;
   17|  38.1k|	else if ((io->io.condition & IO_WRITE) != 0)
  ------------------
  |  Branch (17:11): [True: 38.1k, False: 0]
  ------------------
   18|  38.1k|		idx = IOLOOP_IOLIST_OUTPUT;
   19|      0|	else if ((io->io.condition & IO_ERROR) != 0)
  ------------------
  |  Branch (19:11): [True: 0, False: 0]
  ------------------
   20|      0|		idx = IOLOOP_IOLIST_ERROR;
   21|      0|	else {
   22|      0|		i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
   23|      0|	}
   24|       |
   25|  93.5k|	if (list->ios[idx] != NULL) {
  ------------------
  |  Branch (25:6): [True: 0, False: 93.5k]
  ------------------
   26|      0|		i_panic("io_add(0x%x) called twice fd=%d, callback=%p -> %p",
   27|      0|			io->io.condition, io->fd, list->ios[idx]->io.callback,
   28|      0|			io->io.callback);
   29|      0|	}
   30|  93.5k|	i_assert(list->ios[idx] == NULL);
  ------------------
  |  |  219|  93.5k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  93.5k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  93.5k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  93.5k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 93.5k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 93.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  93.5k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  93.5k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  93.5k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   31|  93.5k|	list->ios[idx] = io;
   32|       |
   33|       |	/* check if this was the first one */
   34|   259k|	for (i = 0; i < IOLOOP_IOLIST_IOS_PER_FD; i++) {
  ------------------
  |  Branch (34:14): [True: 210k, False: 49.0k]
  ------------------
   35|   210k|		if (i != idx && list->ios[i] != NULL)
  ------------------
  |  Branch (35:7): [True: 142k, False: 68.3k]
  |  Branch (35:19): [True: 44.4k, False: 98.1k]
  ------------------
   36|  44.4k|			return FALSE;
  ------------------
  |  |   11|  44.4k|#  define FALSE (!1)
  ------------------
   37|   210k|	}
   38|       |
   39|  49.0k|	return TRUE;
  ------------------
  |  |   15|  49.0k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  49.0k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   40|  93.5k|}
ioloop_iolist_del:
   43|  93.5k|{
   44|  93.5k|	bool last = TRUE;
  ------------------
  |  |   15|  93.5k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  93.5k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   45|  93.5k|	int i;
   46|       |
   47|   374k|	for (i = 0; i < IOLOOP_IOLIST_IOS_PER_FD; i++) {
  ------------------
  |  Branch (47:14): [True: 280k, False: 93.5k]
  ------------------
   48|   280k|		if (list->ios[i] != NULL) {
  ------------------
  |  Branch (48:7): [True: 137k, False: 142k]
  ------------------
   49|   137k|			if (list->ios[i] == io)
  ------------------
  |  Branch (49:8): [True: 93.5k, False: 44.4k]
  ------------------
   50|  93.5k|				list->ios[i] = NULL;
   51|  44.4k|			else
   52|  44.4k|				last = FALSE;
  ------------------
  |  |   11|  44.4k|#  define FALSE (!1)
  ------------------
   53|   137k|		}
   54|   280k|	}
   55|  93.5k|	return last;
   56|  93.5k|}

io_add_to:
   90|  38.1k|{
   91|  38.1k|	struct io_file *io;
   92|       |
   93|  38.1k|	i_assert(fd >= 0);
  ------------------
  |  |  219|  38.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  38.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  38.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  38.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 38.1k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 38.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  38.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  38.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  38.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   94|  38.1k|	io = io_add_file(ioloop, fd, condition,
   95|  38.1k|			 source_filename, source_linenum,
   96|  38.1k|			 callback, context);
   97|  38.1k|	return &io->io;
   98|  38.1k|}
io_add_istream_to:
  116|  55.3k|{
  117|  55.3k|	struct io_file *io;
  118|       |
  119|  55.3k|	io = io_add_file(ioloop, i_stream_get_fd(input), IO_READ,
  120|  55.3k|			 source_filename, source_linenum, callback, context);
  121|  55.3k|	io->istream = input;
  122|  55.3k|	i_stream_ref(io->istream);
  123|  55.3k|	i_stream_set_io(io->istream, &io->io);
  124|  55.3k|	return &io->io;
  125|  55.3k|}
io_add_istream:
  131|  11.0k|{
  132|  11.0k|	return io_add_istream_to(current_ioloop, input,
  133|  11.0k|				 source_filename, source_linenum,
  134|  11.0k|				 callback, context);
  135|  11.0k|}
io_remove:
  198|   174k|{
  199|   174k|	if (*io == NULL)
  ------------------
  |  Branch (199:6): [True: 80.8k, False: 93.5k]
  ------------------
  200|  80.8k|		return;
  201|       |
  202|  93.5k|	io_remove_full(io, FALSE);
  ------------------
  |  |   11|  93.5k|#  define FALSE (!1)
  ------------------
  203|  93.5k|}
io_set_pending:
  216|   115k|{
  217|   115k|	i_assert((io->condition & IO_NOTIFY) == 0);
  ------------------
  |  |  219|   115k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   115k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   115k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   115k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 115k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 115k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   115k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   115k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   115k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  218|       |
  219|   115k|	if (!io->pending) {
  ------------------
  |  Branch (219:6): [True: 47.7k, False: 68.1k]
  ------------------
  220|  47.7k|		io->pending = TRUE;
  ------------------
  |  |   15|  47.7k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  47.7k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  221|  47.7k|		io->ioloop->io_pending_count++;
  222|  47.7k|	}
  223|   115k|}
io_is_pending:
  226|  55.3k|{
  227|  55.3k|	return io->pending;
  228|  55.3k|}
timeout_add_to:
  286|  44.0k|{
  287|  44.0k|	struct timeout *timeout;
  288|       |
  289|  44.0k|	timeout = timeout_add_common(ioloop, source_filename, source_linenum,
  290|  44.0k|				     callback, context);
  291|  44.0k|	timeout->msecs = msecs;
  292|       |
  293|  44.0k|	if (msecs > 0) {
  ------------------
  |  Branch (293:6): [True: 44.0k, False: 0]
  ------------------
  294|       |		/* start this timeout in the next run cycle */
  295|  44.0k|		array_push_back(&timeout->ioloop->timeouts_new, &timeout);
  ------------------
  |  |  282|  44.0k|#define array_push_back(array, item) array_append(array, (item), 1)
  |  |  ------------------
  |  |  |  |  214|  44.0k|	TYPE_CHECKS(void, ARRAY_TYPE_CHECK(array, data), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  44.0k|	(FALSE ? (return_type)(checks) : (func))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  44.0k|#  define FALSE (!1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (11:17): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:25): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  215|  44.0k|	array_append_i(&(array)->arr, data, count))
  |  |  ------------------
  ------------------
  296|  44.0k|	} else {
  297|       |		/* Trigger zero timeouts as soon as possible. When ioloop is
  298|       |		   running, refresh the timestamp to prevent infinite loops
  299|       |		   in case a timeout callback keeps recreating the 0-timeout. */
  300|      0|		timeout_update_next(timeout, timeout->ioloop->running ?
  ------------------
  |  Branch (300:32): [True: 0, False: 0]
  ------------------
  301|      0|			    NULL : &ioloop_timeval);
  302|      0|		priorityq_add(timeout->ioloop->timeouts, &timeout->item);
  303|      0|	}
  304|  44.0k|	return timeout;
  305|  44.0k|}
timeout_add:
  311|  44.0k|{
  312|  44.0k|	return timeout_add_to(current_ioloop, msecs,
  313|  44.0k|			      source_filename, source_linenum,
  314|  44.0k|			      callback, context);
  315|  44.0k|}
timeout_add_short:
  333|  6.21k|{
  334|  6.21k|	return timeout_add(msecs, source_filename, source_linenum,
  335|  6.21k|			   callback, context);
  336|  6.21k|}
timeout_remove:
  398|   135k|{
  399|   135k|	struct timeout *timeout = *_timeout;
  400|   135k|	struct ioloop *ioloop;
  401|       |
  402|   135k|	if (timeout == NULL)
  ------------------
  |  Branch (402:6): [True: 91.0k, False: 44.0k]
  ------------------
  403|  91.0k|		return;
  404|       |
  405|  44.0k|	ioloop = timeout->ioloop;
  406|       |
  407|  44.0k|	*_timeout = NULL;
  408|  44.0k|	if (timeout->item.idx != UINT_MAX)
  ------------------
  |  Branch (408:6): [True: 15.7k, False: 28.3k]
  ------------------
  409|  15.7k|		priorityq_remove(timeout->ioloop->timeouts, &timeout->item);
  410|  28.3k|	else if (!timeout->one_shot && timeout->msecs > 0) {
  ------------------
  |  Branch (410:11): [True: 28.3k, False: 0]
  |  Branch (410:33): [True: 28.3k, False: 0]
  ------------------
  411|  28.3k|		struct timeout *const *to_idx;
  412|  28.3k|		array_foreach(&ioloop->timeouts_new, to_idx) {
  ------------------
  |  |   83|  28.3k|	for (const void *elem ## __foreach_end = \
  |  |   84|  28.3k|		(const char *)(elem = *(array)->v) + (array)->arr.buffer->used; \
  |  |   85|  28.3k|	     elem != elem ## __foreach_end; (elem)++)
  |  |  ------------------
  |  |  |  Branch (85:7): [True: 28.3k, False: 0]
  |  |  ------------------
  ------------------
  413|  28.3k|			if (*to_idx == timeout) {
  ------------------
  |  Branch (413:8): [True: 28.3k, False: 0]
  ------------------
  414|  28.3k|				array_delete(&ioloop->timeouts_new,
  ------------------
  |  |  246|  28.3k|	array_delete_i(&(array)->arr, idx, count)
  ------------------
  415|  28.3k|					array_foreach_idx(&ioloop->timeouts_new, to_idx), 1);
  416|  28.3k|				break;
  417|  28.3k|			}
  418|  28.3k|		}
  419|  28.3k|	}
  420|  44.0k|	timeout_free(timeout);
  421|  44.0k|}
timeout_reset:
  448|  56.1k|{
  449|  56.1k|	i_assert(!timeout->one_shot);
  ------------------
  |  |  219|  56.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  56.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  56.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  56.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 56.1k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 56.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  56.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  56.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  56.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  450|  56.1k|	timeout_reset_timeval(timeout, NULL);
  451|  56.1k|}
io_loop_run_get_wait_time:
  550|  37.8k|{
  551|  37.8k|	int msecs = io_loop_get_wait_time(ioloop, tv_r);
  552|  37.8k|	if (msecs < 0 && !io_loop_have_waitable_io_files(ioloop))
  ------------------
  |  Branch (552:6): [True: 0, False: 37.8k]
  |  Branch (552:19): [True: 0, False: 0]
  ------------------
  553|      0|		i_panic("BUG: No IOs or timeouts set. Not waiting for infinity.");
  554|  37.8k|	return msecs;
  555|  37.8k|}
io_loop_handle_timeouts:
  705|  37.8k|{
  706|  37.8k|	T_BEGIN {
  ------------------
  |  |   68|  37.8k|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  37.8k|#  define STMT_START do
  |  |  ------------------
  |  |   69|  37.8k|		data_stack_frame_t _data_stack_cur_id = t_push(__FILE__ ":" T_XSTRING(__LINE__));
  |  |  ------------------
  |  |  |  |   66|  37.8k|#define T_XSTRING(x)	T_STRING(x)	/* expand and then stringify */
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|  37.8k|#define T_STRING(x)	#x
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  707|  37.8k|		io_loop_handle_timeouts_real(ioloop);
  708|  37.8k|	} T_END;
  ------------------
  |  |   71|  37.8k|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  37.8k|#  define STMT_START do
  |  |  ------------------
  |  |   72|  37.8k|		if (unlikely(!t_pop(&_data_stack_cur_id))) \
  |  |  ------------------
  |  |  |  |  202|  37.8k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 37.8k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 37.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   73|  37.8k|			i_panic("Leaked t_pop() call"); \
  |  |   74|  37.8k|	} STMT_END; \
  |  |  ------------------
  |  |  |  |   64|  37.8k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   75|  37.8k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  37.8k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  709|       |
  710|       |	/* Free the unused memory in data stack once per second. This way if
  711|       |	   the data stack has grown excessively large temporarily, it won't
  712|       |	   permanently waste memory. And if the data stack grows back to the
  713|       |	   same large size, re-allocating it once per second doesn't cause
  714|       |	   performance problems. */
  715|  37.8k|	if (data_stack_last_free_unused != ioloop_time) {
  ------------------
  |  Branch (715:6): [True: 45, False: 37.7k]
  ------------------
  716|     45|		if (data_stack_last_free_unused != 0)
  ------------------
  |  Branch (716:7): [True: 44, False: 1]
  ------------------
  717|     44|			data_stack_free_unused();
  718|     45|		data_stack_last_free_unused = ioloop_time;
  719|     45|	}
  720|  37.8k|}
io_loop_call_io:
  723|  60.7k|{
  724|  60.7k|	struct ioloop *ioloop = io->ioloop;
  725|  60.7k|	data_stack_frame_t t_id;
  726|       |
  727|  60.7k|	if (io->pending) {
  ------------------
  |  Branch (727:6): [True: 26.3k, False: 34.3k]
  ------------------
  728|  26.3k|		i_assert(ioloop->io_pending_count > 0);
  ------------------
  |  |  219|  26.3k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  26.3k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  26.3k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  26.3k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 26.3k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 26.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  26.3k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  26.3k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  26.3k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  729|  26.3k|		ioloop->io_pending_count--;
  730|  26.3k|		io->pending = FALSE;
  ------------------
  |  |   11|  26.3k|#  define FALSE (!1)
  ------------------
  731|  26.3k|	}
  732|       |
  733|  60.7k|	if (io->ctx != NULL)
  ------------------
  |  Branch (733:6): [True: 0, False: 60.7k]
  ------------------
  734|      0|		io_loop_context_activate(io->ctx);
  735|  60.7k|	t_id = t_push_named("ioloop handler %p",
  736|  60.7k|			    (void *)io->callback);
  737|  60.7k|	io->callback(io->context);
  738|  60.7k|	if (!t_pop(&t_id)) {
  ------------------
  |  Branch (738:6): [True: 0, False: 60.7k]
  ------------------
  739|      0|		i_panic("Leaked a t_pop() call in I/O handler %p",
  740|      0|			(void *)io->callback);
  741|      0|	}
  742|  60.7k|	if (ioloop->cur_ctx != NULL)
  ------------------
  |  Branch (742:6): [True: 0, False: 60.7k]
  ------------------
  743|      0|		io_loop_context_deactivate(ioloop->cur_ctx);
  744|  60.7k|	i_assert(ioloop == current_ioloop);
  ------------------
  |  |  219|  60.7k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  60.7k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  60.7k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  60.7k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 60.7k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 60.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  60.7k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  60.7k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  60.7k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  745|  60.7k|}
io_loop_run:
  748|  6.21k|{
  749|  6.21k|	if (ioloop->handler_context == NULL)
  ------------------
  |  Branch (749:6): [True: 0, False: 6.21k]
  ------------------
  750|      0|		io_loop_initialize_handler(ioloop);
  751|       |
  752|  6.21k|	if (ioloop->cur_ctx != NULL)
  ------------------
  |  Branch (752:6): [True: 0, False: 6.21k]
  ------------------
  753|      0|		io_loop_context_deactivate(ioloop->cur_ctx);
  754|       |
  755|       |	/* recursive io_loop_run() isn't allowed for the same ioloop.
  756|       |	   it can break backends. */
  757|  6.21k|	i_assert(!ioloop->iolooping);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  758|  6.21k|	ioloop->iolooping = TRUE;
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  759|       |
  760|  6.21k|	ioloop->running = TRUE;
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  761|  44.0k|	while (ioloop->running)
  ------------------
  |  Branch (761:9): [True: 37.8k, False: 6.21k]
  ------------------
  762|  37.8k|		io_loop_handler_run(ioloop);
  763|  6.21k|	ioloop->iolooping = FALSE;
  ------------------
  |  |   11|  6.21k|#  define FALSE (!1)
  ------------------
  764|  6.21k|}
io_loop_handler_run:
  784|  37.8k|{
  785|  37.8k|	i_assert(ioloop == current_ioloop);
  ------------------
  |  |  219|  37.8k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  37.8k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  37.8k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  37.8k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 37.8k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 37.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  37.8k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  37.8k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  37.8k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  786|       |
  787|  37.8k|	io_loop_timeouts_start_new(ioloop);
  788|  37.8k|	ioloop->wait_started = ioloop_timeval;
  789|  37.8k|	io_loop_handler_run_internal(ioloop);
  790|  37.8k|	io_loop_call_pending(ioloop);
  791|  37.8k|	if (ioloop->stop_after_run_loop)
  ------------------
  |  Branch (791:6): [True: 3.75k, False: 34.0k]
  ------------------
  792|  3.75k|		io_loop_stop(ioloop);
  793|       |
  794|  37.8k|	i_assert(ioloop == current_ioloop);
  ------------------
  |  |  219|  37.8k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  37.8k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  37.8k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  37.8k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 37.8k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 37.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  37.8k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  37.8k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  37.8k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  795|  37.8k|}
io_loop_stop:
  798|  9.97k|{
  799|  9.97k|        ioloop->running = FALSE;
  ------------------
  |  |   11|  9.97k|#  define FALSE (!1)
  ------------------
  800|  9.97k|	ioloop->stop_after_run_loop = FALSE;
  ------------------
  |  |   11|  9.97k|#  define FALSE (!1)
  ------------------
  801|  9.97k|}
io_loop_stop_delayed:
  804|  3.77k|{
  805|  3.77k|        ioloop->stop_after_run_loop = TRUE;
  ------------------
  |  |   15|  3.77k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  3.77k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  806|  3.77k|}
io_loop_time_refresh:
  824|  9.52k|{
  825|  9.52k|	i_gettimeofday(&ioloop_timeval);
  826|  9.52k|	ioloop_time = ioloop_timeval.tv_sec;
  827|  9.52k|}
io_loop_create:
  830|  6.21k|{
  831|  6.21k|	struct ioloop *ioloop;
  832|       |
  833|  6.21k|	if (!panic_on_leak_set) {
  ------------------
  |  Branch (833:6): [True: 1, False: 6.21k]
  ------------------
  834|      1|		panic_on_leak_set = TRUE;
  ------------------
  |  |   15|      1|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      1|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  835|      1|		panic_on_leak = getenv("CORE_IO_LEAK") != NULL;
  836|      1|	}
  837|       |
  838|       |	/* initialize time */
  839|  6.21k|	i_gettimeofday(&ioloop_timeval);
  840|  6.21k|	ioloop_time = ioloop_timeval.tv_sec;
  841|       |
  842|  6.21k|        ioloop = i_new(struct ioloop, 1);
  ------------------
  |  |    8|  6.21k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  6.21k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  6.21k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  6.21k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  843|  6.21k|	ioloop->timeouts = priorityq_init(timeout_cmp, 32);
  844|  6.21k|	i_array_init(&ioloop->timeouts_new, 8);
  ------------------
  |  |   46|  6.21k|	p_array_init(array, default_pool, init_count)
  |  |  ------------------
  |  |  |  |   44|  6.21k|	array_create(array, pool, sizeof(**(array)->v), init_count)
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  6.21k|	array_create_i(&(array)->arr, pool, element_size, init_count)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  845|       |
  846|  6.21k|	ioloop->time_moved_callback = current_ioloop != NULL ?
  ------------------
  |  Branch (846:32): [True: 0, False: 6.21k]
  ------------------
  847|      0|		current_ioloop->time_moved_callback :
  848|  6.21k|		io_loop_default_time_moved;
  849|       |
  850|  6.21k|	ioloop->prev = current_ioloop;
  851|  6.21k|        io_loop_set_current(ioloop);
  852|  6.21k|        return ioloop;
  853|  6.21k|}
io_loop_destroy:
  856|  6.21k|{
  857|  6.21k|	struct ioloop *ioloop = *_ioloop;
  858|  6.21k|	struct timeout *to;
  859|  6.21k|	struct priorityq_item *item;
  860|  6.21k|	bool leaks = FALSE;
  ------------------
  |  |   11|  6.21k|#  define FALSE (!1)
  ------------------
  861|       |
  862|  6.21k|	*_ioloop = NULL;
  863|       |
  864|       |	/* ->prev won't work unless loops are destroyed in create order */
  865|  6.21k|        i_assert(ioloop == current_ioloop);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  866|  6.21k|	if (array_is_created(&io_destroy_callbacks)) {
  ------------------
  |  |  176|  6.21k|	array_is_created_i(&(array)->arr)
  |  |  ------------------
  |  |  |  Branch (176:2): [True: 6.21k, False: 0]
  |  |  ------------------
  ------------------
  867|  6.21k|		io_destroy_callback_t *callback;
  868|  12.4k|		array_foreach_elem(&io_destroy_callbacks, callback) T_BEGIN {
  ------------------
  |  |  111|  6.21k|	for (const void *_foreach_end = \
  |  |  112|  6.21k|		CONST_PTR_OFFSET(*(array)->v, (array)->arr.buffer->used), \
  |  |  ------------------
  |  |  |  |   27|  6.21k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  |  |  113|  6.21k|	     *_foreach_ptr = CONST_PTR_OFFSET(*(array)->v, ARRAY_TYPE_CHECK(array, &elem) + \
  |  |  ------------------
  |  |  |  |   27|  24.8k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  114|  6.21k|		COMPILE_ERROR_IF_TRUE(sizeof(elem) > sizeof(void *))) \
  |  |  115|  6.21k|		     ;							\
  |  |  116|  12.4k|	     (_foreach_ptr != _foreach_end &&		\
  |  |  ------------------
  |  |  |  Branch (116:8): [True: 6.21k, False: 6.21k]
  |  |  ------------------
  |  |  117|  12.4k|	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   84|  6.21k|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  |  |  ------------------
  |  |               	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (117:7): [True: 6.21k, False: 0]
  |  |  ------------------
  |  |  118|  6.21k|		;							\
  |  |  119|  6.21k|	     _foreach_ptr = CONST_PTR_OFFSET(_foreach_ptr, sizeof(elem)))
  |  |  ------------------
  |  |  |  |   27|  6.21k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  ------------------
              		array_foreach_elem(&io_destroy_callbacks, callback) T_BEGIN {
  ------------------
  |  |   68|  6.21k|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |   69|  6.21k|		data_stack_frame_t _data_stack_cur_id = t_push(__FILE__ ":" T_XSTRING(__LINE__));
  |  |  ------------------
  |  |  |  |   66|  6.21k|#define T_XSTRING(x)	T_STRING(x)	/* expand and then stringify */
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|  6.21k|#define T_STRING(x)	#x
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  869|  12.4k|			callback(current_ioloop);
  870|  12.4k|		} T_END;
  ------------------
  |  |   71|  6.21k|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |   72|  6.21k|		if (unlikely(!t_pop(&_data_stack_cur_id))) \
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   73|  6.21k|			i_panic("Leaked t_pop() call"); \
  |  |   74|  6.21k|	} STMT_END; \
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   75|  6.21k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  871|  6.21k|	}
  872|       |
  873|  6.21k|	io_loop_set_current(current_ioloop->prev);
  874|       |
  875|  6.21k|	if (ioloop->notify_handler_context != NULL)
  ------------------
  |  Branch (875:6): [True: 0, False: 6.21k]
  ------------------
  876|      0|		io_loop_notify_handler_deinit(ioloop);
  877|       |
  878|  6.21k|	while (ioloop->io_files != NULL) {
  ------------------
  |  Branch (878:9): [True: 0, False: 6.21k]
  ------------------
  879|      0|		struct io_file *io = ioloop->io_files;
  880|      0|		struct io *_io = &io->io;
  881|      0|		const char *error = t_strdup_printf(
  882|      0|			"I/O leak: %p (%s:%u, fd %d)",
  883|      0|			(void *)io->io.callback,
  884|      0|			io->io.source_filename,
  885|      0|			io->io.source_linenum, io->fd);
  886|       |
  887|      0|		if (panic_on_leak)
  ------------------
  |  Branch (887:7): [True: 0, False: 0]
  ------------------
  888|      0|			i_panic("%s", error);
  889|      0|		else
  890|      0|			i_warning("%s", error);
  891|      0|		io_remove(&_io);
  892|      0|		leaks = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  893|      0|	}
  894|  6.21k|	i_assert(ioloop->io_pending_count == 0);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  895|       |
  896|  6.21k|	array_foreach_elem(&ioloop->timeouts_new, to) {
  ------------------
  |  |  111|  6.21k|	for (const void *_foreach_end = \
  |  |  112|  6.21k|		CONST_PTR_OFFSET(*(array)->v, (array)->arr.buffer->used), \
  |  |  ------------------
  |  |  |  |   27|  6.21k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  |  |  113|  6.21k|	     *_foreach_ptr = CONST_PTR_OFFSET(*(array)->v, ARRAY_TYPE_CHECK(array, &elem) + \
  |  |  ------------------
  |  |  |  |   27|  24.8k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  114|  6.21k|		COMPILE_ERROR_IF_TRUE(sizeof(elem) > sizeof(void *))) \
  |  |  115|  6.21k|		     ;							\
  |  |  116|  6.21k|	     (_foreach_ptr != _foreach_end &&		\
  |  |  ------------------
  |  |  |  Branch (116:8): [True: 0, False: 6.21k]
  |  |  ------------------
  |  |  117|  6.21k|	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   84|      0|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  |  |  ------------------
  |  |               	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (117:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  118|  6.21k|		;							\
  |  |  119|  6.21k|	     _foreach_ptr = CONST_PTR_OFFSET(_foreach_ptr, sizeof(elem)))
  |  |  ------------------
  |  |  |  |   27|      0|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  ------------------
  897|      0|		const char *error = t_strdup_printf(
  898|      0|			"Timeout leak: %p (%s:%u)", (void *)to->callback,
  899|      0|			to->source_filename,
  900|      0|			to->source_linenum);
  901|       |
  902|      0|		if (panic_on_leak)
  ------------------
  |  Branch (902:7): [True: 0, False: 0]
  ------------------
  903|      0|			i_panic("%s", error);
  904|      0|		else
  905|      0|			i_warning("%s", error);
  906|      0|		timeout_free(to);
  907|      0|		leaks = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  908|      0|	}
  909|  6.21k|	array_free(&ioloop->timeouts_new);
  ------------------
  |  |  160|  6.21k|	array_free_i(&(array)->arr)
  ------------------
  910|       |
  911|  6.21k|	while ((item = priorityq_pop(ioloop->timeouts)) != NULL) {
  ------------------
  |  Branch (911:9): [True: 0, False: 6.21k]
  ------------------
  912|      0|		struct timeout *to = (struct timeout *)item;
  913|      0|		const char *error = t_strdup_printf(
  914|      0|			"Timeout leak: %p (%s:%u)", (void *)to->callback,
  915|      0|			to->source_filename,
  916|      0|			to->source_linenum);
  917|       |
  918|      0|		if (panic_on_leak)
  ------------------
  |  Branch (918:7): [True: 0, False: 0]
  ------------------
  919|      0|			i_panic("%s", error);
  920|      0|		else
  921|      0|			i_warning("%s", error);
  922|      0|		timeout_free(to);
  923|      0|		leaks = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  924|      0|	}
  925|  6.21k|	priorityq_deinit(&ioloop->timeouts);
  926|       |
  927|  6.21k|	while (ioloop->wait_timers != NULL) {
  ------------------
  |  Branch (927:9): [True: 0, False: 6.21k]
  ------------------
  928|      0|		struct io_wait_timer *timer = ioloop->wait_timers;
  929|      0|		const char *error = t_strdup_printf(
  930|      0|			"IO wait timer leak: %s:%u",
  931|      0|			timer->source_filename,
  932|      0|			timer->source_linenum);
  933|       |
  934|      0|		if (panic_on_leak)
  ------------------
  |  Branch (934:7): [True: 0, False: 0]
  ------------------
  935|      0|			i_panic("%s", error);
  936|      0|		else
  937|      0|			i_warning("%s", error);
  938|      0|		io_wait_timer_remove(&timer);
  939|      0|		leaks = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  940|      0|	}
  941|       |
  942|  6.21k|	if (leaks) {
  ------------------
  |  Branch (942:6): [True: 0, False: 6.21k]
  ------------------
  943|      0|		const char *backtrace, *error;
  944|      0|		if (backtrace_get(&backtrace, &error) == 0)
  ------------------
  |  Branch (944:7): [True: 0, False: 0]
  ------------------
  945|      0|			i_warning("Raw backtrace for leaks: %s", backtrace);
  946|      0|	}
  947|       |
  948|  6.21k|	if (ioloop->handler_context != NULL)
  ------------------
  |  Branch (948:6): [True: 6.21k, False: 0]
  ------------------
  949|  6.21k|		io_loop_handler_deinit(ioloop);
  950|  6.21k|	if (ioloop->cur_ctx != NULL)
  ------------------
  |  Branch (950:6): [True: 0, False: 6.21k]
  ------------------
  951|      0|		io_loop_context_unref(&ioloop->cur_ctx);
  952|  6.21k|	i_free(ioloop);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  953|  6.21k|}
io_loop_set_current:
  972|  12.4k|{
  973|  12.4k|	io_switch_callback_t *callback;
  974|  12.4k|	struct ioloop *prev_ioloop = current_ioloop;
  975|       |
  976|  12.4k|	if (ioloop == current_ioloop)
  ------------------
  |  Branch (976:6): [True: 0, False: 12.4k]
  ------------------
  977|      0|		return;
  978|       |
  979|  12.4k|	current_ioloop = ioloop;
  980|  12.4k|	if (array_is_created(&io_switch_callbacks)) {
  ------------------
  |  |  176|  12.4k|	array_is_created_i(&(array)->arr)
  |  |  ------------------
  |  |  |  Branch (176:2): [True: 12.4k, False: 0]
  |  |  ------------------
  ------------------
  981|  24.8k|		array_foreach_elem(&io_switch_callbacks, callback) T_BEGIN {
  ------------------
  |  |  111|  12.4k|	for (const void *_foreach_end = \
  |  |  112|  12.4k|		CONST_PTR_OFFSET(*(array)->v, (array)->arr.buffer->used), \
  |  |  ------------------
  |  |  |  |   27|  12.4k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  |  |  113|  12.4k|	     *_foreach_ptr = CONST_PTR_OFFSET(*(array)->v, ARRAY_TYPE_CHECK(array, &elem) + \
  |  |  ------------------
  |  |  |  |   27|  49.7k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  114|  12.4k|		COMPILE_ERROR_IF_TRUE(sizeof(elem) > sizeof(void *))) \
  |  |  115|  12.4k|		     ;							\
  |  |  116|  24.8k|	     (_foreach_ptr != _foreach_end &&		\
  |  |  ------------------
  |  |  |  Branch (116:8): [True: 12.4k, False: 12.4k]
  |  |  ------------------
  |  |  117|  24.8k|	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   84|  12.4k|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  |  |  ------------------
  |  |               	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   15|  12.4k|#  define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  12.4k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (117:7): [True: 12.4k, False: 0]
  |  |  ------------------
  |  |  118|  12.4k|		;							\
  |  |  119|  12.4k|	     _foreach_ptr = CONST_PTR_OFFSET(_foreach_ptr, sizeof(elem)))
  |  |  ------------------
  |  |  |  |   27|  12.4k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  ------------------
              		array_foreach_elem(&io_switch_callbacks, callback) T_BEGIN {
  ------------------
  |  |   68|  12.4k|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  12.4k|#  define STMT_START do
  |  |  ------------------
  |  |   69|  12.4k|		data_stack_frame_t _data_stack_cur_id = t_push(__FILE__ ":" T_XSTRING(__LINE__));
  |  |  ------------------
  |  |  |  |   66|  12.4k|#define T_XSTRING(x)	T_STRING(x)	/* expand and then stringify */
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|  12.4k|#define T_STRING(x)	#x
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  982|  24.8k|			callback(prev_ioloop);
  983|  24.8k|		} T_END;
  ------------------
  |  |   71|  12.4k|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  12.4k|#  define STMT_START do
  |  |  ------------------
  |  |   72|  12.4k|		if (unlikely(!t_pop(&_data_stack_cur_id))) \
  |  |  ------------------
  |  |  |  |  202|  12.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 12.4k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 12.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   73|  12.4k|			i_panic("Leaked t_pop() call"); \
  |  |   74|  12.4k|	} STMT_END; \
  |  |  ------------------
  |  |  |  |   64|  12.4k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   75|  12.4k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.4k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  984|  12.4k|	}
  985|  12.4k|}
io_loop_add_switch_callback:
  997|      1|{
  998|      1|	if (!array_is_created(&io_switch_callbacks)) {
  ------------------
  |  |  176|      1|	array_is_created_i(&(array)->arr)
  ------------------
  |  Branch (998:6): [True: 1, False: 0]
  ------------------
  999|      1|		i_array_init(&io_switch_callbacks, 4);
  ------------------
  |  |   46|      1|	p_array_init(array, default_pool, init_count)
  |  |  ------------------
  |  |  |  |   44|      1|	array_create(array, pool, sizeof(**(array)->v), init_count)
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      1|	array_create_i(&(array)->arr, pool, element_size, init_count)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1000|      1|		lib_atexit_priority(io_switch_callbacks_free, LIB_ATEXIT_PRIORITY_LOW);
  ------------------
  |  |   72|      1|#define LIB_ATEXIT_PRIORITY_LOW 10
  ------------------
 1001|      1|	}
 1002|      1|	array_push_back(&io_switch_callbacks, &callback);
  ------------------
  |  |  282|      1|#define array_push_back(array, item) array_append(array, (item), 1)
  |  |  ------------------
  |  |  |  |  214|      1|	TYPE_CHECKS(void, ARRAY_TYPE_CHECK(array, data), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      1|	(FALSE ? (return_type)(checks) : (func))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      1|#  define FALSE (!1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (11:17): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:25): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  215|      1|	array_append_i(&(array)->arr, data, count))
  |  |  ------------------
  ------------------
 1003|      1|}
io_loop_add_destroy_callback:
 1021|      1|{
 1022|      1|	if (!array_is_created(&io_destroy_callbacks)) {
  ------------------
  |  |  176|      1|	array_is_created_i(&(array)->arr)
  ------------------
  |  Branch (1022:6): [True: 1, False: 0]
  ------------------
 1023|      1|		i_array_init(&io_destroy_callbacks, 4);
  ------------------
  |  |   46|      1|	p_array_init(array, default_pool, init_count)
  |  |  ------------------
  |  |  |  |   44|      1|	array_create(array, pool, sizeof(**(array)->v), init_count)
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      1|	array_create_i(&(array)->arr, pool, element_size, init_count)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1024|      1|		lib_atexit_priority(io_destroy_callbacks_free, LIB_ATEXIT_PRIORITY_LOW);
  ------------------
  |  |   72|      1|#define LIB_ATEXIT_PRIORITY_LOW 10
  ------------------
 1025|      1|	}
 1026|      1|	array_push_back(&io_destroy_callbacks, &callback);
  ------------------
  |  |  282|      1|#define array_push_back(array, item) array_append(array, (item), 1)
  |  |  ------------------
  |  |  |  |  214|      1|	TYPE_CHECKS(void, ARRAY_TYPE_CHECK(array, data), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      1|	(FALSE ? (return_type)(checks) : (func))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      1|#  define FALSE (!1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (11:17): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:25): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  215|      1|	array_append_i(&(array)->arr, data, count))
  |  |  ------------------
  ------------------
 1027|      1|}
ioloop.c:io_add_file:
   48|  93.5k|{
   49|  93.5k|	struct io_file *io;
   50|       |
   51|  93.5k|	i_assert(callback != NULL);
  ------------------
  |  |  219|  93.5k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  93.5k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  93.5k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  93.5k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 93.5k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 93.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  93.5k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  93.5k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  93.5k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   52|  93.5k|	i_assert((condition & IO_NOTIFY) == 0);
  ------------------
  |  |  219|  93.5k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  93.5k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  93.5k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  93.5k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 93.5k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 93.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  93.5k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  93.5k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  93.5k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   53|       |
   54|  93.5k|	io = i_new(struct io_file, 1);
  ------------------
  |  |    8|  93.5k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  93.5k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  93.5k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  93.5k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  93.5k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  93.5k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   55|  93.5k|        io->io.condition = condition;
   56|  93.5k|	io->io.callback = callback;
   57|  93.5k|        io->io.context = context;
   58|  93.5k|	io->io.ioloop = ioloop;
   59|  93.5k|	io->io.source_filename = source_filename;
   60|  93.5k|	io->io.source_linenum = source_linenum;
   61|  93.5k|	io->refcount = 1;
   62|  93.5k|	io->fd = fd;
   63|       |
   64|  93.5k|	if (io->io.ioloop->cur_ctx != NULL) {
  ------------------
  |  Branch (64:6): [True: 0, False: 93.5k]
  ------------------
   65|      0|		io->io.ctx = io->io.ioloop->cur_ctx;
   66|      0|		io_loop_context_ref(io->io.ctx);
   67|      0|	}
   68|       |
   69|  93.5k|	if (io->io.ioloop->handler_context == NULL)
  ------------------
  |  Branch (69:6): [True: 6.21k, False: 87.3k]
  ------------------
   70|  6.21k|		io_loop_initialize_handler(io->io.ioloop);
   71|  93.5k|	if (fd != -1)
  ------------------
  |  Branch (71:6): [True: 93.5k, False: 0]
  ------------------
   72|  93.5k|		io_loop_handle_add(io);
   73|      0|	else {
   74|       |		/* we're adding an istream whose only way to get notified
   75|       |		   is to call i_stream_set_input_pending() */
   76|      0|	}
   77|       |
   78|  93.5k|	if (io->io.ioloop->io_files != NULL) {
  ------------------
  |  Branch (78:6): [True: 60.3k, False: 33.2k]
  ------------------
   79|  60.3k|		io->io.ioloop->io_files->prev = io;
   80|  60.3k|		io->next = io->io.ioloop->io_files;
   81|  60.3k|	}
   82|  93.5k|	io->io.ioloop->io_files = io;
   83|  93.5k|	return io;
   84|  93.5k|}
ioloop.c:io_remove_full:
  154|  93.5k|{
  155|  93.5k|	struct io *io = *_io;
  156|       |
  157|  93.5k|	i_assert(io->callback != NULL);
  ------------------
  |  |  219|  93.5k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  93.5k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  93.5k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  93.5k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 93.5k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 93.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  93.5k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  93.5k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  93.5k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  158|       |
  159|  93.5k|	*_io = NULL;
  160|       |
  161|       |	/* make sure the callback doesn't get called anymore.
  162|       |	   kqueue code relies on this. */
  163|  93.5k|	io->callback = NULL;
  164|       |
  165|  93.5k|	if (io->pending) {
  ------------------
  |  Branch (165:6): [True: 21.3k, False: 72.1k]
  ------------------
  166|  21.3k|		i_assert(io->ioloop->io_pending_count > 0);
  ------------------
  |  |  219|  21.3k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  21.3k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  21.3k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  21.3k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 21.3k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 21.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  21.3k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  21.3k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  21.3k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  167|  21.3k|		io->ioloop->io_pending_count--;
  168|  21.3k|	}
  169|       |
  170|  93.5k|	if (io->ctx != NULL)
  ------------------
  |  Branch (170:6): [True: 0, False: 93.5k]
  ------------------
  171|      0|		io_loop_context_unref(&io->ctx);
  172|       |
  173|  93.5k|	if ((io->condition & IO_NOTIFY) != 0)
  ------------------
  |  Branch (173:6): [True: 0, False: 93.5k]
  ------------------
  174|      0|		io_loop_notify_remove(io);
  175|  93.5k|	else {
  176|  93.5k|		struct io_file *io_file = (struct io_file *)io;
  177|  93.5k|		struct istream *istream = io_file->istream;
  178|       |
  179|  93.5k|		if (istream != NULL) {
  ------------------
  |  Branch (179:7): [True: 55.3k, False: 38.1k]
  ------------------
  180|       |			/* remove io before it's freed */
  181|  55.3k|			i_stream_unset_io(istream, io);
  182|  55.3k|		}
  183|       |
  184|  93.5k|		io_file_unlink(io_file);
  185|  93.5k|		if (io_file->fd != -1)
  ------------------
  |  Branch (185:7): [True: 93.5k, False: 0]
  ------------------
  186|  93.5k|			io_loop_handle_remove(io_file, closed);
  187|      0|		else
  188|  93.5k|			i_free(io);
  ------------------
  |  |   19|  93.5k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  93.5k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|      0|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|      0|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|      0|		(mem) = NULL;			\
  |  |  |  |  |  |  134|      0|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  189|       |
  190|       |		/* remove io from the ioloop before unreferencing the istream,
  191|       |		   because a destroyed istream may automatically close the
  192|       |		   fd. */
  193|  93.5k|		i_stream_unref(&istream);
  194|  93.5k|	}
  195|  93.5k|}
ioloop.c:io_file_unlink:
  138|  93.5k|{
  139|  93.5k|	if (io->prev != NULL)
  ------------------
  |  Branch (139:6): [True: 31.8k, False: 61.6k]
  ------------------
  140|  31.8k|		io->prev->next = io->next;
  141|  61.6k|	else
  142|  61.6k|		io->io.ioloop->io_files = io->next;
  143|       |
  144|  93.5k|	if (io->next != NULL)
  ------------------
  |  Branch (144:6): [True: 30.5k, False: 62.9k]
  ------------------
  145|  30.5k|		io->next->prev = io->prev;
  146|       |
  147|       |	/* if we got here from an I/O handler callback, make sure we
  148|       |	   don't try to handle this one next. */
  149|  93.5k|	if (io->io.ioloop->next_io_file == io)
  ------------------
  |  Branch (149:6): [True: 343, False: 93.1k]
  ------------------
  150|    343|		io->io.ioloop->next_io_file = io->next;
  151|  93.5k|}
ioloop.c:timeout_add_common:
  261|  44.0k|{
  262|  44.0k|	struct timeout *timeout;
  263|       |
  264|  44.0k|	timeout = i_new(struct timeout, 1);
  ------------------
  |  |    8|  44.0k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  44.0k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  44.0k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  44.0k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  44.0k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  44.0k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  265|  44.0k|	timeout->item.idx = UINT_MAX;
  266|  44.0k|	timeout->source_filename = source_filename;
  267|  44.0k|	timeout->source_linenum = source_linenum;
  268|  44.0k|	timeout->ioloop = ioloop;
  269|       |
  270|  44.0k|	timeout->callback = callback;
  271|  44.0k|	timeout->context = context;
  272|       |
  273|  44.0k|	if (timeout->ioloop->cur_ctx != NULL) {
  ------------------
  |  Branch (273:6): [True: 0, False: 44.0k]
  ------------------
  274|      0|		timeout->ctx = timeout->ioloop->cur_ctx;
  275|      0|		io_loop_context_ref(timeout->ctx);
  276|      0|	}
  277|       |
  278|  44.0k|	return timeout;
  279|  44.0k|}
ioloop.c:timeout_update_next:
  236|  36.2k|{
  237|  36.2k|	if (tv_now == NULL)
  ------------------
  |  Branch (237:6): [True: 16.6k, False: 19.5k]
  ------------------
  238|  16.6k|		i_gettimeofday(&timeout->next_run);
  239|  19.5k|	else {
  240|  19.5k|		timeout->next_run.tv_sec = tv_now->tv_sec;
  241|  19.5k|                timeout->next_run.tv_usec = tv_now->tv_usec;
  242|  19.5k|	}
  243|       |
  244|       |	/* we don't want microsecond accuracy or this function will be
  245|       |	   called all the time - millisecond is more than enough */
  246|  36.2k|	timeout->next_run.tv_usec -= timeout->next_run.tv_usec % 1000;
  247|       |
  248|  36.2k|	timeout->next_run.tv_sec += timeout->msecs/1000;
  249|  36.2k|	timeout->next_run.tv_usec += (timeout->msecs%1000)*1000;
  250|       |
  251|  36.2k|	if (timeout->next_run.tv_usec >= 1000000) {
  ------------------
  |  Branch (251:6): [True: 13.0k, False: 23.1k]
  ------------------
  252|  13.0k|                timeout->next_run.tv_sec++;
  253|  13.0k|                timeout->next_run.tv_usec -= 1000000;
  254|  13.0k|	}
  255|  36.2k|}
ioloop.c:timeout_free:
  391|  44.0k|{
  392|  44.0k|	if (timeout->ctx != NULL)
  ------------------
  |  Branch (392:6): [True: 0, False: 44.0k]
  ------------------
  393|      0|		io_loop_context_unref(&timeout->ctx);
  394|  44.0k|	i_free(timeout);
  ------------------
  |  |   19|  44.0k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  44.0k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  44.0k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  44.0k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  44.0k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  44.0k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  44.0k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  44.0k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  395|  44.0k|}
ioloop.c:timeout_reset_timeval:
  425|  59.9k|{
  426|  59.9k|	if (timeout->item.idx == UINT_MAX)
  ------------------
  |  Branch (426:6): [True: 39.4k, False: 20.4k]
  ------------------
  427|  39.4k|		return;
  428|       |
  429|  20.4k|	timeout_update_next(timeout, tv_now);
  430|       |	/* If we came here from io_loop_handle_timeouts_real(), next_run must
  431|       |	   be larger than tv_now or it can go to infinite loop. This would
  432|       |	   mainly happen with 0 ms timeouts. Avoid this by making sure
  433|       |	   next_run is at least 1 us higher than tv_now.
  434|       |
  435|       |	   Note that some callers (like master process's process_min_avail
  436|       |	   preforking timeout) really do want the 0 ms timeout to trigger
  437|       |	   multiple times as rapidly as it can (but in separate ioloop runs).
  438|       |	   So don't increase it more than by 1 us. */
  439|  20.4k|	if (tv_now != NULL && timeval_cmp(&timeout->next_run, tv_now) <= 0) {
  ------------------
  |  Branch (439:6): [True: 3.77k, False: 16.6k]
  |  Branch (439:24): [True: 0, False: 3.77k]
  ------------------
  440|      0|		timeout->next_run = *tv_now;
  441|      0|		timeval_add_usecs(&timeout->next_run, 1);
  442|      0|	}
  443|  20.4k|	priorityq_remove(timeout->ioloop->timeouts, &timeout->item);
  444|  20.4k|	priorityq_add(timeout->ioloop->timeouts, &timeout->item);
  445|  20.4k|}
ioloop.c:io_loop_get_wait_time:
  495|  37.8k|{
  496|  37.8k|	struct timeval tv_now;
  497|  37.8k|	struct priorityq_item *item;
  498|  37.8k|	struct timeout *timeout;
  499|  37.8k|	int msecs;
  500|       |
  501|  37.8k|	item = priorityq_peek(ioloop->timeouts);
  502|  37.8k|	timeout = (struct timeout *)item;
  503|       |
  504|       |	/* we need to see if there are pending IO waiting,
  505|       |	   if there is, we set msecs = 0 to ensure they are
  506|       |	   processed without delay */
  507|  37.8k|	if (timeout == NULL && ioloop->io_pending_count == 0) {
  ------------------
  |  Branch (507:6): [True: 0, False: 37.8k]
  |  Branch (507:25): [True: 0, False: 0]
  ------------------
  508|       |		/* no timeouts. use INT_MAX msecs for timeval and
  509|       |		   return -1 for poll/epoll infinity. */
  510|      0|		tv_r->tv_sec = INT_MAX / 1000;
  511|      0|		tv_r->tv_usec = 0;
  512|      0|		ioloop->next_max_time.tv_sec = (1ULL << (TIME_T_MAX_BITS-1)) - 1;
  ------------------
  |  |  831|      0|#define TIME_T_MAX_BITS 40
  ------------------
  513|      0|		ioloop->next_max_time.tv_usec = 0;
  514|      0|		return -1;
  515|      0|	}
  516|       |
  517|  37.8k|	if (ioloop->io_pending_count > 0) {
  ------------------
  |  Branch (517:6): [True: 6.21k, False: 31.5k]
  ------------------
  518|  6.21k|		i_gettimeofday(&tv_now);
  519|  6.21k|		msecs = 0;
  520|  6.21k|		tv_r->tv_sec = 0;
  521|  6.21k|		tv_r->tv_usec = 0;
  522|  31.5k|	} else {
  523|  31.5k|		tv_now.tv_sec = 0;
  524|  31.5k|		msecs = timeout_get_wait_time(timeout, tv_r, &tv_now, FALSE);
  ------------------
  |  |   11|  31.5k|#  define FALSE (!1)
  ------------------
  525|  31.5k|	}
  526|  37.8k|	ioloop->next_max_time = tv_now;
  527|  37.8k|	timeval_add_msecs(&ioloop->next_max_time, msecs);
  528|       |
  529|       |	/* update ioloop_timeval - this is meant for io_loop_handle_timeouts()'s
  530|       |	   ioloop_wait_usecs calculation. normally after this we go to the
  531|       |	   ioloop and after that we update ioloop_timeval immediately again. */
  532|  37.8k|	ioloop_timeval = tv_now;
  533|  37.8k|	ioloop_time = tv_now.tv_sec;
  534|  37.8k|	i_assert(msecs == 0 || timeout->msecs > 0 || timeout->one_shot);
  ------------------
  |  |  219|  37.8k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  37.8k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  37.8k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   107k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 37.8k]
  |  |  |  |  |  Branch (202:45): [True: 6.24k, False: 31.5k]
  |  |  |  |  |  Branch (202:45): [True: 31.5k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  37.8k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  37.8k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  37.8k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  535|  37.8k|	return msecs;
  536|  37.8k|}
ioloop.c:timeout_get_wait_time:
  455|  73.1k|{
  456|  73.1k|	int ret;
  457|       |
  458|  73.1k|	if (tv_now->tv_sec == 0)
  ------------------
  |  Branch (458:6): [True: 31.5k, False: 41.5k]
  ------------------
  459|  31.5k|		i_gettimeofday(tv_now);
  460|  73.1k|	tv_r->tv_sec = tv_now->tv_sec;
  461|  73.1k|	tv_r->tv_usec = tv_now->tv_usec;
  462|       |
  463|  73.1k|	i_assert(tv_r->tv_sec > 0);
  ------------------
  |  |  219|  73.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  73.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  73.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  73.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 73.1k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 73.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  73.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  73.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  73.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  464|  73.1k|	i_assert(timeout->next_run.tv_sec > 0);
  ------------------
  |  |  219|  73.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  73.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  73.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  73.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 73.1k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 73.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  73.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  73.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  73.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  465|       |
  466|  73.1k|	tv_r->tv_sec = timeout->next_run.tv_sec - tv_r->tv_sec;
  467|  73.1k|	tv_r->tv_usec = timeout->next_run.tv_usec - tv_r->tv_usec;
  468|  73.1k|	if (tv_r->tv_usec < 0) {
  ------------------
  |  Branch (468:6): [True: 4.38k, False: 68.7k]
  ------------------
  469|  4.38k|		tv_r->tv_sec--;
  470|  4.38k|		tv_r->tv_usec += 1000000;
  471|  4.38k|	}
  472|       |
  473|  73.1k|	if (tv_r->tv_sec < 0) {
  ------------------
  |  Branch (473:6): [True: 3.80k, False: 69.3k]
  ------------------
  474|       |		/* The timeout should have been called already */
  475|  3.80k|		tv_r->tv_sec = 0;
  476|  3.80k|		tv_r->tv_usec = 0;
  477|  3.80k|		return 0;
  478|  3.80k|	}
  479|  69.3k|	if (tv_r->tv_sec == 0 && tv_r->tv_usec == 1 && !in_timeout_loop) {
  ------------------
  |  Branch (479:6): [True: 69.3k, False: 0]
  |  Branch (479:27): [True: 0, False: 69.3k]
  |  Branch (479:49): [True: 0, False: 0]
  ------------------
  480|       |		/* Possibly 0 ms timeout. Don't wait for a full millisecond
  481|       |		   for it to trigger. */
  482|      0|		tv_r->tv_usec = 0;
  483|      0|		return 0;
  484|      0|	}
  485|  69.3k|	if (tv_r->tv_sec > INT_MAX/1000-1)
  ------------------
  |  Branch (485:6): [True: 0, False: 69.3k]
  ------------------
  486|      0|		tv_r->tv_sec = INT_MAX/1000-1;
  487|       |
  488|       |	/* round wait times up to next millisecond */
  489|  69.3k|	ret = tv_r->tv_sec * 1000 + (tv_r->tv_usec + 999) / 1000;
  490|  69.3k|	i_assert(ret >= 0 && tv_r->tv_sec >= 0 && tv_r->tv_usec >= 0);
  ------------------
  |  |  219|  69.3k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  69.3k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  69.3k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   277k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 69.3k]
  |  |  |  |  |  Branch (202:45): [True: 69.3k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 69.3k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 69.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  69.3k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  69.3k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  69.3k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  491|  69.3k|	return ret;
  492|  69.3k|}
ioloop.c:io_loop_handle_timeouts_real:
  639|  37.8k|{
  640|  37.8k|	struct priorityq_item *item;
  641|  37.8k|	struct timeval tv_old, tv, tv_call;
  642|  37.8k|	long long diff_usecs;
  643|  37.8k|	data_stack_frame_t t_id;
  644|       |
  645|  37.8k|	tv_old = ioloop_timeval;
  646|  37.8k|	i_gettimeofday(&ioloop_timeval);
  647|       |
  648|  37.8k|	diff_usecs = timeval_diff_usecs(&ioloop_timeval, &tv_old);
  649|  37.8k|	if (unlikely(diff_usecs < 0)) {
  ------------------
  |  |  202|  37.8k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 37.8k]
  |  |  |  Branch (202:44): [True: 0, False: 37.8k]
  |  |  ------------------
  ------------------
  650|       |		/* time moved backwards */
  651|      0|		io_loops_timeouts_update(diff_usecs);
  652|      0|		ioloop->time_moved_callback(&tv_old, &ioloop_timeval);
  653|      0|		i_assert(ioloop == current_ioloop);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  654|       |		/* the callback may have slept, so check the time again. */
  655|      0|		i_gettimeofday(&ioloop_timeval);
  656|  37.8k|	} else {
  657|  37.8k|		diff_usecs = timeval_diff_usecs(&ioloop->next_max_time,
  658|  37.8k|						&ioloop_timeval);
  659|  37.8k|		if (unlikely(-diff_usecs >= IOLOOP_TIME_MOVED_FORWARDS_MIN_USECS)) {
  ------------------
  |  |  202|  37.8k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 37.8k]
  |  |  |  Branch (202:44): [True: 0, False: 37.8k]
  |  |  ------------------
  ------------------
  660|      0|			io_loops_timeouts_update(-diff_usecs);
  661|       |			/* time moved forward */
  662|      0|			ioloop->time_moved_callback(&ioloop->next_max_time,
  663|      0|						    &ioloop_timeval);
  664|      0|			i_assert(ioloop == current_ioloop);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  665|      0|		}
  666|  37.8k|		ioloop_add_wait_time(ioloop);
  667|  37.8k|	}
  668|       |
  669|  37.8k|	ioloop_time = ioloop_timeval.tv_sec;
  670|  37.8k|	tv_call = ioloop_timeval;
  671|       |
  672|  41.5k|	while (ioloop->running &&
  ------------------
  |  Branch (672:9): [True: 41.5k, False: 0]
  ------------------
  673|  41.5k|	       (item = priorityq_peek(ioloop->timeouts)) != NULL) {
  ------------------
  |  Branch (673:9): [True: 41.5k, False: 0]
  ------------------
  674|  41.5k|		struct timeout *timeout = (struct timeout *)item;
  675|       |
  676|       |		/* use tv_call to make sure we don't get to infinite loop in
  677|       |		   case callbacks update ioloop_timeval. */
  678|  41.5k|		if (timeout_get_wait_time(timeout, &tv, &tv_call, TRUE) > 0)
  ------------------
  |  |   15|  41.5k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  41.5k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  |  Branch (678:7): [True: 37.8k, False: 3.77k]
  ------------------
  679|  37.8k|			break;
  680|       |
  681|  3.77k|		if (timeout->one_shot) {
  ------------------
  |  Branch (681:7): [True: 0, False: 3.77k]
  ------------------
  682|       |			/* remove timeout from queue */
  683|      0|			priorityq_remove(timeout->ioloop->timeouts, &timeout->item);
  684|  3.77k|		} else {
  685|       |			/* update timeout's next_run and reposition it in the queue */
  686|  3.77k|			timeout_reset_timeval(timeout, &tv_call);
  687|  3.77k|		}
  688|       |
  689|  3.77k|		if (timeout->ctx != NULL)
  ------------------
  |  Branch (689:7): [True: 0, False: 3.77k]
  ------------------
  690|      0|			io_loop_context_activate(timeout->ctx);
  691|  3.77k|		t_id = t_push_named("ioloop timeout handler %p",
  692|  3.77k|				    (void *)timeout->callback);
  693|  3.77k|		timeout->callback(timeout->context);
  694|  3.77k|		if (!t_pop(&t_id)) {
  ------------------
  |  Branch (694:7): [True: 0, False: 3.77k]
  ------------------
  695|      0|			i_panic("Leaked a t_pop() call in timeout handler %p",
  696|      0|				(void *)timeout->callback);
  697|      0|		}
  698|  3.77k|		if (ioloop->cur_ctx != NULL)
  ------------------
  |  Branch (698:7): [True: 0, False: 3.77k]
  ------------------
  699|      0|			io_loop_context_deactivate(ioloop->cur_ctx);
  700|  3.77k|		i_assert(ioloop == current_ioloop);
  ------------------
  |  |  219|  3.77k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  3.77k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  3.77k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  3.77k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 3.77k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 3.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  3.77k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  3.77k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  3.77k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  701|  3.77k|	}
  702|  37.8k|}
ioloop.c:ioloop_add_wait_time:
  621|  37.8k|{
  622|  37.8k|	struct io_wait_timer *timer;
  623|  37.8k|	long long diff;
  624|       |
  625|  37.8k|	diff = timeval_diff_usecs(&ioloop_timeval, &ioloop->wait_started);
  626|  37.8k|	if (diff < 0) {
  ------------------
  |  Branch (626:6): [True: 0, False: 37.8k]
  ------------------
  627|       |		/* time moved backwards */
  628|      0|		diff = 0;
  629|      0|	}
  630|       |
  631|  37.8k|	ioloop->ioloop_wait_usecs += diff;
  632|  37.8k|	ioloop_global_wait_usecs += diff;
  633|       |
  634|  37.8k|	for (timer = ioloop->wait_timers; timer != NULL; timer = timer->next)
  ------------------
  |  Branch (634:36): [True: 0, False: 37.8k]
  ------------------
  635|      0|		timer->usecs += diff;
  636|  37.8k|}
ioloop.c:io_loop_initialize_handler:
   34|  6.21k|{
   35|  6.21k|	unsigned int initial_fd_count;
   36|       |
   37|  6.21k|	initial_fd_count = ioloop->max_fd_count > 0 &&
  ------------------
  |  Branch (37:21): [True: 0, False: 6.21k]
  ------------------
   38|  6.21k|		ioloop->max_fd_count < IOLOOP_INITIAL_FD_COUNT ?
  ------------------
  |  |    9|      0|#  define IOLOOP_INITIAL_FD_COUNT 128
  ------------------
  |  Branch (38:3): [True: 0, False: 0]
  ------------------
   39|  6.21k|		ioloop->max_fd_count : IOLOOP_INITIAL_FD_COUNT;
  ------------------
  |  |    9|  12.4k|#  define IOLOOP_INITIAL_FD_COUNT 128
  ------------------
   40|  6.21k|	io_loop_handler_init(ioloop, initial_fd_count);
   41|  6.21k|}
ioloop.c:io_loop_timeouts_start_new:
  576|  37.8k|{
  577|  37.8k|	struct timeout *timeout;
  578|       |
  579|  37.8k|	if (array_count(&ioloop->timeouts_new) == 0)
  ------------------
  |  |  200|  37.8k|	array_count_i(&(array)->arr)
  ------------------
  |  Branch (579:6): [True: 28.2k, False: 9.52k]
  ------------------
  580|  28.2k|		return;
  581|       |
  582|  9.52k|	io_loop_time_refresh();
  583|       |
  584|  15.7k|	array_foreach_elem(&ioloop->timeouts_new, timeout) {
  ------------------
  |  |  111|  9.52k|	for (const void *_foreach_end = \
  |  |  112|  9.52k|		CONST_PTR_OFFSET(*(array)->v, (array)->arr.buffer->used), \
  |  |  ------------------
  |  |  |  |   27|  9.52k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  |  |  113|  9.52k|	     *_foreach_ptr = CONST_PTR_OFFSET(*(array)->v, ARRAY_TYPE_CHECK(array, &elem) + \
  |  |  ------------------
  |  |  |  |   27|  38.0k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  114|  9.52k|		COMPILE_ERROR_IF_TRUE(sizeof(elem) > sizeof(void *))) \
  |  |  115|  9.52k|		     ;							\
  |  |  116|  25.2k|	     (_foreach_ptr != _foreach_end &&		\
  |  |  ------------------
  |  |  |  Branch (116:8): [True: 15.7k, False: 9.52k]
  |  |  ------------------
  |  |  117|  25.2k|	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   84|  15.7k|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  |  |  ------------------
  |  |               	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   15|  15.7k|#  define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  15.7k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (117:7): [True: 15.7k, False: 0]
  |  |  ------------------
  |  |  118|  9.52k|		;							\
  |  |  119|  15.7k|	     _foreach_ptr = CONST_PTR_OFFSET(_foreach_ptr, sizeof(elem)))
  |  |  ------------------
  |  |  |  |   27|  15.7k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  ------------------
  585|  15.7k|		i_assert(timeout->next_run.tv_sec == 0 &&
  ------------------
  |  |  219|  15.7k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  15.7k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  15.7k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  31.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 15.7k]
  |  |  |  |  |  Branch (202:45): [True: 15.7k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 15.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  15.7k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  15.7k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  15.7k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  586|  15.7k|			timeout->next_run.tv_usec == 0);
  587|  15.7k|		i_assert(!timeout->one_shot);
  ------------------
  |  |  219|  15.7k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  15.7k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  15.7k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  15.7k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 15.7k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 15.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  15.7k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  15.7k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  15.7k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  588|  15.7k|		i_assert(timeout->msecs > 0);
  ------------------
  |  |  219|  15.7k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  15.7k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  15.7k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  15.7k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 15.7k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 15.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  15.7k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  15.7k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  15.7k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  589|  15.7k|		timeout_update_next(timeout, &ioloop_timeval);
  590|  15.7k|		priorityq_add(ioloop->timeouts, &timeout->item);
  591|  15.7k|	}
  592|  9.52k|	array_clear(&ioloop->timeouts_new);
  ------------------
  |  |  192|  9.52k|	array_clear_i(&(array)->arr)
  ------------------
  593|  9.52k|}
ioloop.c:io_loop_call_pending:
  767|  37.8k|{
  768|  37.8k|	struct io_file *io;
  769|       |
  770|  64.2k|	while (ioloop->io_pending_count > 0) {
  ------------------
  |  Branch (770:9): [True: 26.3k, False: 37.8k]
  ------------------
  771|  26.3k|		io = ioloop->io_files;
  772|  46.7k|		do {
  773|  46.7k|			ioloop->next_io_file = io->next;
  774|  46.7k|			if (io->io.pending)
  ------------------
  |  Branch (774:8): [True: 26.3k, False: 20.4k]
  ------------------
  775|  26.3k|				io_loop_call_io(&io->io);
  776|  46.7k|			if (ioloop->io_pending_count == 0)
  ------------------
  |  Branch (776:8): [True: 26.2k, False: 20.5k]
  ------------------
  777|  26.2k|				break;
  778|  20.5k|			io = ioloop->next_io_file;
  779|  20.5k|		} while (io != NULL);
  ------------------
  |  Branch (779:12): [True: 20.4k, False: 163]
  ------------------
  780|  26.3k|	}
  781|  37.8k|}
ioloop.c:timeout_cmp:
  558|  29.6k|{
  559|  29.6k|	const struct timeout *to1 = p1, *to2 = p2;
  560|       |
  561|  29.6k|	return timeval_cmp(&to1->next_run, &to2->next_run);
  562|  29.6k|}

iostream_pump_create:
  114|  6.21k|{
  115|  6.21k|	struct iostream_pump *pump;
  116|       |
  117|  6.21k|	i_assert(input != NULL &&
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  12.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:45): [True: 6.21k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 6.21k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  118|  6.21k|		 output != NULL);
  119|  6.21k|	i_assert(!input->blocking || !output->blocking);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  12.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:45): [True: 6.21k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  120|       |
  121|       |	/* ref streams */
  122|  6.21k|	i_stream_ref(input);
  123|  6.21k|	o_stream_ref(output);
  124|       |
  125|       |	/* create pump */
  126|  6.21k|	pump = i_new(struct iostream_pump, 1);
  ------------------
  |  |    8|  6.21k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  6.21k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  6.21k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  6.21k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  127|  6.21k|	pump->refcount = 1;
  128|  6.21k|	pump->input = input;
  129|  6.21k|	pump->output = output;
  130|       |
  131|  6.21k|	return pump;
  132|  6.21k|}
iostream_pump_start:
  135|  6.21k|{
  136|  6.21k|	i_assert(pump != NULL);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  137|  6.21k|	i_assert(pump->callback != NULL);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  138|       |
  139|       |	/* add flush handler */
  140|  6.21k|	if (!pump->output->blocking) {
  ------------------
  |  Branch (140:6): [True: 6.21k, False: 0]
  ------------------
  141|  6.21k|		o_stream_set_flush_callback(pump->output,
  ------------------
  |  |  142|  6.21k|	o_stream_set_flush_callback(stream - \
  |  |  143|  6.21k|		CALLBACK_TYPECHECK(callback, int (*)(typeof(context))), \
  |  |  ------------------
  |  |  |  |  171|  6.21k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  6.21k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |  144|  6.21k|		(stream_flush_callback_t *)callback, context)
  ------------------
  142|  6.21k|					    iostream_pump_flush, pump);
  143|  6.21k|	}
  144|       |
  145|       |	/* make IO objects */
  146|  6.21k|	if (pump->input->blocking) {
  ------------------
  |  Branch (146:6): [True: 6.21k, False: 0]
  ------------------
  147|  6.21k|		i_assert(!pump->output->blocking);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  148|  6.21k|		o_stream_set_flush_pending(pump->output, TRUE);
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  149|  6.21k|	} else {
  150|      0|		pump->io = io_add_istream(pump->input,
  ------------------
  |  |   86|      0|	io_add_istream(input, __FILE__, __LINE__ - \
  |  |   87|      0|		CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
  |  |  ------------------
  |  |  |  |  171|      0|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|      0|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |   88|      0|		(io_callback_t *)callback, context)
  ------------------
  151|      0|					  iostream_pump_copy, pump);
  152|      0|		io_set_pending(pump->io);
  153|      0|	}
  154|  6.21k|}
iostream_pump_get_input:
  157|  6.18k|{
  158|  6.18k|	i_assert(pump != NULL);
  ------------------
  |  |  219|  6.18k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.18k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.18k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.18k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.18k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.18k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.18k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.18k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  159|  6.18k|	return pump->input;
  160|  6.18k|}
iostream_pump_get_output:
  163|  6.18k|{
  164|  6.18k|	i_assert(pump != NULL);
  ------------------
  |  |  219|  6.18k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.18k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.18k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.18k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.18k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.18k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.18k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.18k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  165|  6.18k|	return pump->output;
  166|  6.18k|}
iostream_pump_set_completion_callback:
  171|  6.21k|{
  172|  6.21k|	i_assert(pump != NULL);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  173|  6.21k|	pump->callback = callback;
  174|  6.21k|	pump->context = context;
  175|  6.21k|}
iostream_pump_unref:
  185|  6.21k|{
  186|  6.21k|	i_assert(_pump != NULL);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  187|  6.21k|	struct iostream_pump *pump = *_pump;
  188|       |
  189|  6.21k|	if (pump == NULL)
  ------------------
  |  Branch (189:6): [True: 0, False: 6.21k]
  ------------------
  190|      0|		return;
  191|       |
  192|  6.21k|	i_assert(pump->refcount > 0);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  193|       |
  194|  6.21k|	*_pump = NULL;
  195|       |
  196|  6.21k|	if (--pump->refcount > 0)
  ------------------
  |  Branch (196:6): [True: 0, False: 6.21k]
  ------------------
  197|      0|		return;
  198|       |
  199|  6.21k|	iostream_pump_stop(pump);
  200|       |
  201|  6.21k|	o_stream_unref(&pump->output);
  202|  6.21k|	i_stream_unref(&pump->input);
  203|  6.21k|	i_free(pump);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  204|  6.21k|}
iostream_pump_destroy:
  207|  12.3k|{
  208|  12.3k|	i_assert(_pump != NULL);
  ------------------
  |  |  219|  12.3k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  12.3k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  12.3k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  12.3k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 12.3k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 12.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  12.3k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  12.3k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.3k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  209|  12.3k|	struct iostream_pump *pump = *_pump;
  210|       |
  211|  12.3k|	if (pump == NULL)
  ------------------
  |  Branch (211:6): [True: 6.18k, False: 6.21k]
  ------------------
  212|  6.18k|		return;
  213|       |
  214|  6.21k|	*_pump = NULL;
  215|       |
  216|  6.21k|	iostream_pump_stop(pump);
  217|  6.21k|	o_stream_unref(&pump->output);
  218|  6.21k|	i_stream_unref(&pump->input);
  219|       |
  220|  6.21k|	iostream_pump_unref(&pump);
  221|  6.21k|}
iostream_pump_stop:
  224|  12.4k|{
  225|  12.4k|	i_assert(pump != NULL);
  ------------------
  |  |  219|  12.4k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  12.4k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  12.4k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  12.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 12.4k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 12.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  12.4k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  12.4k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.4k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  226|       |
  227|  12.4k|	if (pump->output != NULL)
  ------------------
  |  Branch (227:6): [True: 6.21k, False: 6.21k]
  ------------------
  228|  6.21k|		o_stream_unset_flush_callback(pump->output);
  229|       |
  230|  12.4k|	io_remove(&pump->io);
  231|  12.4k|}
iostream-pump.c:iostream_pump_flush:
   86|  6.52k|{
   87|  6.52k|	int ret;
   88|       |
   89|  6.52k|	if ((ret = o_stream_flush(pump->output)) <= 0) {
  ------------------
  |  Branch (89:6): [True: 0, False: 6.52k]
  ------------------
   90|      0|		if (ret < 0) {
  ------------------
  |  Branch (90:7): [True: 0, False: 0]
  ------------------
   91|      0|			pump->callback(IOSTREAM_PUMP_STATUS_OUTPUT_ERROR,
   92|      0|				       pump->context);
   93|      0|		}
   94|      0|		return ret;
   95|      0|	}
   96|  6.52k|	pump->waiting_output = FALSE;
  ------------------
  |  |   11|  6.52k|#  define FALSE (!1)
  ------------------
   97|  6.52k|	if (pump->completed) {
  ------------------
  |  Branch (97:6): [True: 63, False: 6.46k]
  ------------------
   98|     63|		pump->callback(IOSTREAM_PUMP_STATUS_INPUT_EOF, pump->context);
   99|     63|		return 1;
  100|     63|	}
  101|       |
  102|  6.46k|	if (pump->input->blocking)
  ------------------
  |  Branch (102:6): [True: 6.46k, False: 0]
  ------------------
  103|  6.46k|		iostream_pump_copy(pump);
  104|      0|	else if (pump->io == NULL) {
  ------------------
  |  Branch (104:11): [True: 0, False: 0]
  ------------------
  105|      0|		pump->io = io_add_istream(pump->input,
  ------------------
  |  |   86|      0|	io_add_istream(input, __FILE__, __LINE__ - \
  |  |   87|      0|		CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
  |  |  ------------------
  |  |  |  |  171|      0|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|      0|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |   88|      0|		(io_callback_t *)callback, context)
  ------------------
  106|      0|					  iostream_pump_copy, pump);
  107|      0|		io_set_pending(pump->io);
  108|      0|	}
  109|  6.46k|	return ret;
  110|  6.52k|}
iostream-pump.c:iostream_pump_copy:
   29|  6.46k|{
   30|  6.46k|	enum ostream_send_istream_result res;
   31|  6.46k|	size_t old_size;
   32|       |
   33|  6.46k|	o_stream_cork(pump->output);
   34|  6.46k|	old_size = o_stream_get_max_buffer_size(pump->output);
   35|  6.46k|	o_stream_set_max_buffer_size(pump->output,
   36|  6.46k|		I_MIN(IO_BLOCK_SIZE,
  ------------------
  |  |   35|  6.46k|#define I_MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 6.46k]
  |  |  ------------------
  ------------------
   37|  6.46k|		      o_stream_get_max_buffer_size(pump->output)));
   38|  6.46k|	res = o_stream_send_istream(pump->output, pump->input);
   39|  6.46k|	o_stream_set_max_buffer_size(pump->output, old_size);
   40|  6.46k|	o_stream_uncork(pump->output);
   41|       |
   42|  6.46k|	switch(res) {
  ------------------
  |  Branch (42:9): [True: 0, False: 6.46k]
  ------------------
   43|      0|	case OSTREAM_SEND_ISTREAM_RESULT_ERROR_INPUT:
  ------------------
  |  Branch (43:2): [True: 0, False: 6.46k]
  ------------------
   44|      0|		io_remove(&pump->io);
   45|      0|		pump->callback(IOSTREAM_PUMP_STATUS_INPUT_ERROR,
   46|      0|			       pump->context);
   47|      0|		return;
   48|      0|	case OSTREAM_SEND_ISTREAM_RESULT_ERROR_OUTPUT:
  ------------------
  |  Branch (48:2): [True: 0, False: 6.46k]
  ------------------
   49|      0|		io_remove(&pump->io);
   50|      0|		pump->callback(IOSTREAM_PUMP_STATUS_OUTPUT_ERROR,
   51|      0|			       pump->context);
   52|      0|		return;
   53|    273|	case OSTREAM_SEND_ISTREAM_RESULT_WAIT_OUTPUT:
  ------------------
  |  Branch (53:2): [True: 273, False: 6.19k]
  ------------------
   54|    273|		i_assert(!pump->output->blocking);
  ------------------
  |  |  219|    273|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    273|#  define STMT_START do
  |  |  ------------------
  |  |  220|    273|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    273|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 273]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 273]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    273|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    273|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    273|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   55|    273|		pump->waiting_output = TRUE;
  ------------------
  |  |   15|    273|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|    273|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   56|    273|		io_remove(&pump->io);
   57|    273|		return;
   58|  6.19k|	case OSTREAM_SEND_ISTREAM_RESULT_FINISHED:
  ------------------
  |  Branch (58:2): [True: 6.19k, False: 273]
  ------------------
   59|  6.19k|		pump->waiting_output = FALSE;
  ------------------
  |  |   11|  6.19k|#  define FALSE (!1)
  ------------------
   60|  6.19k|		io_remove(&pump->io);
   61|       |		/* flush it */
   62|  6.19k|		switch (o_stream_finish(pump->output)) {
   63|      0|		case -1:
  ------------------
  |  Branch (63:3): [True: 0, False: 6.19k]
  ------------------
   64|      0|			pump->callback(IOSTREAM_PUMP_STATUS_OUTPUT_ERROR,
   65|      0|				       pump->context);
   66|      0|			break;
   67|     74|		case 0:
  ------------------
  |  Branch (67:3): [True: 74, False: 6.11k]
  ------------------
   68|     74|			pump->waiting_output = TRUE;
  ------------------
  |  |   15|     74|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|     74|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   69|     74|			pump->completed = TRUE;
  ------------------
  |  |   15|     74|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|     74|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   70|     74|			break;
   71|  6.11k|		default:
  ------------------
  |  Branch (71:3): [True: 6.11k, False: 74]
  ------------------
   72|  6.11k|			pump->callback(IOSTREAM_PUMP_STATUS_INPUT_EOF,
   73|  6.11k|				       pump->context);
   74|  6.11k|			break;
   75|  6.19k|		}
   76|  6.19k|		return;
   77|  6.19k|	case OSTREAM_SEND_ISTREAM_RESULT_WAIT_INPUT:
  ------------------
  |  Branch (77:2): [True: 0, False: 6.46k]
  ------------------
   78|      0|		i_assert(!pump->input->blocking);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   79|      0|		pump->waiting_output = FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
   80|      0|		return;
   81|  6.46k|	}
   82|      0|	i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
   83|  6.46k|}

io_stream_init:
   21|  57.6k|{
   22|  57.6k|	if (stream->close == NULL)
  ------------------
  |  Branch (22:6): [True: 0, False: 57.6k]
  ------------------
   23|      0|		stream->close = io_stream_default_close;
   24|  57.6k|	if (stream->destroy == NULL)
  ------------------
  |  Branch (24:6): [True: 0, False: 57.6k]
  ------------------
   25|      0|		stream->destroy = io_stream_default_destroy;
   26|  57.6k|	stream->ioloop = current_ioloop;
   27|       |
   28|  57.6k|	stream->refcount = 1;
   29|  57.6k|}
io_stream_ref:
   32|   174k|{
   33|   174k|	i_assert(stream->refcount > 0);
  ------------------
  |  |  219|   174k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   174k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   174k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   174k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 174k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 174k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   174k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   174k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   174k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   34|       |
   35|   174k|	stream->refcount++;
   36|   174k|}
io_stream_unref:
   39|   231k|{
   40|   231k|	i_assert(stream->refcount > 0);
  ------------------
  |  |  219|   231k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   231k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   231k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   231k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 231k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 231k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   231k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   231k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   231k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   41|   231k|	if (--stream->refcount != 0)
  ------------------
  |  Branch (41:6): [True: 174k, False: 57.6k]
  ------------------
   42|   174k|		return TRUE;
  ------------------
  |  |   15|   174k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   174k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   43|       |
   44|  57.6k|	stream->close(stream, FALSE);
  ------------------
  |  |   11|  57.6k|#  define FALSE (!1)
  ------------------
   45|  57.6k|	stream->destroy(stream);
   46|  57.6k|	return FALSE;
  ------------------
  |  |   11|  57.6k|#  define FALSE (!1)
  ------------------
   47|   231k|}
io_stream_free:
   50|  57.6k|{
   51|  57.6k|	const struct iostream_destroy_callback *dc;
   52|       |
   53|  57.6k|	if (array_is_created(&stream->destroy_callbacks)) {
  ------------------
  |  |  176|  57.6k|	array_is_created_i(&(array)->arr)
  |  |  ------------------
  |  |  |  Branch (176:2): [True: 0, False: 57.6k]
  |  |  ------------------
  ------------------
   54|      0|		array_foreach(&stream->destroy_callbacks, dc)
  ------------------
  |  |   83|      0|	for (const void *elem ## __foreach_end = \
  |  |   84|      0|		(const char *)(elem = *(array)->v) + (array)->arr.buffer->used; \
  |  |   85|      0|	     elem != elem ## __foreach_end; (elem)++)
  |  |  ------------------
  |  |  |  Branch (85:7): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   55|      0|			dc->callback(dc->context);
   56|      0|		array_free(&stream->destroy_callbacks);
  ------------------
  |  |  160|      0|	array_free_i(&(array)->arr)
  ------------------
   57|      0|	}
   58|       |
   59|  57.6k|        i_free(stream->error);
  ------------------
  |  |   19|  57.6k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  57.6k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  57.6k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  57.6k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  57.6k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  57.6k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  57.6k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  57.6k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   60|  57.6k|        i_free(stream->name);
  ------------------
  |  |   19|  57.6k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  57.6k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  57.6k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  57.6k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  57.6k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  57.6k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  57.6k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  57.6k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   61|  57.6k|        i_free(stream);
  ------------------
  |  |   19|  57.6k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  57.6k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  57.6k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  57.6k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  57.6k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  57.6k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  57.6k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  57.6k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   62|  57.6k|}
io_stream_close:
   65|  22.8k|{
   66|  22.8k|	stream->close(stream, close_parent);
   67|  22.8k|}
io_stream_set_max_buffer_size:
   71|  41.1k|{
   72|  41.1k|	stream->set_max_buffer_size(stream, max_size);
   73|  41.1k|}
io_stream_set_error:
  105|  1.00k|{
  106|  1.00k|	va_list args;
  107|       |
  108|  1.00k|	va_start(args, fmt);
  109|  1.00k|	io_stream_set_verror(stream, fmt, args);
  110|  1.00k|	va_end(args);
  111|  1.00k|}
io_stream_set_verror:
  115|  2.44k|{
  116|       |	/* one of the parameters may be the old stream->error, so don't free
  117|       |	   it before the new error is created. */
  118|  2.44k|	char *error = i_strdup_vprintf(fmt, args);
  119|  2.44k|	i_free(stream->error);
  ------------------
  |  |   19|  2.44k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  2.44k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  2.44k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.44k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  2.44k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  2.44k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  2.44k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  2.44k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  120|  2.44k|	stream->error = error;
  121|  2.44k|}
io_stream_get_disconnect_reason:
  125|  12.4k|{
  126|  12.4k|	const char *errstr;
  127|       |
  128|  12.4k|	if (input != NULL && input->stream_errno != 0) {
  ------------------
  |  Branch (128:6): [True: 12.4k, False: 0]
  |  Branch (128:23): [True: 854, False: 11.5k]
  ------------------
  129|    854|		errno = input->stream_errno;
  130|    854|		errstr = i_stream_get_error(input);
  131|  11.5k|	} else if (output != NULL && output->stream_errno != 0) {
  ------------------
  |  Branch (131:13): [True: 6.21k, False: 5.35k]
  |  Branch (131:31): [True: 0, False: 6.21k]
  ------------------
  132|      0|		errno = output->stream_errno;
  133|      0|		errstr = o_stream_get_error(output);
  134|  11.5k|	} else {
  135|  11.5k|		errno = 0;
  136|  11.5k|		errstr = "";
  137|  11.5k|	}
  138|       |
  139|  12.4k|	if (errno == 0 || errno == EPIPE)
  ------------------
  |  Branch (139:6): [True: 11.5k, False: 854]
  |  Branch (139:20): [True: 789, False: 65]
  ------------------
  140|  12.3k|		return "Connection closed";
  141|     65|	else
  142|     65|		return t_strdup_printf("Connection closed: %s", errstr);
  143|  12.4k|}
io_stream_switch_ioloop_to:
  147|  12.4k|{
  148|  12.4k|	stream->ioloop = ioloop;
  149|  12.4k|}
io_stream_get_ioloop:
  152|  38.1k|{
  153|  38.1k|	return (stream->ioloop == NULL ? current_ioloop : stream->ioloop);
  ------------------
  |  Branch (153:10): [True: 0, False: 38.1k]
  ------------------
  154|  38.1k|}

i_stream_chain_append:
   64|  9.46k|{
   65|  9.46k|	i_stream_chain_append_internal(chain, stream);
   66|  9.46k|}
i_stream_chain_append_eof:
   69|     89|{
   70|     89|	i_stream_chain_append_internal(chain, NULL);
   71|     89|}
i_stream_create_chain:
  328|  2.61k|{
  329|  2.61k|	struct chain_istream *cstream;
  330|       |
  331|  2.61k|	cstream = i_new(struct chain_istream, 1);
  ------------------
  |  |    8|  2.61k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  2.61k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  2.61k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  2.61k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  2.61k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  2.61k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  332|  2.61k|	cstream->chain.stream = cstream;
  333|  2.61k|	cstream->istream.max_buffer_size = max_buffer_size;
  334|       |
  335|  2.61k|	cstream->istream.iostream.close = i_stream_chain_close;
  336|  2.61k|	cstream->istream.iostream.destroy = i_stream_chain_destroy;
  337|  2.61k|	cstream->istream.iostream.set_max_buffer_size =
  338|  2.61k|		i_stream_chain_set_max_buffer_size;
  339|       |
  340|  2.61k|	cstream->istream.read = i_stream_chain_read;
  341|  2.61k|	cstream->istream.snapshot = i_stream_chain_snapshot;
  342|       |
  343|  2.61k|	cstream->istream.istream.readable_fd = FALSE;
  ------------------
  |  |   11|  2.61k|#  define FALSE (!1)
  ------------------
  344|  2.61k|	cstream->istream.istream.blocking = FALSE;
  ------------------
  |  |   11|  2.61k|#  define FALSE (!1)
  ------------------
  345|  2.61k|	cstream->istream.istream.seekable = FALSE;
  ------------------
  |  |   11|  2.61k|#  define FALSE (!1)
  ------------------
  346|       |
  347|  2.61k|	*chain_r = &cstream->chain;
  348|  2.61k|	return i_stream_create(&cstream->istream, NULL, -1, 0);
  349|  2.61k|}
istream-chain.c:i_stream_chain_append_internal:
   39|  9.55k|{
   40|  9.55k|	struct istream_chain_link *link;
   41|       |
   42|  9.55k|	if (stream == NULL && chain->tail != NULL && chain->tail->stream == NULL)
  ------------------
  |  Branch (42:6): [True: 89, False: 9.46k]
  |  Branch (42:24): [True: 89, False: 0]
  |  Branch (42:47): [True: 0, False: 89]
  ------------------
   43|      0|		return;
   44|       |
   45|  9.55k|	link = i_new(struct istream_chain_link, 1);
  ------------------
  |  |    8|  9.55k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  9.55k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  9.55k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  9.55k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  9.55k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  9.55k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   46|  9.55k|	link->stream = stream;
   47|  9.55k|	link->eof = stream == NULL;
   48|       |
   49|  9.55k|	if (stream != NULL)
  ------------------
  |  Branch (49:6): [True: 9.46k, False: 89]
  ------------------
   50|  9.46k|		i_stream_ref(stream);
   51|       |
   52|  9.55k|	if (chain->head == NULL && stream != NULL) {
  ------------------
  |  Branch (52:6): [True: 9.46k, False: 89]
  |  Branch (52:29): [True: 9.46k, False: 0]
  ------------------
   53|  9.46k|		i_stream_set_max_buffer_size(stream,
   54|  9.46k|			chain->stream->istream.max_buffer_size);
   55|  9.46k|	}
   56|  9.55k|	DLLIST2_APPEND(&chain->head, &chain->tail, link);
  ------------------
  |  |   49|  9.55k|	DLLIST2_APPEND_FULL(head, tail, item, prev, next)
  |  |  ------------------
  |  |  |  |   41|  9.55k|#define DLLIST2_APPEND_FULL(head, tail, item, prev, next) STMT_START { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  9.55k|#  define STMT_START do
  |  |  |  |  ------------------
  |  |  |  |   42|  9.55k|	(item)->prev = *(tail); \
  |  |  |  |   43|  9.55k|	(item)->next = NULL; \
  |  |  |  |   44|  9.55k|	if (*(tail) != NULL) (*(tail))->next = (item); else (*head) = (item); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:6): [True: 89, False: 9.46k]
  |  |  |  |  ------------------
  |  |  |  |   45|  9.55k|	*(tail) = (item); \
  |  |  |  |   46|  9.55k|	} STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  9.55k|#  define STMT_END while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   57|       |	/* if io_add_istream() has been added to this chain stream, notify
   58|       |	   the callback that we have more data available. */
   59|  9.55k|	if (stream != NULL)
  ------------------
  |  Branch (59:6): [True: 9.46k, False: 89]
  ------------------
   60|  9.46k|		i_stream_set_input_pending(stream, TRUE);
  ------------------
  |  |   15|  9.46k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  9.46k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   61|  9.55k|}
istream-chain.c:i_stream_chain_close:
  276|  5.22k|{
  277|  5.22k|	struct chain_istream *cstream =
  278|  5.22k|		container_of(stream, struct chain_istream, istream.iostream);
  ------------------
  |  |   30|  5.22k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  5.22k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  5.22k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  5.22k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  5.22k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  5.22k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  279|       |
  280|       |	/* seek to the correct position in parent stream in case it didn't
  281|       |	   end with EOF */
  282|  5.22k|	(void)i_stream_chain_skip(cstream);
  283|       |
  284|  5.22k|	if (close_parent) {
  ------------------
  |  Branch (284:6): [True: 0, False: 5.22k]
  ------------------
  285|      0|		struct istream_chain_link *link = cstream->chain.head;
  286|      0|		while (link != NULL) {
  ------------------
  |  Branch (286:10): [True: 0, False: 0]
  ------------------
  287|      0|			i_stream_close(link->stream);
  288|      0|			link = link->next;
  289|      0|		}
  290|      0|	}
  291|  5.22k|}
istream-chain.c:i_stream_chain_skip:
  160|  29.9k|{
  161|  29.9k|	struct istream_private *stream = &cstream->istream;
  162|  29.9k|	struct istream_chain_link *link = cstream->chain.head;
  163|  29.9k|	size_t bytes_skipped;
  164|       |
  165|  29.9k|	i_assert(stream->skip >= cstream->prev_skip);
  ------------------
  |  |  219|  29.9k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  29.9k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  29.9k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  29.9k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 29.9k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 29.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  29.9k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  29.9k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  29.9k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  166|  29.9k|	bytes_skipped = stream->skip - cstream->prev_skip;
  167|       |
  168|  29.9k|	if (cstream->prev_stream_left == 0) {
  ------------------
  |  Branch (168:6): [True: 29.9k, False: 0]
  ------------------
  169|       |		/* no need to worry about buffers, skip everything */
  170|  29.9k|	} else if (bytes_skipped < cstream->prev_stream_left) {
  ------------------
  |  Branch (170:13): [True: 0, False: 0]
  ------------------
  171|       |		/* we're still skipping inside buffer */
  172|      0|		cstream->prev_stream_left -= bytes_skipped;
  173|      0|		bytes_skipped = 0;
  174|      0|	} else {
  175|       |		/* done with the buffer */
  176|      0|		bytes_skipped -= cstream->prev_stream_left;
  177|      0|		cstream->prev_stream_left = 0;
  178|      0|	}
  179|  29.9k|	if (bytes_skipped > 0) {
  ------------------
  |  Branch (179:6): [True: 5.96k, False: 23.9k]
  ------------------
  180|  5.96k|		i_assert(stream->buffer != NULL);
  ------------------
  |  |  219|  5.96k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  5.96k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  5.96k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  5.96k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 5.96k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 5.96k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  5.96k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  5.96k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  5.96k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  181|  5.96k|		stream->pos -= bytes_skipped;
  182|  5.96k|		stream->skip -= bytes_skipped;
  183|  5.96k|		stream->buffer += bytes_skipped;
  184|  5.96k|	}
  185|  29.9k|	cstream->prev_skip = stream->skip;
  186|  29.9k|	if (link == NULL || link->eof) {
  ------------------
  |  Branch (186:6): [True: 13.7k, False: 16.1k]
  |  Branch (186:22): [True: 176, False: 15.9k]
  ------------------
  187|  13.9k|		i_assert(bytes_skipped == 0);
  ------------------
  |  |  219|  13.9k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  13.9k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  13.9k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  13.9k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 13.9k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 13.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  13.9k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  13.9k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  13.9k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  188|  13.9k|		return FALSE;
  ------------------
  |  |   11|  13.9k|#  define FALSE (!1)
  ------------------
  189|  13.9k|	}
  190|  15.9k|	i_stream_skip(link->stream, bytes_skipped);
  191|  15.9k|	return TRUE;
  ------------------
  |  |   15|  15.9k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  15.9k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  192|  29.9k|}
istream-chain.c:i_stream_chain_destroy:
   90|  2.61k|{
   91|  2.61k|	struct chain_istream *cstream =
   92|  2.61k|		container_of(stream, struct chain_istream, istream.iostream);
  ------------------
  |  |   30|  2.61k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  2.61k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  2.61k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  2.61k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  2.61k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  2.61k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
   93|  2.61k|	struct istream_chain_link *link = cstream->chain.head;
   94|       |
   95|  2.91k|	while (link != NULL) {
  ------------------
  |  Branch (95:9): [True: 306, False: 2.61k]
  ------------------
   96|    306|		struct istream_chain_link *next = link->next;
   97|       |
   98|    306|		i_stream_unref(&link->stream);
   99|    306|		i_free(link);
  ------------------
  |  |   19|    306|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|    306|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|    306|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|    306|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|    306|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|    306|		(mem) = NULL;			\
  |  |  |  |  |  |  134|    306|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|    306|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  100|    306|		link = next;
  101|    306|	}
  102|  2.61k|	i_stream_free_buffer(&cstream->istream);
  103|  2.61k|}
istream-chain.c:i_stream_chain_read:
  195|  24.8k|{
  196|  24.8k|	struct chain_istream *cstream =
  197|  24.8k|		container_of(stream, struct chain_istream, istream);
  ------------------
  |  |   30|  24.8k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  24.8k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  24.8k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  24.8k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  24.8k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  24.8k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  198|  24.8k|	struct istream_chain_link *link = cstream->chain.head;
  199|  24.8k|	const unsigned char *data;
  200|  24.8k|	size_t data_size, cur_data_pos, new_pos;
  201|  24.8k|	size_t new_bytes_count;
  202|  24.8k|	ssize_t ret;
  203|       |
  204|  24.8k|	if (link != NULL && link->eof) {
  ------------------
  |  Branch (204:6): [True: 15.6k, False: 9.16k]
  |  Branch (204:22): [True: 88, False: 15.5k]
  ------------------
  205|     88|		stream->istream.eof = TRUE;
  ------------------
  |  |   15|     88|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|     88|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  206|     88|		return -1;
  207|     88|	}
  208|       |
  209|  24.7k|	if (!i_stream_chain_skip(cstream))
  ------------------
  |  Branch (209:6): [True: 9.16k, False: 15.5k]
  ------------------
  210|  9.16k|		return 0;
  211|  24.7k|	i_assert(link != NULL);
  ------------------
  |  |  219|  15.5k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  15.5k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  15.5k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  15.5k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 15.5k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 15.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  15.5k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  24.7k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  24.7k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  212|       |
  213|  15.5k|	i_assert(stream->pos >= stream->skip + cstream->prev_stream_left);
  ------------------
  |  |  219|  15.5k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  15.5k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  15.5k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  15.5k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 15.5k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 15.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  15.5k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  15.5k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  15.5k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  214|  15.5k|	cur_data_pos = stream->pos - (stream->skip + cstream->prev_stream_left);
  215|       |
  216|  15.5k|	data = i_stream_get_data(link->stream, &data_size);
  217|  15.5k|	if (data_size > cur_data_pos)
  ------------------
  |  Branch (217:6): [True: 0, False: 15.5k]
  ------------------
  218|      0|		ret = 0;
  219|  15.5k|	else {
  220|       |		/* need to read more */
  221|  15.5k|		i_assert(cur_data_pos == data_size);
  ------------------
  |  |  219|  15.5k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  15.5k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  15.5k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  15.5k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 15.5k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 15.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  15.5k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  15.5k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  15.5k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  222|  15.5k|		ret = i_stream_read_memarea(link->stream);
  223|  15.5k|		if (ret == -2 || ret == 0)
  ------------------
  |  Branch (223:7): [True: 0, False: 15.5k]
  |  Branch (223:20): [True: 132, False: 15.4k]
  ------------------
  224|    132|			return ret;
  225|       |
  226|  15.4k|		if (ret == -1) {
  ------------------
  |  Branch (226:7): [True: 9.46k, False: 5.96k]
  ------------------
  227|  9.46k|			if (link->stream->stream_errno != 0) {
  ------------------
  |  Branch (227:8): [True: 217, False: 9.24k]
  ------------------
  228|    217|				io_stream_set_error(&stream->iostream,
  229|    217|					"read(%s) failed: %s",
  230|    217|					i_stream_get_name(link->stream),
  231|    217|					i_stream_get_error(link->stream));
  232|    217|				stream->istream.stream_errno =
  233|    217|					link->stream->stream_errno;
  234|    217|				return -1;
  235|    217|			}
  236|       |			/* EOF of this stream, go to next stream */
  237|  9.24k|			i_stream_chain_read_next(cstream);
  238|  9.24k|			cstream->prev_skip = stream->skip;
  239|  9.24k|			return i_stream_chain_read(stream);
  240|  9.46k|		}
  241|       |		/* we read something */
  242|  5.96k|		data = i_stream_get_data(link->stream, &data_size);
  243|  5.96k|	}
  244|       |
  245|  5.96k|	if (data_size == cur_data_pos) {
  ------------------
  |  Branch (245:6): [True: 0, False: 5.96k]
  ------------------
  246|       |		/* nothing new read - preserve the buffer as it was */
  247|      0|		i_assert(ret == 0 || ret == -1);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  248|      0|		return ret;
  249|      0|	}
  250|  5.96k|	if (cstream->prev_stream_left == 0) {
  ------------------
  |  Branch (250:6): [True: 5.96k, False: 0]
  ------------------
  251|       |		/* we can point directly to the current stream's buffers */
  252|  5.96k|		stream->buffer = data;
  253|  5.96k|		stream->pos -= stream->skip;
  254|  5.96k|		stream->skip = 0;
  255|  5.96k|		new_pos = data_size;
  256|  5.96k|	} else {
  257|       |		/* we still have some of the previous stream left. merge the
  258|       |		   new data with it. */
  259|      0|		i_assert(data_size > cur_data_pos);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  260|      0|		new_bytes_count = data_size - cur_data_pos;
  261|      0|		memcpy(i_stream_alloc(stream, new_bytes_count),
  ------------------
  |  |   84|      0|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
  262|      0|		       data + cur_data_pos, new_bytes_count);
  263|      0|		stream->buffer = stream->w_buffer;
  264|      0|		new_pos = stream->pos + new_bytes_count;
  265|      0|	}
  266|       |
  267|  5.96k|	i_assert(new_pos > stream->pos);
  ------------------
  |  |  219|  5.96k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  5.96k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  5.96k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  5.96k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 5.96k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 5.96k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  5.96k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  5.96k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  5.96k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  268|  5.96k|	ret = (ssize_t)(new_pos - stream->pos);
  269|  5.96k|	stream->pos = new_pos;
  270|  5.96k|	cstream->prev_skip = stream->skip;
  271|  5.96k|	return ret;
  272|  5.96k|}
istream-chain.c:i_stream_chain_read_next:
  106|  9.24k|{
  107|  9.24k|	struct istream_chain_link *link = cstream->chain.head;
  108|  9.24k|	struct istream *prev_input;
  109|  9.24k|	const unsigned char *data;
  110|  9.24k|	size_t data_size, cur_data_pos;
  111|       |
  112|  9.24k|	i_assert(link != NULL && link->stream != NULL);
  ------------------
  |  |  219|  9.24k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  9.24k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  9.24k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  18.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 9.24k]
  |  |  |  |  |  Branch (202:45): [True: 9.24k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 9.24k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  9.24k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  9.24k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  9.24k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  113|  9.24k|	i_assert(link->stream->eof);
  ------------------
  |  |  219|  9.24k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  9.24k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  9.24k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  9.24k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 9.24k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 9.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  9.24k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  9.24k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  9.24k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  114|       |
  115|  9.24k|	prev_input = link->stream;
  116|  9.24k|	data = i_stream_get_data(prev_input, &data_size);
  117|       |
  118|  9.24k|	DLLIST2_REMOVE(&cstream->chain.head, &cstream->chain.tail, link);
  ------------------
  |  |   79|  9.24k|	DLLIST2_REMOVE_FULL(head, tail, item, prev, next)
  |  |  ------------------
  |  |  |  |   65|  9.24k|#define DLLIST2_REMOVE_FULL(head, tail, item, prev, next) STMT_START { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  9.24k|#  define STMT_START do
  |  |  |  |  ------------------
  |  |  |  |   66|  9.24k|	if ((item)->prev != NULL) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:6): [True: 0, False: 9.24k]
  |  |  |  |  ------------------
  |  |  |  |   67|  9.24k|		(item)->prev->next = (item)->next; \
  |  |  |  |   68|  9.24k|	else if (*(head) == item) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (68:11): [True: 9.24k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   69|  9.24k|		*(head) = (item)->next; \
  |  |  |  |   70|  9.24k|	if ((item)->next != NULL) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (70:6): [True: 88, False: 9.16k]
  |  |  |  |  ------------------
  |  |  |  |   71|     88|		(item)->next->prev = (item)->prev; \
  |  |  |  |   72|     88|		(item)->next = NULL; \
  |  |  |  |   73|  9.16k|	} else if ((*tail) == item) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (73:13): [True: 9.16k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   74|  9.16k|		*(tail) = (item)->prev; \
  |  |  |  |   75|  9.24k|	(item)->prev = NULL; \
  |  |  |  |   76|  9.24k|	} STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  9.24k|#  define STMT_END while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  119|  9.24k|	i_free(link);
  ------------------
  |  |   19|  9.24k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  9.24k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  9.24k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  9.24k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  9.24k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  9.24k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  9.24k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  9.24k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  120|       |
  121|       |	/* a) we have more streams, b) we have EOF, c) we need to wait
  122|       |	   for more streams */
  123|  9.24k|	link = cstream->chain.head;
  124|  9.24k|	if (link != NULL && link->stream != NULL)
  ------------------
  |  Branch (124:6): [True: 88, False: 9.16k]
  |  Branch (124:22): [True: 0, False: 88]
  ------------------
  125|      0|		i_stream_seek(link->stream, 0);
  126|       |
  127|  9.24k|	if (cstream->prev_stream_left > 0) {
  ------------------
  |  Branch (127:6): [True: 0, False: 9.24k]
  ------------------
  128|       |		/* we've already buffered some of the prev_input. continue
  129|       |		   appending the rest to it. if it's already at EOF, there's
  130|       |		   nothing more to append. */
  131|      0|		cur_data_pos = cstream->istream.pos -
  132|      0|			(cstream->istream.skip + cstream->prev_stream_left);
  133|      0|		i_assert(cur_data_pos <= data_size);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  134|      0|		data += cur_data_pos;
  135|      0|		data_size -= cur_data_pos;
  136|       |		/* the stream has now become "previous", so its contents in
  137|       |		   buffer are now part of prev_stream_left. */
  138|      0|		cstream->prev_stream_left += cur_data_pos;
  139|  9.24k|	} else {
  140|  9.24k|		cstream->istream.pos = 0;
  141|  9.24k|		cstream->istream.skip = 0;
  142|  9.24k|		cstream->prev_stream_left = 0;
  143|  9.24k|	}
  144|       |
  145|  9.24k|	if (data_size > 0) {
  ------------------
  |  Branch (145:6): [True: 0, False: 9.24k]
  ------------------
  146|      0|		if (cstream->istream.memarea != NULL &&
  ------------------
  |  Branch (146:7): [True: 0, False: 0]
  ------------------
  147|      0|		    memarea_get_refcount(cstream->istream.memarea) > 1)
  ------------------
  |  Branch (147:7): [True: 0, False: 0]
  ------------------
  148|      0|			i_stream_memarea_detach(&cstream->istream);
  149|      0|		memcpy(i_stream_alloc(&cstream->istream, data_size),
  ------------------
  |  |   84|      0|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
  150|      0|		       data, data_size);
  151|      0|		cstream->istream.pos += data_size;
  152|      0|		cstream->prev_stream_left += data_size;
  153|      0|	}
  154|       |
  155|  9.24k|	i_stream_skip(prev_input, i_stream_get_data_size(prev_input));
  156|  9.24k|	i_stream_unref(&prev_input);
  157|  9.24k|}

i_stream_create_from_data:
   20|  6.21k|{
   21|  6.21k|	struct istream_private *stream;
   22|       |
   23|  6.21k|	stream = i_new(struct istream_private, 1);
  ------------------
  |  |    8|  6.21k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  6.21k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  6.21k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  6.21k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   24|  6.21k|	stream->buffer = data;
   25|  6.21k|	stream->pos = size;
   26|  6.21k|	stream->max_buffer_size = SIZE_MAX;
   27|       |
   28|  6.21k|	stream->read = i_stream_data_read;
   29|  6.21k|	stream->seek = i_stream_data_seek;
   30|       |
   31|  6.21k|	stream->istream.readable_fd = FALSE;
  ------------------
  |  |   11|  6.21k|#  define FALSE (!1)
  ------------------
   32|  6.21k|	stream->istream.blocking = TRUE;
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   33|  6.21k|	stream->istream.seekable = TRUE;
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   34|  6.21k|	i_stream_create(stream, NULL, -1, ISTREAM_CREATE_FLAG_NOOP_SNAPSHOT);
   35|  6.21k|	stream->statbuf.st_size = size;
   36|  6.21k|	i_stream_set_name(&stream->istream, "(buffer)");
   37|  6.21k|	return &stream->istream;
   38|  6.21k|}
istream-data.c:i_stream_data_read:
    7|  6.19k|{
    8|  6.19k|	stream->istream.eof = TRUE;
  ------------------
  |  |   15|  6.19k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.19k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
    9|  6.19k|	return -1;
   10|  6.19k|}

i_stream_create_failure_at:
   70|  1.55k|{
   71|  1.55k|	struct failure_at_istream *fstream;
   72|       |
   73|  1.55k|	fstream = i_new(struct failure_at_istream, 1);
  ------------------
  |  |    8|  1.55k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  1.55k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  1.55k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  1.55k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  1.55k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  1.55k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   74|  1.55k|	fstream->istream.max_buffer_size = input->real_stream->max_buffer_size;
   75|  1.55k|	fstream->istream.stream_size_passthrough = TRUE;
  ------------------
  |  |   15|  1.55k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  1.55k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   76|       |
   77|  1.55k|	fstream->istream.read = i_stream_failure_at_read;
   78|  1.55k|	fstream->istream.iostream.destroy = i_stream_failure_at_destroy;
   79|       |
   80|  1.55k|	fstream->istream.istream.readable_fd = input->readable_fd;
   81|  1.55k|	fstream->istream.istream.blocking = input->blocking;
   82|  1.55k|	fstream->istream.istream.seekable = input->seekable;
   83|       |
   84|  1.55k|	fstream->error_code = stream_errno;
   85|  1.55k|	fstream->error_string = i_strdup(error_string);
   86|  1.55k|	fstream->failure_offset = failure_offset;
   87|  1.55k|	return i_stream_create(&fstream->istream, input,
   88|  1.55k|			       i_stream_get_fd(input), 0);
   89|  1.55k|}
istream-failure-at.c:i_stream_failure_at_read:
   25|  4.50k|{
   26|  4.50k|	struct failure_at_istream *fstream =
   27|  4.50k|		container_of(stream, struct failure_at_istream, istream);
  ------------------
  |  |   30|  4.50k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  4.50k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  4.50k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  4.50k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  4.50k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  4.50k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
   28|  4.50k|	uoff_t new_offset;
   29|  4.50k|	ssize_t ret;
   30|       |
   31|  4.50k|	i_stream_seek(stream->parent, stream->parent_start_offset +
   32|  4.50k|		      stream->istream.v_offset);
   33|       |
   34|  4.50k|	ret = i_stream_read_copy_from_parent(&stream->istream);
   35|  4.50k|	new_offset = stream->istream.v_offset + (stream->pos - stream->skip);
   36|  4.50k|	if (ret >= 0 && new_offset >= fstream->failure_offset) {
  ------------------
  |  Branch (36:6): [True: 2.94k, False: 1.55k]
  |  Branch (36:18): [True: 0, False: 2.94k]
  ------------------
   37|      0|		if (stream->istream.v_offset >= fstream->failure_offset) {
  ------------------
  |  Branch (37:7): [True: 0, False: 0]
  ------------------
   38|       |			/* we already passed the wanted failure offset,
   39|       |			   return error immediately. */
   40|      0|			stream->pos = stream->skip;
   41|      0|			stream->istream.stream_errno = errno =
   42|      0|				fstream->error_code;
   43|      0|			io_stream_set_error(&stream->iostream, "%s",
   44|      0|					    fstream->error_string);
   45|      0|			ret = -1;
   46|      0|		} else {
   47|       |			/* return data up to the wanted failure offset and
   48|       |			   on the next read() call return failure */
   49|      0|			size_t new_pos = fstream->failure_offset -
   50|      0|				stream->istream.v_offset + stream->skip;
   51|      0|			i_assert(new_pos >= stream->skip &&
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   52|      0|				 stream->pos >= new_pos);
   53|      0|			ret -= stream->pos - new_pos;
   54|      0|			stream->pos = new_pos;
   55|      0|		}
   56|  4.50k|	} else if (ret < 0 && stream->istream.stream_errno == 0 &&
  ------------------
  |  Branch (56:13): [True: 1.55k, False: 2.94k]
  |  Branch (56:24): [True: 1.16k, False: 391]
  ------------------
   57|  4.50k|		   fstream->failure_offset == UOFF_T_MAX) {
  ------------------
  |  |  846|  1.16k|#define UOFF_T_MAX ULONG_MAX
  ------------------
  |  Branch (57:6): [True: 0, False: 1.16k]
  ------------------
   58|       |		/* failure at EOF */
   59|      0|		stream->istream.stream_errno = errno =
   60|      0|			fstream->error_code;
   61|      0|		io_stream_set_error(&stream->iostream, "%s",
   62|      0|				    fstream->error_string);
   63|      0|	}
   64|  4.50k|	return ret;
   65|  4.50k|}
istream-failure-at.c:i_stream_failure_at_destroy:
   15|  1.55k|{
   16|  1.55k|	struct failure_at_istream *fstream =
   17|  1.55k|		container_of(stream, struct failure_at_istream,
  ------------------
  |  |   30|  1.55k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  1.55k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  1.55k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  1.55k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  1.55k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  1.55k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
   18|  1.55k|			     istream.iostream);
   19|       |
   20|  1.55k|	i_free(fstream->error_string);
  ------------------
  |  |   19|  1.55k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  1.55k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  1.55k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.55k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  1.55k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  1.55k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  1.55k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  1.55k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   21|  1.55k|}

i_stream_file_close:
   17|  18.6k|{
   18|  18.6k|	struct istream_private *_stream =
   19|  18.6k|		container_of(stream, struct istream_private, iostream);
  ------------------
  |  |   30|  18.6k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  18.6k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  18.6k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  18.6k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  18.6k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  18.6k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
   20|  18.6k|	struct file_istream *fstream =
   21|  18.6k|		container_of(_stream, struct file_istream, istream);
  ------------------
  |  |   30|  18.6k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  18.6k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  18.6k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  18.6k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  18.6k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  18.6k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
   22|       |
   23|  18.6k|	if (fstream->autoclose_fd && _stream->fd != -1) {
  ------------------
  |  Branch (23:6): [True: 0, False: 18.6k]
  |  Branch (23:31): [True: 0, False: 0]
  ------------------
   24|       |		/* Ignore ECONNRESET because we don't really care about it here,
   25|       |		   as we are closing the socket down in any case. There might be
   26|       |		   unsent data but nothing we can do about that. */
   27|      0|		if (unlikely(close(_stream->fd) < 0 && errno != ECONNRESET)) {
  ------------------
  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   28|      0|			i_error("file_istream.close(%s) failed: %m",
   29|      0|				i_stream_get_name(&_stream->istream));
   30|      0|		}
   31|      0|	}
   32|  18.6k|	_stream->fd = -1;
   33|  18.6k|}
i_stream_file_read:
   50|  23.4k|{
   51|  23.4k|	struct file_istream *fstream =
   52|  23.4k|		container_of(stream, struct file_istream, istream);
  ------------------
  |  |   30|  23.4k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  23.4k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  23.4k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  23.4k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  23.4k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  23.4k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
   53|  23.4k|	uoff_t offset;
   54|  23.4k|	size_t size;
   55|  23.4k|	ssize_t ret;
   56|       |
   57|  23.4k|	if (!i_stream_try_alloc(stream, 1, &size))
  ------------------
  |  Branch (57:6): [True: 0, False: 23.4k]
  ------------------
   58|      0|		return -2;
   59|       |
   60|  23.4k|	if (stream->fd == -1) {
  ------------------
  |  Branch (60:6): [True: 0, False: 23.4k]
  ------------------
   61|      0|		if (i_stream_file_open(stream) < 0)
  ------------------
  |  Branch (61:7): [True: 0, False: 0]
  ------------------
   62|      0|			return -1;
   63|      0|		i_assert(stream->fd != -1);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   64|      0|	}
   65|       |
   66|  23.4k|	offset = stream->istream.v_offset + (stream->pos - stream->skip);
   67|       |
   68|  23.4k|	if (fstream->file) {
  ------------------
  |  Branch (68:6): [True: 0, False: 23.4k]
  ------------------
   69|      0|		ret = pread(stream->fd, stream->w_buffer + stream->pos,
   70|      0|			    size, offset);
   71|  23.4k|	} else if (fstream->seen_eof) {
  ------------------
  |  Branch (71:13): [True: 0, False: 23.4k]
  ------------------
   72|       |		/* don't try to read() again. EOF from keyboard (^D)
   73|       |		   requires this to work right. */
   74|      0|		ret = 0;
   75|  23.4k|	} else {
   76|  23.4k|		ret = read(stream->fd, stream->w_buffer + stream->pos,
   77|  23.4k|			   size);
   78|  23.4k|	}
   79|       |
   80|  23.4k|	if (ret == 0) {
  ------------------
  |  Branch (80:6): [True: 5.89k, False: 17.5k]
  ------------------
   81|       |		/* EOF */
   82|  5.89k|		stream->istream.eof = TRUE;
  ------------------
  |  |   15|  5.89k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  5.89k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   83|  5.89k|		fstream->seen_eof = TRUE;
  ------------------
  |  |   15|  5.89k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  5.89k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   84|  5.89k|		return -1;
   85|  5.89k|	}
   86|       |
   87|  17.5k|	if (unlikely(ret < 0)) {
  ------------------
  |  |  202|  17.5k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 376, False: 17.2k]
  |  |  |  Branch (202:44): [True: 376, False: 17.2k]
  |  |  ------------------
  ------------------
   88|    376|		if ((errno == EINTR || errno == EAGAIN) &&
  ------------------
  |  Branch (88:8): [True: 0, False: 376]
  |  Branch (88:26): [True: 376, False: 0]
  ------------------
   89|    376|		    !stream->istream.blocking) {
  ------------------
  |  Branch (89:7): [True: 376, False: 0]
  ------------------
   90|    376|			ret = 0;
   91|    376|		} else {
   92|      0|			i_assert(errno != 0);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   93|       |			/* if we get EBADF for a valid fd, it means something's
   94|       |			   really wrong and we'd better just crash. */
   95|      0|			i_assert(errno != EBADF);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   96|      0|			if (fstream->file) {
  ------------------
  |  Branch (96:8): [True: 0, False: 0]
  ------------------
   97|      0|				io_stream_set_error(&stream->iostream,
   98|      0|					"pread(size=%zu offset=%"PRIuUOFF_T") failed: %m",
   99|      0|					size, offset);
  100|      0|			} else {
  101|      0|				io_stream_set_error(&stream->iostream,
  102|      0|					"read(size=%zu) failed: %m",
  103|      0|					size);
  104|      0|			}
  105|      0|			stream->istream.stream_errno = errno;
  106|      0|			return -1;
  107|      0|		}
  108|    376|	}
  109|       |
  110|  17.5k|	if (ret > 0 && fstream->skip_left > 0) {
  ------------------
  |  Branch (110:6): [True: 17.2k, False: 376]
  |  Branch (110:17): [True: 0, False: 17.2k]
  ------------------
  111|      0|		i_assert(!fstream->file);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  112|      0|		i_assert(stream->skip == stream->pos);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  113|       |
  114|      0|		if (fstream->skip_left >= (size_t)ret) {
  ------------------
  |  Branch (114:7): [True: 0, False: 0]
  ------------------
  115|      0|			fstream->skip_left -= ret;
  116|      0|			ret = 0;
  117|      0|		} else {
  118|      0|			ret -= fstream->skip_left;
  119|      0|			stream->pos += fstream->skip_left;
  120|      0|			stream->skip += fstream->skip_left;
  121|      0|			fstream->skip_left = 0;
  122|      0|		}
  123|      0|	}
  124|       |
  125|  17.5k|	stream->pos += ret;
  126|  17.5k|	i_assert(ret != 0 || !fstream->file);
  ------------------
  |  |  219|  17.5k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  17.5k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  17.5k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  17.9k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 17.5k]
  |  |  |  |  |  Branch (202:45): [True: 17.2k, False: 376]
  |  |  |  |  |  Branch (202:45): [True: 376, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  17.5k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  17.5k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  17.5k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  127|  17.5k|	i_assert(ret != -1);
  ------------------
  |  |  219|  17.5k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  17.5k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  17.5k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  17.5k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 17.5k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 17.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  17.5k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  17.5k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  17.5k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  128|  17.5k|	return ret;
  129|  17.5k|}
i_stream_create_file_common:
  192|  6.21k|{
  193|  6.21k|	struct istream *input;
  194|  6.21k|	struct stat st;
  195|  6.21k|	bool is_file;
  196|  6.21k|	int flags;
  197|       |
  198|  6.21k|	fstream->autoclose_fd = autoclose_fd;
  199|       |
  200|  6.21k|	fstream->istream.iostream.close = i_stream_file_close;
  201|  6.21k|	fstream->istream.max_buffer_size = max_buffer_size;
  202|  6.21k|	fstream->istream.read = i_stream_file_read;
  203|  6.21k|	fstream->istream.seek = i_stream_file_seek;
  204|  6.21k|	fstream->istream.sync = i_stream_file_sync;
  205|  6.21k|	fstream->istream.stat = i_stream_file_stat;
  206|       |
  207|       |	/* if it's a file, set the flags properly */
  208|  6.21k|	if (fd == -1) {
  ------------------
  |  Branch (208:6): [True: 0, False: 6.21k]
  ------------------
  209|       |		/* only the path is known for now - the fd is opened later */
  210|      0|		is_file = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  211|  6.21k|	} else if (fstat(fd, &st) < 0)
  ------------------
  |  Branch (211:13): [True: 0, False: 6.21k]
  ------------------
  212|      0|		is_file = FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  213|  6.21k|	else if (S_ISREG(st.st_mode))
  214|      0|		is_file = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  215|  6.21k|	else if (!S_ISDIR(st.st_mode))
  ------------------
  |  Branch (215:11): [True: 6.21k, False: 0]
  ------------------
  216|  6.21k|		is_file = FALSE;
  ------------------
  |  |   11|  6.21k|#  define FALSE (!1)
  ------------------
  217|      0|	else {
  218|       |		/* we're trying to open a directory.
  219|       |		   we're not designed for it. */
  220|      0|		io_stream_set_error(&fstream->istream.iostream,
  221|      0|			"%s is a directory, can't read it as file",
  222|      0|			path != NULL ? path : t_strdup_printf("<fd %d>", fd));
  ------------------
  |  Branch (222:4): [True: 0, False: 0]
  ------------------
  223|      0|		fstream->istream.istream.stream_errno = EISDIR;
  224|      0|		is_file = FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  225|      0|	}
  226|  6.21k|	if (is_file) {
  ------------------
  |  Branch (226:6): [True: 0, False: 6.21k]
  ------------------
  227|      0|		fstream->file = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  228|      0|		fstream->istream.istream.blocking = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  229|      0|		fstream->istream.istream.seekable = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  230|  6.21k|	} else if ((flags = fcntl(fd, F_GETFL, 0)) < 0) {
  ------------------
  |  Branch (230:13): [True: 0, False: 6.21k]
  ------------------
  231|      0|		i_assert(fd > -1);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  232|       |		/* shouldn't happen */
  233|      0|		fstream->istream.istream.stream_errno = errno;
  234|      0|		io_stream_set_error(&fstream->istream.iostream,
  235|      0|			"fcntl(%d, F_GETFL) failed: %m", fd);
  236|  6.21k|	} else if ((flags & O_NONBLOCK) == 0) {
  ------------------
  |  Branch (236:13): [True: 0, False: 6.21k]
  ------------------
  237|       |		/* blocking socket/fifo */
  238|      0|		fstream->istream.istream.blocking = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  239|      0|	}
  240|  6.21k|	fstream->istream.istream.readable_fd = TRUE;
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  241|       |
  242|  6.21k|	input = i_stream_create(&fstream->istream, NULL, fd, 0);
  243|  6.21k|	i_stream_set_name(input, is_file ? "(file)" : "(fd)");
  ------------------
  |  Branch (243:27): [True: 0, False: 6.21k]
  ------------------
  244|  6.21k|	return input;
  245|  6.21k|}
i_stream_create_fd:
  248|  6.21k|{
  249|  6.21k|	struct file_istream *fstream;
  250|       |
  251|  6.21k|	i_assert(fd != -1);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|       |
  253|  6.21k|	fstream = i_new(struct file_istream, 1);
  ------------------
  |  |    8|  6.21k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  6.21k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  6.21k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  6.21k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|  6.21k|	return i_stream_create_file_common(fstream, fd, NULL,
  255|  6.21k|					   max_buffer_size, FALSE);
  ------------------
  |  |   11|  6.21k|#  define FALSE (!1)
  ------------------
  256|  6.21k|}

i_stream_create_limit:
  115|  12.8k|{
  116|  12.8k|	struct limit_istream *lstream;
  117|       |
  118|  12.8k|	lstream = i_new(struct limit_istream, 1);
  ------------------
  |  |    8|  12.8k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  12.8k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  12.8k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  12.8k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  12.8k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  12.8k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  119|  12.8k|	lstream->v_size = v_size;
  120|  12.8k|	lstream->istream.max_buffer_size = input->real_stream->max_buffer_size;
  121|       |
  122|  12.8k|	lstream->istream.iostream.destroy = i_stream_limit_destroy;
  123|  12.8k|	lstream->istream.read = i_stream_limit_read;
  124|  12.8k|	lstream->istream.stat = i_stream_limit_stat;
  125|  12.8k|	lstream->istream.get_size = i_stream_limit_get_size;
  126|       |
  127|  12.8k|	lstream->istream.istream.readable_fd = input->readable_fd;
  128|  12.8k|	lstream->istream.istream.blocking = input->blocking;
  129|  12.8k|	lstream->istream.istream.seekable = input->seekable;
  130|  12.8k|	return i_stream_create(&lstream->istream, input,
  131|  12.8k|			       i_stream_get_fd(input), 0);
  132|  12.8k|}
istream-limit.c:i_stream_limit_destroy:
   13|  12.8k|{
   14|  12.8k|	struct limit_istream *lstream =
   15|  12.8k|		container_of(stream, struct limit_istream, istream.iostream);
  ------------------
  |  |   30|  12.8k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  12.8k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  12.8k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  12.8k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  12.8k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  12.8k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
   16|  12.8k|       uoff_t v_offset;
   17|       |
   18|  12.8k|       v_offset = lstream->istream.parent_start_offset +
   19|  12.8k|               lstream->istream.istream.v_offset;
   20|  12.8k|       if (lstream->istream.parent->seekable ||
  ------------------
  |  Branch (20:12): [True: 0, False: 12.8k]
  ------------------
   21|  12.8k|           v_offset > lstream->istream.parent->v_offset) {
  ------------------
  |  Branch (21:12): [True: 0, False: 12.8k]
  ------------------
   22|       |               /* get to same position in parent stream */
   23|      0|               i_stream_seek(lstream->istream.parent, v_offset);
   24|      0|       }
   25|  12.8k|}
istream-limit.c:i_stream_limit_read:
   28|  25.8k|{
   29|  25.8k|	struct limit_istream *lstream =
   30|  25.8k|		container_of(stream, struct limit_istream, istream);
  ------------------
  |  |   30|  25.8k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  25.8k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  25.8k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  25.8k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  25.8k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  25.8k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
   31|  25.8k|	uoff_t left;
   32|  25.8k|	ssize_t ret;
   33|  25.8k|	size_t pos;
   34|       |
   35|  25.8k|	i_stream_seek(stream->parent, lstream->istream.parent_start_offset +
   36|  25.8k|		      stream->istream.v_offset);
   37|       |
   38|  25.8k|	if (stream->istream.v_offset +
  ------------------
  |  Branch (38:6): [True: 16.0k, False: 9.88k]
  ------------------
   39|  25.8k|	    (stream->pos - stream->skip) >= lstream->v_size) {
   40|  16.0k|		stream->istream.eof = TRUE;
  ------------------
  |  |   15|  16.0k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  16.0k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   41|  16.0k|		return -1;
   42|  16.0k|	}
   43|       |
   44|  9.88k|	stream->pos -= stream->skip;
   45|  9.88k|	stream->skip = 0;
   46|       |
   47|  9.88k|	stream->buffer = i_stream_get_data(stream->parent, &pos);
   48|  9.88k|	if (pos > stream->pos)
  ------------------
  |  Branch (48:6): [True: 3.77k, False: 6.11k]
  ------------------
   49|  3.77k|		ret = 0;
   50|  6.11k|	else do {
   51|  6.11k|		ret = i_stream_read_memarea(stream->parent);
   52|  6.11k|		stream->istream.stream_errno = stream->parent->stream_errno;
   53|  6.11k|		stream->istream.eof = stream->parent->eof;
   54|  6.11k|		stream->buffer = i_stream_get_data(stream->parent, &pos);
   55|  6.11k|	} while (pos <= stream->pos && ret > 0);
  ------------------
  |  Branch (55:11): [True: 573, False: 5.54k]
  |  Branch (55:33): [True: 0, False: 573]
  ------------------
   56|  9.88k|	if (ret == -2)
  ------------------
  |  Branch (56:6): [True: 0, False: 9.88k]
  ------------------
   57|      0|		return -2;
   58|       |
   59|  9.88k|	if (lstream->v_size != UOFF_T_MAX) {
  ------------------
  |  |  846|  9.88k|#define UOFF_T_MAX ULONG_MAX
  ------------------
  |  Branch (59:6): [True: 9.88k, False: 0]
  ------------------
   60|  9.88k|		left = lstream->v_size - stream->istream.v_offset;
   61|  9.88k|		if (pos >= left) {
  ------------------
  |  Branch (61:7): [True: 3.58k, False: 6.30k]
  ------------------
   62|  3.58k|			pos = left;
   63|  3.58k|			stream->istream.eof = TRUE;
  ------------------
  |  |   15|  3.58k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  3.58k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   64|  3.58k|		}
   65|  9.88k|	}
   66|       |
   67|  9.88k|	ret = pos > stream->pos ? (ssize_t)(pos - stream->pos) :
  ------------------
  |  Branch (67:8): [True: 9.31k, False: 573]
  ------------------
   68|  9.88k|		(ret == 0 ? 0 : -1);
  ------------------
  |  Branch (68:4): [True: 175, False: 398]
  ------------------
   69|  9.88k|	stream->pos = pos;
   70|  9.88k|	i_assert(ret != -1 || stream->istream.eof ||
  ------------------
  |  |  219|  9.88k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  9.88k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  9.88k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  20.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 9.88k]
  |  |  |  |  |  Branch (202:45): [True: 9.49k, False: 398]
  |  |  |  |  |  Branch (202:45): [True: 398, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  9.88k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  9.88k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  9.88k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   71|  9.88k|		 stream->istream.stream_errno != 0);
   72|  9.88k|	return ret;
   73|  9.88k|}

i_stream_create_sized:
  176|  12.8k|{
  177|  12.8k|	struct sized_istream *sstream;
  178|       |
  179|  12.8k|	sstream = i_stream_create_sized_common(input, size);
  180|  12.8k|	sstream->error_callback = i_stream_create_sized_default_error_callback;
  181|  12.8k|	sstream->error_context = sstream;
  182|  12.8k|	return &sstream->istream.istream;
  183|  12.8k|}
i_stream_create_min_sized:
  198|  12.8k|{
  199|  12.8k|	struct istream *ret;
  200|       |
  201|  12.8k|	ret= i_stream_create_sized(input, min_size);
  202|  12.8k|	struct sized_istream *ret_sstream =
  203|  12.8k|		container_of(ret->real_stream, struct sized_istream, istream);
  ------------------
  |  |   30|  12.8k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  12.8k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  12.8k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  12.8k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  12.8k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  12.8k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  204|  12.8k|	ret_sstream->min_size_only = TRUE;
  ------------------
  |  |   15|  12.8k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  12.8k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  205|  12.8k|	return ret;
  206|  12.8k|}
istream-sized.c:i_stream_create_sized_common:
  156|  12.8k|{
  157|  12.8k|	struct sized_istream *sstream;
  158|       |
  159|  12.8k|	sstream = i_new(struct sized_istream, 1);
  ------------------
  |  |    8|  12.8k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  12.8k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  12.8k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  12.8k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  12.8k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  12.8k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  160|  12.8k|	sstream->size = size;
  161|  12.8k|	sstream->istream.max_buffer_size = input->real_stream->max_buffer_size;
  162|       |
  163|  12.8k|	sstream->istream.iostream.destroy = i_stream_sized_destroy;
  164|  12.8k|	sstream->istream.read = i_stream_sized_read;
  165|  12.8k|	sstream->istream.stat = i_stream_sized_stat;
  166|       |
  167|  12.8k|	sstream->istream.istream.readable_fd = input->readable_fd;
  168|  12.8k|	sstream->istream.istream.blocking = input->blocking;
  169|  12.8k|	sstream->istream.istream.seekable = input->seekable;
  170|  12.8k|	(void)i_stream_create(&sstream->istream, input,
  171|  12.8k|			      i_stream_get_fd(input), 0);
  172|  12.8k|	return sstream;
  173|  12.8k|}
istream-sized.c:i_stream_sized_destroy:
   18|  12.8k|{
   19|  12.8k|	struct sized_istream *sstream =
   20|  12.8k|		container_of(stream, struct sized_istream, istream.iostream);
  ------------------
  |  |   30|  12.8k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  12.8k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  12.8k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  12.8k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  12.8k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  12.8k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
   21|  12.8k|	uoff_t v_offset;
   22|       |
   23|  12.8k|	v_offset = sstream->istream.parent_start_offset +
   24|  12.8k|		sstream->istream.istream.v_offset;
   25|  12.8k|	if (sstream->istream.parent->seekable ||
  ------------------
  |  Branch (25:6): [True: 0, False: 12.8k]
  ------------------
   26|  12.8k|	    v_offset > sstream->istream.parent->v_offset) {
  ------------------
  |  Branch (26:6): [True: 0, False: 12.8k]
  ------------------
   27|       |		/* get to same position in parent stream */
   28|      0|		i_stream_seek(sstream->istream.parent, v_offset);
   29|      0|	}
   30|  12.8k|}
istream-sized.c:i_stream_sized_read:
   63|  22.3k|{
   64|  22.3k|	struct sized_istream *sstream =
   65|  22.3k|		container_of(stream, struct sized_istream, istream);
  ------------------
  |  |   30|  22.3k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  22.3k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  22.3k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  22.3k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  22.3k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  22.3k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
   66|  22.3k|	struct istream_sized_error_data data;
   67|  22.3k|	const char *error;
   68|  22.3k|	uoff_t left;
   69|  22.3k|	ssize_t ret;
   70|  22.3k|	size_t pos;
   71|       |
   72|  22.3k|	i_stream_seek(stream->parent, sstream->istream.parent_start_offset +
   73|  22.3k|		      stream->istream.v_offset);
   74|       |
   75|  22.3k|	stream->pos -= stream->skip;
   76|  22.3k|	stream->skip = 0;
   77|       |
   78|  22.3k|	stream->buffer = i_stream_get_data(stream->parent, &pos);
   79|  22.3k|	if (pos > stream->pos)
  ------------------
  |  Branch (79:6): [True: 0, False: 22.3k]
  ------------------
   80|      0|		ret = 0;
   81|  22.3k|	else {
   82|  22.3k|		if ((ret = i_stream_sized_parent_read(stream, &pos)) == -2)
  ------------------
  |  Branch (82:7): [True: 0, False: 22.3k]
  ------------------
   83|      0|			return -2;
   84|  22.3k|	}
   85|       |
   86|  22.3k|	left = sstream->size - stream->istream.v_offset;
   87|  22.3k|	if (pos == left && ret != -1) {
  ------------------
  |  Branch (87:6): [True: 16.0k, False: 6.30k]
  |  Branch (87:21): [True: 3.58k, False: 12.4k]
  ------------------
   88|       |		/* we have exactly the wanted amount of data left, but we
   89|       |		   don't know yet if there is more data in parent. */
   90|  3.58k|		ret = i_stream_sized_parent_read(stream, &pos);
   91|  3.58k|	}
   92|       |
   93|  22.3k|	i_zero(&data);
  ------------------
  |  |  249|  22.3k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  22.3k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  22.3k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   94|  22.3k|	data.v_offset = stream->istream.v_offset;
   95|  22.3k|	data.new_bytes = pos;
   96|  22.3k|	data.wanted_size = sstream->size;
   97|  22.3k|	data.eof = stream->istream.eof;
   98|       |
   99|  22.3k|	if (pos == left) {
  ------------------
  |  Branch (99:6): [True: 16.0k, False: 6.30k]
  ------------------
  100|       |		/* we may or may not be finished, depending on whether
  101|       |		   parent is at EOF. */
  102|  16.0k|	} else if (pos > left) {
  ------------------
  |  Branch (102:13): [True: 0, False: 6.30k]
  ------------------
  103|       |		/* parent has more data available than expected */
  104|      0|		if (!sstream->min_size_only) {
  ------------------
  |  Branch (104:7): [True: 0, False: 0]
  ------------------
  105|      0|			error = sstream->error_callback(&data, sstream->error_context);
  106|      0|			io_stream_set_error(&stream->iostream, "%s", error);
  107|      0|			stream->istream.stream_errno = EINVAL;
  108|      0|			return -1;
  109|      0|		}
  110|      0|		pos = left;
  111|      0|		if (pos <= stream->pos) {
  ------------------
  |  Branch (111:7): [True: 0, False: 0]
  ------------------
  112|      0|			stream->istream.eof = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  113|      0|			ret = -1;
  114|      0|		}
  115|  6.30k|	} else if (!stream->istream.eof) {
  ------------------
  |  Branch (115:13): [True: 5.90k, False: 398]
  ------------------
  116|       |		/* still more to read */
  117|  5.90k|	} else if (stream->istream.stream_errno == ENOENT) {
  ------------------
  |  Branch (117:13): [True: 0, False: 398]
  ------------------
  118|       |		/* lost the file */
  119|    398|	} else {
  120|       |		/* EOF before we reached the wanted size */
  121|    398|		error = sstream->error_callback(&data, sstream->error_context);
  122|    398|		io_stream_set_error(&stream->iostream, "%s", error);
  123|    398|		stream->istream.stream_errno = EPIPE;
  124|    398|	}
  125|       |
  126|  22.3k|	ret = pos > stream->pos ? (ssize_t)(pos - stream->pos) :
  ------------------
  |  Branch (126:8): [True: 9.31k, False: 13.0k]
  ------------------
  127|  22.3k|		(ret == 0 ? 0 : -1);
  ------------------
  |  Branch (127:4): [True: 175, False: 12.8k]
  ------------------
  128|  22.3k|	stream->pos = pos;
  129|  22.3k|	i_assert(ret != -1 || stream->istream.eof ||
  ------------------
  |  |  219|  22.3k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  22.3k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  22.3k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  57.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 22.3k]
  |  |  |  |  |  Branch (202:45): [True: 9.49k, False: 12.8k]
  |  |  |  |  |  Branch (202:45): [True: 12.8k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  22.3k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  22.3k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  22.3k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  130|  22.3k|		 stream->istream.stream_errno != 0);
  131|  22.3k|	return ret;
  132|  22.3k|}
istream-sized.c:i_stream_sized_parent_read:
   50|  25.8k|{
   51|  25.8k|	ssize_t ret;
   52|       |
   53|  25.8k|	do {
   54|  25.8k|		ret = i_stream_read_memarea(stream->parent);
   55|  25.8k|		stream->istream.stream_errno = stream->parent->stream_errno;
   56|  25.8k|		stream->istream.eof = stream->parent->eof;
   57|  25.8k|		stream->buffer = i_stream_get_data(stream->parent, pos_r);
   58|  25.8k|	} while (*pos_r <= stream->pos && ret > 0);
  ------------------
  |  Branch (58:11): [True: 13.0k, False: 12.8k]
  |  Branch (58:36): [True: 0, False: 13.0k]
  ------------------
   59|  25.8k|	return ret;
   60|  25.8k|}
istream-sized.c:i_stream_create_sized_default_error_callback:
   35|    398|{
   36|    398|	if (data->v_offset + data->new_bytes < data->wanted_size) {
  ------------------
  |  Branch (36:6): [True: 398, False: 0]
  ------------------
   37|    398|		return t_strdup_printf("Stream is smaller than expected "
   38|    398|			"(%"PRIuUOFF_T" < %"PRIuUOFF_T")",
   39|    398|			data->v_offset + data->new_bytes, data->wanted_size);
   40|    398|	} else {
   41|      0|		return t_strdup_printf("Stream is larger than expected "
   42|      0|			"(%"PRIuUOFF_T" > %"PRIuUOFF_T", eof=%d)",
   43|      0|			data->v_offset + data->new_bytes, data->wanted_size,
   44|      0|			data->eof ? 1 : 0);
  ------------------
  |  Branch (44:4): [True: 0, False: 0]
  ------------------
   45|      0|	}
   46|    398|}

i_stream_set_name:
   13|  26.3k|{
   14|  26.3k|	i_free(stream->real_stream->iostream.name);
  ------------------
  |  |   19|  26.3k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  26.3k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  26.3k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  26.3k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  26.3k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  26.3k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  26.3k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  26.3k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   15|  26.3k|	stream->real_stream->iostream.name = i_strdup(name);
   16|  26.3k|}
i_stream_get_name:
   19|    217|{
   20|    217|	i_assert(stream != NULL);
  ------------------
  |  |  219|    217|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    217|#  define STMT_START do
  |  |  ------------------
  |  |  220|    217|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    217|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 217]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 217]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    217|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    217|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    217|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   21|    521|	while (stream->real_stream->iostream.name == NULL) {
  ------------------
  |  Branch (21:9): [True: 304, False: 217]
  ------------------
   22|    304|		stream = stream->real_stream->parent;
   23|    304|		if (stream == NULL)
  ------------------
  |  Branch (23:7): [True: 0, False: 304]
  ------------------
   24|      0|			return "";
   25|    304|	}
   26|    217|	return stream->real_stream->iostream.name;
   27|    217|}
i_stream_destroy:
   39|  64.6k|{
   40|  64.6k|	if (*stream == NULL)
  ------------------
  |  Branch (40:6): [True: 54.2k, False: 10.3k]
  ------------------
   41|  54.2k|		return;
   42|       |
   43|  10.3k|	i_stream_close_full(*stream, FALSE);
  ------------------
  |  |   11|  10.3k|#  define FALSE (!1)
  ------------------
   44|  10.3k|	i_stream_unref(stream);
   45|  10.3k|}
i_stream_ref:
   48|   133k|{
   49|   133k|	io_stream_ref(&stream->real_stream->iostream);
   50|   133k|}
i_stream_unref:
   53|   296k|{
   54|   296k|	struct istream *stream = *_stream;
   55|   296k|	struct istream_private *rstream;
   56|       |
   57|   296k|	if (stream == NULL)
  ------------------
  |  Branch (57:6): [True: 117k, False: 178k]
  ------------------
   58|   117k|		return;
   59|       |
   60|   178k|	*_stream = NULL;
   61|   178k|	rstream = stream->real_stream;
   62|       |
   63|   178k|	if (rstream->iostream.refcount > 1) {
  ------------------
  |  Branch (63:6): [True: 133k, False: 45.2k]
  ------------------
   64|   133k|		if (!io_stream_unref(&rstream->iostream))
  ------------------
  |  Branch (64:7): [True: 0, False: 133k]
  ------------------
   65|      0|			i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
   66|   133k|	} else {
   67|       |		/* The snapshot may contain pointers to the parent istreams.
   68|       |		   Free it before io_stream_unref() frees the parents. */
   69|  45.2k|		i_stream_snapshot_free(&rstream->prev_snapshot);
   70|       |
   71|  45.2k|		if (io_stream_unref(&rstream->iostream))
  ------------------
  |  Branch (71:7): [True: 0, False: 45.2k]
  ------------------
   72|      0|			i_unreached();
  ------------------
  |  |   69|      0|	i_unreached(__FILE__, __LINE__)
  ------------------
   73|  45.2k|		str_free(&rstream->line_str);
   74|  45.2k|		i_stream_unref(&rstream->parent);
   75|  45.2k|		io_stream_free(&rstream->iostream);
   76|  45.2k|	}
   77|   178k|}
i_stream_get_fd:
   95|  90.6k|{
   96|  90.6k|	struct istream_private *_stream = stream->real_stream;
   97|       |
   98|  90.6k|	return _stream->fd;
   99|  90.6k|}
i_stream_get_error:
  123|  1.07k|{
  124|  1.07k|	struct istream *s;
  125|       |
  126|       |	/* we'll only return errors for streams that have stream_errno set or
  127|       |	   that have reached EOF. we might be returning unintended error
  128|       |	   otherwise. */
  129|  1.07k|	if (stream->stream_errno == 0)
  ------------------
  |  Branch (129:6): [True: 0, False: 1.07k]
  ------------------
  130|      0|		return stream->eof ? "EOF" : "<no error>";
  ------------------
  |  Branch (130:10): [True: 0, False: 0]
  ------------------
  131|       |
  132|  1.46k|	for (s = stream; s != NULL; s = s->real_stream->parent) {
  ------------------
  |  Branch (132:19): [True: 1.46k, False: 0]
  ------------------
  133|  1.46k|		if (s->stream_errno == 0)
  ------------------
  |  Branch (133:7): [True: 0, False: 1.46k]
  ------------------
  134|      0|			break;
  135|  1.46k|		if (s->real_stream->iostream.error != NULL)
  ------------------
  |  Branch (135:7): [True: 1.07k, False: 391]
  ------------------
  136|  1.07k|			return s->real_stream->iostream.error;
  137|  1.46k|	}
  138|      0|	return strerror(stream->stream_errno);
  139|  1.07k|}
i_stream_get_disconnect_reason:
  142|  6.20k|{
  143|  6.20k|	return io_stream_get_disconnect_reason(stream, NULL);
  144|  6.20k|}
i_stream_close:
  147|  6.21k|{
  148|  6.21k|	if (stream != NULL)
  ------------------
  |  Branch (148:6): [True: 6.21k, False: 0]
  ------------------
  149|  6.21k|		i_stream_close_full(stream, TRUE);
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  150|  6.21k|}
i_stream_set_max_buffer_size:
  158|  28.2k|{
  159|  28.2k|	io_stream_set_max_buffer_size(&stream->real_stream->iostream, max_size);
  160|  28.2k|}
i_stream_get_max_buffer_size:
  163|  16.8k|{
  164|  16.8k|	size_t max_size = 0;
  165|       |
  166|  19.8k|	do {
  167|  19.8k|		if (max_size < stream->real_stream->max_buffer_size)
  ------------------
  |  Branch (167:7): [True: 16.8k, False: 3.06k]
  ------------------
  168|  16.8k|			max_size = stream->real_stream->max_buffer_size;
  169|  19.8k|		stream = stream->real_stream->parent;
  170|  19.8k|	} while (stream != NULL);
  ------------------
  |  Branch (170:11): [True: 3.06k, False: 16.8k]
  ------------------
  171|  16.8k|	return max_size;
  172|  16.8k|}
i_stream_default_snapshot:
  226|  1.52k|{
  227|  1.52k|	struct istream_snapshot *snapshot;
  228|       |
  229|  1.52k|	if (stream->memarea != NULL) {
  ------------------
  |  Branch (229:6): [True: 1.52k, False: 0]
  ------------------
  230|  1.52k|		if (prev_snapshot != NULL) {
  ------------------
  |  Branch (230:7): [True: 39, False: 1.48k]
  ------------------
  231|     39|			if (snapshot_has_memarea(prev_snapshot, stream->memarea))
  ------------------
  |  Branch (231:8): [True: 38, False: 1]
  ------------------
  232|     38|				return prev_snapshot;
  233|     39|		}
  234|       |		/* This stream has a memarea. Reference it, so we can later on
  235|       |		   rollback if needed. */
  236|  1.48k|		snapshot = i_new(struct istream_snapshot, 1);
  ------------------
  |  |    8|  1.48k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  1.48k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  1.48k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  1.48k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  1.48k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  1.48k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  237|  1.48k|		snapshot->old_memarea = stream->memarea;
  238|  1.48k|		snapshot->prev_snapshot = prev_snapshot;
  239|  1.48k|		memarea_ref(snapshot->old_memarea);
  240|  1.48k|		return snapshot;
  241|  1.52k|	}
  242|      0|	if (stream->parent == NULL) {
  ------------------
  |  Branch (242:6): [True: 0, False: 0]
  ------------------
  243|      0|		if (stream->nonpersistent_buffers) {
  ------------------
  |  Branch (243:7): [True: 0, False: 0]
  ------------------
  244|       |			/* Assume that memarea would be used normally, but
  245|       |			   now it's NULL because the buffer is empty and
  246|       |			   empty buffers are freed. */
  247|      0|			i_assert(stream->skip == stream->pos);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  248|      0|			return prev_snapshot;
  249|      0|		}
  250|      0|		i_panic("%s is missing istream.snapshot() implementation",
  251|      0|			i_stream_get_name(&stream->istream));
  252|      0|	}
  253|      0|	struct istream_private *_parent_stream =
  254|      0|		stream->parent->real_stream;
  255|      0|	return _parent_stream->snapshot(_parent_stream, prev_snapshot);
  256|      0|}
i_stream_snapshot_free:
  259|  68.9k|{
  260|  68.9k|	struct istream_snapshot *snapshot = *_snapshot;
  261|       |
  262|  68.9k|	if (*_snapshot == NULL)
  ------------------
  |  Branch (262:6): [True: 67.4k, False: 1.48k]
  ------------------
  263|  67.4k|		return;
  264|  1.48k|	*_snapshot = NULL;
  265|       |
  266|  1.48k|	i_stream_snapshot_free(&snapshot->prev_snapshot);
  267|  1.48k|	if (snapshot->free != NULL)
  ------------------
  |  Branch (267:6): [True: 0, False: 1.48k]
  ------------------
  268|      0|		snapshot->free(snapshot);
  269|  1.48k|	else {
  270|  1.48k|		if (snapshot->old_memarea != NULL)
  ------------------
  |  Branch (270:7): [True: 1.48k, False: 0]
  ------------------
  271|  1.48k|			memarea_unref(&snapshot->old_memarea);
  272|  1.48k|		i_stream_unref(&snapshot->istream);
  273|  1.48k|		i_free(snapshot);
  ------------------
  |  |   19|  1.48k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  1.48k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  1.48k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.48k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  1.48k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  1.48k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  1.48k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  1.48k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  274|  1.48k|	}
  275|  1.48k|}
i_stream_read:
  285|  48.2k|{
  286|  48.2k|	struct istream_private *_stream = stream->real_stream;
  287|  48.2k|	ssize_t ret;
  288|       |#ifdef DEBUG
  289|       |	unsigned char prev_buf[4];
  290|       |	const unsigned char *prev_data = _stream->buffer;
  291|       |	size_t prev_skip = _stream->skip, prev_pos = _stream->pos;
  292|       |	bool invalid = i_stream_is_buffer_invalid(_stream);
  293|       |
  294|       |	i_assert(prev_skip <= prev_pos);
  295|       |	size_t prev_size = prev_pos - prev_skip;
  296|       |	if (invalid)
  297|       |		;
  298|       |	else if (prev_size > 4) {
  299|       |		memcpy(prev_buf, prev_data + prev_skip, 2);
  300|       |		memcpy(prev_buf+2, prev_data + prev_pos - 2, 2);
  301|       |	} else if (prev_size > 0) {
  302|       |		memcpy(prev_buf, prev_data + prev_skip, prev_size);
  303|       |	}
  304|       |#endif
  305|       |
  306|  48.2k|	if (_stream->skip != _stream->pos || _stream->prev_snapshot != NULL) {
  ------------------
  |  Branch (306:6): [True: 1.52k, False: 46.7k]
  |  Branch (306:39): [True: 0, False: 46.7k]
  ------------------
  307|  1.52k|		_stream->prev_snapshot =
  308|  1.52k|			_stream->snapshot(_stream, _stream->prev_snapshot);
  309|  1.52k|	}
  310|  48.2k|	ret = i_stream_read_memarea(stream);
  311|  48.2k|	if (ret > 0)
  ------------------
  |  Branch (311:6): [True: 22.1k, False: 26.1k]
  ------------------
  312|  22.1k|		i_stream_snapshot_free(&_stream->prev_snapshot);
  313|       |#ifdef DEBUG
  314|       |	else if (!invalid) {
  315|       |		i_assert((_stream->pos - _stream->skip) == (prev_pos - prev_skip) ||
  316|       |			 prev_pos == prev_skip);
  317|       |		if (prev_data == NULL)
  318|       |			i_assert(prev_pos == prev_skip);
  319|       |		else if (prev_pos - prev_skip <= 4)
  320|       |			i_assert(memcmp(prev_buf, prev_data + prev_skip, prev_pos - prev_skip) == 0);
  321|       |		else {
  322|       |			i_assert(memcmp(prev_buf, prev_data + prev_skip, 2) == 0);
  323|       |			i_assert(memcmp(prev_buf+2, prev_data + prev_pos - 2, 2) == 0);
  324|       |		}
  325|       |	}
  326|       |#endif
  327|  48.2k|	return ret;
  328|  48.2k|}
i_stream_read_memarea:
  331|   102k|{
  332|   102k|	struct istream_private *_stream = stream->real_stream;
  333|   102k|	size_t old_size;
  334|   102k|	ssize_t ret;
  335|       |
  336|   102k|	if (unlikely(stream->closed || stream->stream_errno != 0)) {
  ------------------
  |  |  202|   204k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 65, False: 102k]
  |  |  |  Branch (202:45): [True: 65, False: 102k]
  |  |  |  Branch (202:45): [True: 0, False: 102k]
  |  |  ------------------
  ------------------
  337|     65|		stream->eof = TRUE;
  ------------------
  |  |   15|     65|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|     65|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  338|     65|		errno = stream->stream_errno;
  339|     65|		return -1;
  340|     65|	}
  341|       |
  342|   102k|	stream->eof = FALSE;
  ------------------
  |  |   11|   102k|#  define FALSE (!1)
  ------------------
  343|       |
  344|   102k|	if (_stream->parent != NULL)
  ------------------
  |  Branch (344:6): [True: 57.2k, False: 45.2k]
  ------------------
  345|  57.2k|		i_stream_seek(_stream->parent, _stream->parent_expected_offset);
  346|       |
  347|   102k|	old_size = _stream->pos - _stream->skip;
  348|   102k|	if (_stream->pos < _stream->high_pos) {
  ------------------
  |  Branch (348:6): [True: 0, False: 102k]
  ------------------
  349|       |		/* we're here because we seeked back within the read buffer. */
  350|      0|		ret = _stream->high_pos - _stream->pos;
  351|      0|		_stream->pos = _stream->high_pos;
  352|      0|		_stream->high_pos = 0;
  353|   102k|	} else {
  354|   102k|		_stream->high_pos = 0;
  355|   102k|		ret = _stream->read(_stream);
  356|   102k|	}
  357|   102k|	i_assert(old_size <= _stream->pos - _stream->skip);
  ------------------
  |  |  219|   102k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   102k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   102k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   102k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 102k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 102k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   102k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   102k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   102k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  358|   102k|	switch (ret) {
  359|      0|	case -2:
  ------------------
  |  Branch (359:2): [True: 0, False: 102k]
  ------------------
  360|      0|		i_assert(_stream->skip != _stream->pos);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  361|      0|		break;
  362|  44.7k|	case -1:
  ------------------
  |  Branch (362:2): [True: 44.7k, False: 57.7k]
  ------------------
  363|  44.7k|		if (stream->stream_errno != 0) {
  ------------------
  |  Branch (363:7): [True: 1.39k, False: 43.3k]
  ------------------
  364|       |			/* error handling should be easier if we now just
  365|       |			   assume the stream is now at EOF */
  366|  1.39k|			stream->eof = TRUE;
  ------------------
  |  |   15|  1.39k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  1.39k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  367|  1.39k|			errno = stream->stream_errno;
  368|  43.3k|		} else {
  369|  43.3k|			i_assert(stream->eof);
  ------------------
  |  |  219|  43.3k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  43.3k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  43.3k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  43.3k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 43.3k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 43.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  43.3k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  43.3k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  43.3k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  370|  43.3k|			i_assert(old_size == _stream->pos - _stream->skip);
  ------------------
  |  |  219|  43.3k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  43.3k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  43.3k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  43.3k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 43.3k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 43.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  43.3k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  43.3k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  43.3k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  371|  43.3k|		}
  372|  44.7k|		break;
  373|  44.7k|	case 0:
  ------------------
  |  Branch (373:2): [True: 10.1k, False: 92.2k]
  ------------------
  374|  10.1k|		i_assert(!stream->blocking);
  ------------------
  |  |  219|  10.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  10.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  10.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  10.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 10.1k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 10.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  10.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  10.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  10.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  375|  10.1k|		break;
  376|  47.5k|	default:
  ------------------
  |  Branch (376:2): [True: 47.5k, False: 54.9k]
  ------------------
  377|  47.5k|		i_assert(ret > 0);
  ------------------
  |  |  219|  47.5k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  47.5k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  47.5k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  47.5k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 47.5k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 47.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  47.5k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  47.5k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  47.5k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  378|  47.5k|		i_assert(_stream->skip < _stream->pos);
  ------------------
  |  |  219|  47.5k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  47.5k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  47.5k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  47.5k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 47.5k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 47.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  47.5k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  47.5k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  47.5k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  379|  47.5k|		i_assert((size_t)ret+old_size == _stream->pos - _stream->skip);
  ------------------
  |  |  219|  47.5k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  47.5k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  47.5k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  47.5k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 47.5k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 47.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  47.5k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  47.5k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  47.5k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  380|  47.5k|		_stream->last_read_timeval = ioloop_timeval;
  381|  47.5k|		break;
  382|   102k|	}
  383|       |
  384|   102k|	if (stream->stream_errno != 0) {
  ------------------
  |  Branch (384:6): [True: 1.39k, False: 101k]
  ------------------
  385|       |		/* error handling should be easier if we now just
  386|       |		   assume the stream is now at EOF. Note that we could get here
  387|       |		   even if read() didn't return -1, although that's a little
  388|       |		   bit sloppy istream implementation. */
  389|  1.39k|		stream->eof = TRUE;
  ------------------
  |  |   15|  1.39k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  1.39k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  390|  1.39k|	}
  391|       |
  392|   102k|	i_stream_update(_stream);
  393|       |	/* verify that parents' access_counters are valid. the parent's
  394|       |	   i_stream_read() should guarantee this. */
  395|   102k|	i_assert(!i_stream_is_buffer_invalid(_stream));
  ------------------
  |  |  219|   102k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   102k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   102k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   102k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 102k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 102k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   102k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   102k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   102k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  396|   102k|	return ret;
  397|   102k|}
i_stream_read_copy_from_parent:
  417|  4.50k|{
  418|  4.50k|	struct istream_private *stream = istream->real_stream;
  419|  4.50k|	size_t pos;
  420|  4.50k|	ssize_t ret;
  421|       |
  422|  4.50k|	stream->pos -= stream->skip;
  423|  4.50k|	stream->skip = 0;
  424|       |
  425|  4.50k|	stream->buffer = i_stream_get_data(stream->parent, &pos);
  426|  4.50k|	if (pos > stream->pos)
  ------------------
  |  Branch (426:6): [True: 0, False: 4.50k]
  ------------------
  427|      0|		ret = 0;
  428|  4.50k|	else do {
  429|  4.50k|		ret = i_stream_read_memarea(stream->parent);
  430|  4.50k|		stream->istream.stream_errno = stream->parent->stream_errno;
  431|  4.50k|		stream->istream.eof = stream->parent->eof;
  432|  4.50k|		stream->buffer = i_stream_get_data(stream->parent, &pos);
  433|       |		/* check again, in case the parent stream had been seeked
  434|       |		   backwards and the previous read() didn't get us far
  435|       |		   enough. */
  436|  4.50k|	} while (pos <= stream->pos && ret > 0);
  ------------------
  |  Branch (436:11): [True: 1.63k, False: 2.86k]
  |  Branch (436:33): [True: 0, False: 1.63k]
  ------------------
  437|  4.50k|	if (ret == -2) {
  ------------------
  |  Branch (437:6): [True: 0, False: 4.50k]
  ------------------
  438|      0|		i_stream_update(stream);
  439|      0|		return -2;
  440|      0|	}
  441|       |
  442|  4.50k|	ret = pos > stream->pos ? (ssize_t)(pos - stream->pos) :
  ------------------
  |  Branch (442:8): [True: 2.86k, False: 1.63k]
  ------------------
  443|  4.50k|		(ret == 0 ? 0 : -1);
  ------------------
  |  Branch (443:4): [True: 81, False: 1.55k]
  ------------------
  444|  4.50k|	stream->pos = pos;
  445|  4.50k|	i_assert(ret != -1 || stream->istream.eof ||
  ------------------
  |  |  219|  4.50k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  4.50k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  4.50k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  10.5k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 4.50k]
  |  |  |  |  |  Branch (202:45): [True: 2.94k, False: 1.55k]
  |  |  |  |  |  Branch (202:45): [True: 1.55k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  4.50k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  4.50k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  4.50k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  446|  4.50k|		 stream->istream.stream_errno != 0);
  447|  4.50k|	i_stream_update(stream);
  448|  4.50k|	return ret;
  449|  4.50k|}
i_stream_free_buffer:
  452|  18.0k|{
  453|  18.0k|	if (stream->memarea != NULL) {
  ------------------
  |  Branch (453:6): [True: 11.7k, False: 6.24k]
  ------------------
  454|  11.7k|		memarea_unref(&stream->memarea);
  455|  11.7k|		stream->w_buffer = NULL;
  456|  11.7k|	} else if (stream->w_buffer != NULL) {
  ------------------
  |  Branch (456:13): [True: 0, False: 6.24k]
  ------------------
  457|      0|		i_free_and_null(stream->w_buffer);
  ------------------
  |  |   27|      0|#define i_free_and_null(mem) i_free(mem)
  |  |  ------------------
  |  |  |  |   19|      0|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  135|      0|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|      0|	STMT_START { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   63|      0|#  define STMT_START do
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  132|      0|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  |  |  133|      0|		(mem) = NULL;			\
  |  |  |  |  |  |  |  |  134|      0|	} STMT_END
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  458|  6.24k|	} else {
  459|       |		/* don't know how to free it */
  460|  6.24k|		return;
  461|  6.24k|	}
  462|  11.7k|	stream->buffer_size = 0;
  463|  11.7k|}
i_stream_skip:
  466|   278k|{
  467|   278k|	struct istream_private *_stream = stream->real_stream;
  468|   278k|	size_t data_size;
  469|       |
  470|   278k|	data_size = _stream->pos - _stream->skip;
  471|   278k|	if (count <= data_size) {
  ------------------
  |  Branch (471:6): [True: 278k, False: 0]
  ------------------
  472|       |		/* within buffer */
  473|   278k|		stream->v_offset += count;
  474|   278k|		_stream->skip += count;
  475|   278k|		if (_stream->nonpersistent_buffers &&
  ------------------
  |  Branch (475:7): [True: 0, False: 278k]
  ------------------
  476|   278k|		    _stream->skip == _stream->pos) {
  ------------------
  |  Branch (476:7): [True: 0, False: 0]
  ------------------
  477|      0|			_stream->skip = _stream->pos = 0;
  478|      0|			i_stream_free_buffer(_stream);
  479|      0|		}
  480|   278k|		return;
  481|   278k|	}
  482|       |
  483|       |	/* have to seek forward */
  484|      0|	count -= data_size;
  485|      0|	_stream->skip = _stream->pos;
  486|      0|	stream->v_offset += data_size;
  487|       |
  488|      0|	if (unlikely(stream->closed || stream->stream_errno != 0))
  ------------------
  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  489|      0|		return;
  490|       |
  491|      0|	_stream->seek(_stream, stream->v_offset + count, FALSE);
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  492|      0|}
i_stream_seek:
  508|   109k|{
  509|   109k|	struct istream_private *_stream = stream->real_stream;
  510|       |
  511|   109k|	if (v_offset >= stream->v_offset &&
  ------------------
  |  Branch (511:6): [True: 109k, False: 0]
  ------------------
  512|   109k|	    i_stream_can_optimize_seek(_stream))
  ------------------
  |  Branch (512:6): [True: 109k, False: 0]
  ------------------
  513|   109k|		i_stream_skip(stream, v_offset - stream->v_offset);
  514|      0|	else {
  515|      0|		if (unlikely(stream->closed || stream->stream_errno != 0)) {
  ------------------
  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  516|      0|			stream->eof = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  517|      0|			return;
  518|      0|		}
  519|      0|		stream->eof = FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  520|      0|		_stream->seek(_stream, v_offset, FALSE);
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  521|      0|	}
  522|   109k|	i_stream_update(_stream);
  523|   109k|}
i_stream_have_bytes_left:
  579|   101k|{
  580|   101k|	return i_stream_get_data_size(stream) > 0 || !stream->eof;
  ------------------
  |  Branch (580:9): [True: 45.3k, False: 56.4k]
  |  Branch (580:47): [True: 21.9k, False: 34.4k]
  ------------------
  581|   101k|}
i_stream_get_data:
  718|   413k|{
  719|   413k|	struct istream_private *_stream = stream->real_stream;
  720|       |
  721|   413k|	if (_stream->skip >= _stream->pos) {
  ------------------
  |  Branch (721:6): [True: 185k, False: 227k]
  ------------------
  722|   185k|		*size_r = 0;
  723|   185k|		return uchar_empty_ptr;
  724|   185k|	}
  725|       |
  726|   227k|	if (unlikely(i_stream_is_buffer_invalid(_stream))) {
  ------------------
  |  |  202|   227k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 227k]
  |  |  |  Branch (202:44): [True: 0, False: 227k]
  |  |  ------------------
  ------------------
  727|       |		/* This stream may be using parent's buffer directly as
  728|       |		   _stream->buffer, but the parent stream has already been
  729|       |		   modified indirectly. This means that the buffer might no
  730|       |		   longer point to where we assume it points to. So we'll
  731|       |		   just return the stream as empty until it's read again.
  732|       |
  733|       |		   It's a bit ugly to suddenly drop data from the stream that
  734|       |		   was already read, but since this happens only with shared
  735|       |		   parent istreams the caller is hopefully aware enough that
  736|       |		   something like this might happen. The other solutions would
  737|       |		   be to a) try to automatically read the data back (but we
  738|       |		   can't handle errors..) or b) always copy data to stream's
  739|       |		   own buffer instead of pointing to parent's buffer (but this
  740|       |		   causes data copying that is nearly always unnecessary). */
  741|      0|		*size_r = 0;
  742|       |		/* if we had already read until EOF, mark the stream again as
  743|       |		   not being at the end of file. */
  744|      0|		if (stream->stream_errno == 0) {
  ------------------
  |  Branch (744:7): [True: 0, False: 0]
  ------------------
  745|      0|			_stream->skip = _stream->pos = 0;
  746|      0|			stream->eof = FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  747|      0|		}
  748|      0|		return uchar_empty_ptr;
  749|      0|	}
  750|       |
  751|   227k|        *size_r = _stream->pos - _stream->skip;
  752|   227k|        return _stream->buffer + _stream->skip;
  753|   227k|}
i_stream_get_data_size:
  756|   122k|{
  757|   122k|	size_t size;
  758|       |
  759|   122k|	(void)i_stream_get_data(stream, &size);
  760|   122k|	return size;
  761|   122k|}
i_stream_read_data:
  779|   146k|{
  780|   146k|	ssize_t ret = 0;
  781|   146k|	bool read_more = FALSE;
  ------------------
  |  |   11|   146k|#  define FALSE (!1)
  ------------------
  782|       |
  783|   159k|	do {
  784|   159k|		*data_r = i_stream_get_data(stream, size_r);
  785|   159k|		if (*size_r > threshold)
  ------------------
  |  Branch (785:7): [True: 131k, False: 28.2k]
  ------------------
  786|   131k|			return 1;
  787|       |
  788|       |		/* we need more data */
  789|  28.2k|		ret = i_stream_read(stream);
  790|  28.2k|		if (ret > 0)
  ------------------
  |  Branch (790:7): [True: 13.3k, False: 14.8k]
  ------------------
  791|  13.3k|			read_more = TRUE;
  ------------------
  |  |   15|  13.3k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  13.3k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  792|  28.2k|	} while (ret > 0);
  ------------------
  |  Branch (792:11): [True: 13.3k, False: 14.8k]
  ------------------
  793|       |
  794|  14.8k|	*data_r = i_stream_get_data(stream, size_r);
  795|  14.8k|	if (ret == -2)
  ------------------
  |  Branch (795:6): [True: 0, False: 14.8k]
  ------------------
  796|      0|		return -2;
  797|       |
  798|  14.8k|	if (ret == 0) {
  ------------------
  |  Branch (798:6): [True: 163, False: 14.7k]
  ------------------
  799|       |		/* need to read more */
  800|    163|		i_assert(!stream->blocking);
  ------------------
  |  |  219|    163|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    163|#  define STMT_START do
  |  |  ------------------
  |  |  220|    163|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    163|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 163]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 163]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    163|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    163|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    163|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  801|    163|		return 0;
  802|    163|	}
  803|  14.7k|	if (stream->stream_errno == 0 && read_more) {
  ------------------
  |  Branch (803:6): [True: 14.4k, False: 246]
  |  Branch (803:35): [True: 0, False: 14.4k]
  ------------------
  804|       |		/* we read at least some new data */
  805|      0|		return 0;
  806|      0|	}
  807|  14.7k|	return -1;
  808|  14.7k|}
i_stream_compress:
  832|  12.6k|{
  833|  12.6k|	i_assert(stream->memarea == NULL ||
  ------------------
  |  |  219|  12.6k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  12.6k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  12.6k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  25.2k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 12.6k]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 12.6k]
  |  |  |  |  |  Branch (202:45): [True: 12.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  12.6k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  12.6k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.6k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  834|  12.6k|		 memarea_get_refcount(stream->memarea) == 1);
  835|       |
  836|  12.6k|	if (stream->skip != stream->pos) {
  ------------------
  |  Branch (836:6): [True: 1.08k, False: 11.5k]
  ------------------
  837|  1.08k|		memmove(stream->w_buffer, stream->w_buffer + stream->skip,
  838|  1.08k|			stream->pos - stream->skip);
  839|  1.08k|	}
  840|  12.6k|	stream->pos -= stream->skip;
  841|       |
  842|  12.6k|	stream->skip = 0;
  843|  12.6k|}
i_stream_grow_buffer:
  880|  7.74k|{
  881|  7.74k|	size_t old_size, max_size;
  882|       |
  883|  7.74k|	old_size = stream->buffer_size;
  884|       |
  885|  7.74k|	stream->buffer_size = stream->pos + bytes;
  886|  7.74k|	if (stream->buffer_size <= stream->init_buffer_size)
  ------------------
  |  Branch (886:6): [True: 7.74k, False: 0]
  ------------------
  887|  7.74k|		stream->buffer_size = stream->init_buffer_size;
  888|      0|	else
  889|      0|		stream->buffer_size = nearest_power(stream->buffer_size);
  890|       |
  891|  7.74k|	max_size = i_stream_get_max_buffer_size(&stream->istream);
  892|  7.74k|	i_assert(max_size > 0);
  ------------------
  |  |  219|  7.74k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  7.74k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  7.74k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  7.74k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 7.74k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 7.74k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  7.74k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  7.74k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  7.74k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  893|  7.74k|	if (stream->buffer_size > max_size)
  ------------------
  |  Branch (893:6): [True: 0, False: 7.74k]
  ------------------
  894|      0|		stream->buffer_size = max_size;
  895|       |
  896|  7.74k|	if (stream->buffer_size <= old_size)
  ------------------
  |  Branch (896:6): [True: 0, False: 7.74k]
  ------------------
  897|      0|		stream->buffer_size = old_size;
  898|  7.74k|	else
  899|  7.74k|		i_stream_w_buffer_realloc(stream, old_size);
  900|  7.74k|}
i_stream_try_alloc:
  904|  27.5k|{
  905|  27.5k|	i_assert(wanted_size > 0);
  ------------------
  |  |  219|  27.5k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  27.5k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  27.5k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  27.5k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 27.5k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 27.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  27.5k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  27.5k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  27.5k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  906|  27.5k|	i_assert(stream->buffer_size >= stream->pos);
  ------------------
  |  |  219|  27.5k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  27.5k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  27.5k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  27.5k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 27.5k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 27.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  27.5k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  27.5k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  27.5k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  907|       |
  908|  27.5k|	if (wanted_size > stream->buffer_size - stream->pos) {
  ------------------
  |  Branch (908:6): [True: 20.3k, False: 7.13k]
  ------------------
  909|  20.3k|		if (stream->skip > 0) {
  ------------------
  |  Branch (909:7): [True: 12.6k, False: 7.74k]
  ------------------
  910|       |			/* remove the unused bytes from beginning of buffer */
  911|  12.6k|			if (stream->memarea != NULL &&
  ------------------
  |  Branch (911:8): [True: 12.6k, False: 0]
  ------------------
  912|  12.6k|			    memarea_get_refcount(stream->memarea) > 1) {
  ------------------
  |  Branch (912:8): [True: 1.08k, False: 11.5k]
  ------------------
  913|       |				/* The memarea is still referenced. We can't
  914|       |				   overwrite data until extra references are
  915|       |				   gone. */
  916|  1.08k|				i_stream_w_buffer_realloc(stream, stream->buffer_size);
  917|  1.08k|			}
  918|  12.6k|			i_stream_compress(stream);
  919|  12.6k|		} else if (stream->buffer_size < i_stream_get_max_buffer_size(&stream->istream)) {
  ------------------
  |  Branch (919:14): [True: 7.74k, False: 0]
  ------------------
  920|       |			/* buffer is full - grow it */
  921|  7.74k|			i_stream_grow_buffer(stream, I_STREAM_MIN_SIZE);
  ------------------
  |  |    7|  7.74k|#define I_STREAM_MIN_SIZE IO_BLOCK_SIZE
  |  |  ------------------
  |  |  |  |  169|  7.74k|#  define IO_BLOCK_SIZE 8192
  |  |  ------------------
  ------------------
  922|  7.74k|		}
  923|  20.3k|	}
  924|       |
  925|  27.5k|	if (stream->data_limit == 0 ||
  ------------------
  |  Branch (925:6): [True: 27.5k, False: 0]
  ------------------
  926|  27.5k|	    (stream->buffer_size - stream->skip) < stream->data_limit)
  ------------------
  |  Branch (926:6): [True: 0, False: 0]
  ------------------
  927|  27.5k|		*size_r = stream->buffer_size - stream->pos;
  928|      0|	else {
  929|      0|		size_t buffered = (stream->pos - stream->skip);
  930|       |
  931|      0|		if (buffered >= stream->data_limit)
  ------------------
  |  Branch (931:7): [True: 0, False: 0]
  ------------------
  932|      0|			*size_r = 0;
  933|      0|		else
  934|      0|			*size_r = stream->data_limit - buffered;
  935|      0|	}
  936|  27.5k|	i_assert(stream->w_buffer != NULL || *size_r == 0);
  ------------------
  |  |  219|  27.5k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  27.5k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  27.5k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  27.5k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 27.5k]
  |  |  |  |  |  Branch (202:45): [True: 27.5k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  27.5k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  27.5k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  27.5k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  937|  27.5k|	return *size_r > 0;
  938|  27.5k|}
i_stream_get_root_io:
 1002|   120k|{
 1003|   139k|	while (stream->real_stream->parent != NULL) {
  ------------------
  |  Branch (1003:9): [True: 18.8k, False: 120k]
  ------------------
 1004|  18.8k|		i_assert(stream->real_stream->io == NULL);
  ------------------
  |  |  219|  18.8k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  18.8k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  18.8k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  18.8k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 18.8k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 18.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  18.8k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  18.8k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  18.8k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1005|  18.8k|		stream = stream->real_stream->parent;
 1006|  18.8k|	}
 1007|   120k|	return stream;
 1008|   120k|}
i_stream_set_input_pending:
 1011|  9.46k|{
 1012|  9.46k|	if (!pending)
  ------------------
  |  Branch (1012:6): [True: 0, False: 9.46k]
  ------------------
 1013|      0|		return;
 1014|       |
 1015|  9.46k|	stream = i_stream_get_root_io(stream);
 1016|  9.46k|	if (stream->real_stream->io != NULL)
  ------------------
  |  Branch (1016:6): [True: 0, False: 9.46k]
  ------------------
 1017|      0|		io_set_pending(stream->real_stream->io);
 1018|  9.46k|	else
 1019|  9.46k|		stream->real_stream->io_pending = TRUE;
  ------------------
  |  |   15|  9.46k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  9.46k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1020|  9.46k|}
i_stream_switch_ioloop_to:
 1023|  6.21k|{
 1024|  6.21k|	io_stream_switch_ioloop_to(&stream->real_stream->iostream, ioloop);
 1025|       |
 1026|  6.21k|	do {
 1027|  6.21k|		if (stream->real_stream->switch_ioloop_to != NULL) {
  ------------------
  |  Branch (1027:7): [True: 0, False: 6.21k]
  ------------------
 1028|      0|			stream->real_stream->switch_ioloop_to(
 1029|      0|				stream->real_stream, ioloop);
 1030|      0|		}
 1031|  6.21k|		stream = stream->real_stream->parent;
 1032|  6.21k|	} while (stream != NULL);
  ------------------
  |  Branch (1032:11): [True: 0, False: 6.21k]
  ------------------
 1033|  6.21k|}
i_stream_set_io:
 1041|  55.3k|{
 1042|  55.3k|	stream = i_stream_get_root_io(stream);
 1043|       |
 1044|  55.3k|	i_assert(stream->real_stream->io == NULL);
  ------------------
  |  |  219|  55.3k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  55.3k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  55.3k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  55.3k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 55.3k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 55.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  55.3k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  55.3k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  55.3k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1045|  55.3k|	stream->real_stream->io = io;
 1046|  55.3k|	if (stream->real_stream->io_pending) {
  ------------------
  |  Branch (1046:6): [True: 23.1k, False: 32.2k]
  ------------------
 1047|  23.1k|		io_set_pending(io);
 1048|  23.1k|		stream->real_stream->io_pending = FALSE;
  ------------------
  |  |   11|  23.1k|#  define FALSE (!1)
  ------------------
 1049|  23.1k|	}
 1050|  55.3k|}
i_stream_unset_io:
 1053|  55.3k|{
 1054|  55.3k|	stream = i_stream_get_root_io(stream);
 1055|       |
 1056|  55.3k|	i_assert(stream->real_stream->io == io);
  ------------------
  |  |  219|  55.3k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  55.3k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  55.3k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  55.3k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 55.3k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 55.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  55.3k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  55.3k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  55.3k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1057|  55.3k|	if (io_is_pending(io))
  ------------------
  |  Branch (1057:6): [True: 21.3k, False: 33.9k]
  ------------------
 1058|  21.3k|		stream->real_stream->io_pending = TRUE;
  ------------------
  |  |   15|  21.3k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  21.3k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1059|  55.3k|	stream->real_stream->io = NULL;
 1060|  55.3k|}
i_stream_init_parent:
 1231|  28.7k|{
 1232|  28.7k|	_stream->access_counter = parent->real_stream->access_counter;
 1233|  28.7k|	_stream->parent = parent;
 1234|  28.7k|	_stream->parent_start_offset = parent->v_offset;
 1235|  28.7k|	_stream->parent_expected_offset = parent->v_offset;
 1236|  28.7k|	_stream->start_offset = parent->v_offset;
 1237|       |	/* if parent stream is an istream-error, copy the error */
 1238|  28.7k|	_stream->istream.stream_errno = parent->stream_errno;
 1239|  28.7k|	_stream->istream.eof = parent->eof;
 1240|  28.7k|	i_stream_ref(parent);
 1241|  28.7k|}
i_stream_create:
 1246|  45.2k|{
 1247|  45.2k|	bool noop_snapshot = (flags & ISTREAM_CREATE_FLAG_NOOP_SNAPSHOT) != 0;
 1248|       |
 1249|  45.2k|	_stream->fd = fd;
 1250|  45.2k|	if (parent != NULL)
  ------------------
  |  Branch (1250:6): [True: 28.7k, False: 16.4k]
  ------------------
 1251|  28.7k|		i_stream_init_parent(_stream, parent);
 1252|  16.4k|	else if (_stream->memarea == NULL && !noop_snapshot) {
  ------------------
  |  Branch (1252:11): [True: 16.4k, False: 0]
  |  Branch (1252:39): [True: 10.2k, False: 6.21k]
  ------------------
 1253|       |		/* The stream has no parent and no memarea yet. We'll assume
 1254|       |		   that it wants to be using memareas for the reads. */
 1255|  10.2k|		_stream->memarea = memarea_init_empty();
 1256|  10.2k|	}
 1257|  45.2k|	_stream->istream.real_stream = _stream;
 1258|       |
 1259|  45.2k|	if (_stream->iostream.close == NULL)
  ------------------
  |  Branch (1259:6): [True: 36.4k, False: 8.82k]
  ------------------
 1260|  36.4k|		_stream->iostream.close = i_stream_default_close;
 1261|  45.2k|	if (_stream->iostream.destroy == NULL)
  ------------------
  |  Branch (1261:6): [True: 15.4k, False: 29.8k]
  ------------------
 1262|  15.4k|		_stream->iostream.destroy = i_stream_default_destroy;
 1263|  45.2k|	if (_stream->seek == NULL) {
  ------------------
  |  Branch (1263:6): [True: 32.8k, False: 12.4k]
  ------------------
 1264|  32.8k|		_stream->seek = _stream->istream.seekable ?
  ------------------
  |  Branch (1264:19): [True: 1.44k, False: 31.3k]
  ------------------
 1265|  1.44k|			i_stream_default_seek_seekable :
 1266|  32.8k|			i_stream_default_seek_nonseekable;
 1267|  32.8k|	}
 1268|  45.2k|	if (_stream->stat == NULL)
  ------------------
  |  Branch (1268:6): [True: 13.3k, False: 31.8k]
  ------------------
 1269|  13.3k|		_stream->stat = i_stream_default_stat;
 1270|  45.2k|	if (_stream->get_size == NULL)
  ------------------
  |  Branch (1270:6): [True: 32.4k, False: 12.8k]
  ------------------
 1271|  32.4k|		_stream->get_size = i_stream_default_get_size;
 1272|  45.2k|	if (_stream->snapshot == NULL) {
  ------------------
  |  Branch (1272:6): [True: 42.6k, False: 2.61k]
  ------------------
 1273|  42.6k|		_stream->snapshot = noop_snapshot ?
  ------------------
  |  Branch (1273:23): [True: 6.21k, False: 36.4k]
  ------------------
 1274|  6.21k|			i_stream_noop_snapshot :
 1275|  42.6k|			i_stream_default_snapshot;
 1276|  42.6k|	}
 1277|  45.2k|	if (_stream->iostream.set_max_buffer_size == NULL) {
  ------------------
  |  Branch (1277:6): [True: 42.6k, False: 2.61k]
  ------------------
 1278|  42.6k|		_stream->iostream.set_max_buffer_size =
 1279|  42.6k|			i_stream_default_set_max_buffer_size;
 1280|  42.6k|	}
 1281|  45.2k|	if (_stream->init_buffer_size == 0)
  ------------------
  |  Branch (1281:6): [True: 45.2k, False: 0]
  ------------------
 1282|  45.2k|		_stream->init_buffer_size = I_STREAM_MIN_SIZE;
  ------------------
  |  |    7|  45.2k|#define I_STREAM_MIN_SIZE IO_BLOCK_SIZE
  |  |  ------------------
  |  |  |  |  169|  45.2k|#  define IO_BLOCK_SIZE 8192
  |  |  ------------------
  ------------------
 1283|       |
 1284|  45.2k|	i_zero(&_stream->statbuf);
  ------------------
  |  |  249|  45.2k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  45.2k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  45.2k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1285|  45.2k|	_stream->statbuf.st_size = -1;
 1286|  45.2k|	_stream->statbuf.st_atime =
 1287|  45.2k|		_stream->statbuf.st_mtime =
 1288|  45.2k|		_stream->statbuf.st_ctime = ioloop_time;
 1289|  45.2k|	_stream->cached_stream_size = UOFF_T_MAX;
  ------------------
  |  |  846|  45.2k|#define UOFF_T_MAX ULONG_MAX
  ------------------
 1290|       |
 1291|  45.2k|	io_stream_init(&_stream->iostream);
 1292|       |
 1293|  45.2k|	if (_stream->istream.stream_errno != 0)
  ------------------
  |  Branch (1293:6): [True: 1.44k, False: 43.8k]
  ------------------
 1294|  1.44k|		_stream->istream.eof = TRUE;
  ------------------
  |  |   15|  1.44k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  1.44k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1295|       |
 1296|  45.2k|	return &_stream->istream;
 1297|  45.2k|}
i_stream_create_error:
 1300|  1.44k|{
 1301|  1.44k|	struct istream_private *stream;
 1302|       |
 1303|  1.44k|	stream = i_new(struct istream_private, 1);
  ------------------
  |  |    8|  1.44k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  1.44k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  1.44k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  1.44k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  1.44k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  1.44k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1304|  1.44k|	stream->istream.closed = TRUE;
  ------------------
  |  |   15|  1.44k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  1.44k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1305|  1.44k|	stream->istream.readable_fd = FALSE;
  ------------------
  |  |   11|  1.44k|#  define FALSE (!1)
  ------------------
 1306|  1.44k|	stream->istream.blocking = TRUE;
  ------------------
  |  |   15|  1.44k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  1.44k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1307|  1.44k|	stream->istream.seekable = TRUE;
  ------------------
  |  |   15|  1.44k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  1.44k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1308|  1.44k|	stream->istream.eof = TRUE;
  ------------------
  |  |   15|  1.44k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  1.44k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1309|  1.44k|	stream->istream.stream_errno = stream_errno;
 1310|       |	/* Nothing can ever actually be read from this stream, but set a
 1311|       |	   reasonable max_buffer_size anyway since some filter istreams don't
 1312|       |	   behave properly otherwise. */
 1313|  1.44k|	stream->max_buffer_size = IO_BLOCK_SIZE;
  ------------------
  |  |  169|  1.44k|#  define IO_BLOCK_SIZE 8192
  ------------------
 1314|  1.44k|	i_stream_create(stream, NULL, -1, 0);
 1315|  1.44k|	i_stream_set_name(&stream->istream, "(error)");
 1316|  1.44k|	return &stream->istream;
 1317|  1.44k|}
i_stream_create_error_str:
 1321|  1.44k|{
 1322|  1.44k|	struct istream *input;
 1323|  1.44k|	va_list args;
 1324|       |
 1325|  1.44k|	va_start(args, fmt);
 1326|  1.44k|	input = i_stream_create_error(stream_errno);
 1327|  1.44k|	io_stream_set_verror(&input->real_stream->iostream, fmt, args);
 1328|  1.44k|	va_end(args);
 1329|  1.44k|	return input;
 1330|  1.44k|}
istream.c:i_stream_close_full:
   30|  16.5k|{
   31|  16.5k|	io_stream_close(&stream->real_stream->iostream, close_parents);
   32|  16.5k|	stream->closed = TRUE;
  ------------------
  |  |   15|  16.5k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  16.5k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   33|       |
   34|  16.5k|	if (stream->stream_errno == 0)
  ------------------
  |  Branch (34:6): [True: 9.77k, False: 6.82k]
  ------------------
   35|  9.77k|		stream->stream_errno = EPIPE;
   36|  16.5k|}
istream.c:snapshot_has_memarea:
  215|     39|{
  216|     39|	if (snapshot->old_memarea == memarea)
  ------------------
  |  Branch (216:6): [True: 38, False: 1]
  ------------------
  217|     38|		return TRUE;
  ------------------
  |  |   15|     38|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|     38|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  218|      1|	if (snapshot->prev_snapshot != NULL)
  ------------------
  |  Branch (218:6): [True: 0, False: 1]
  ------------------
  219|      0|		return snapshot_has_memarea(snapshot->prev_snapshot, memarea);
  220|      1|	return FALSE;
  ------------------
  |  |   11|      1|#  define FALSE (!1)
  ------------------
  221|      1|}
istream.c:i_stream_update:
  203|   216k|{
  204|   216k|	if (stream->parent == NULL)
  ------------------
  |  Branch (204:6): [True: 101k, False: 115k]
  ------------------
  205|   101k|		stream->access_counter++;
  206|   115k|	else {
  207|   115k|		stream->access_counter =
  208|   115k|			stream->parent->real_stream->access_counter;
  209|   115k|		stream->parent_expected_offset = stream->parent->v_offset;
  210|   115k|	}
  211|   216k|}
istream.c:i_stream_can_optimize_seek:
  495|   163k|{
  496|   163k|	if (stream->parent == NULL)
  ------------------
  |  Branch (496:6): [True: 109k, False: 53.6k]
  ------------------
  497|   109k|		return TRUE;
  ------------------
  |  |   15|   109k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   109k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  498|       |
  499|       |	/* use the fast route only if the parent stream hasn't been changed */
  500|  53.6k|	if (stream->access_counter !=
  ------------------
  |  Branch (500:6): [True: 0, False: 53.6k]
  ------------------
  501|  53.6k|	    stream->parent->real_stream->access_counter)
  502|      0|		return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  503|       |
  504|  53.6k|	return i_stream_can_optimize_seek(stream->parent->real_stream);
  505|  53.6k|}
istream.c:i_stream_is_buffer_invalid:
  697|   439k|{
  698|   439k|	if (stream->parent == NULL) {
  ------------------
  |  Branch (698:6): [True: 315k, False: 124k]
  ------------------
  699|       |		/* the buffer can't point to parent, because it doesn't exist */
  700|   315k|		return FALSE;
  ------------------
  |  |   11|   315k|#  define FALSE (!1)
  ------------------
  701|   315k|	}
  702|   124k|	if (stream->w_buffer != NULL) {
  ------------------
  |  Branch (702:6): [True: 14.6k, False: 109k]
  ------------------
  703|       |		/* we can pretty safely assume that the stream is using its
  704|       |		   own private buffer, so it can never become invalid. */
  705|  14.6k|		return FALSE;
  ------------------
  |  |   11|  14.6k|#  define FALSE (!1)
  ------------------
  706|  14.6k|	}
  707|   109k|	if (stream->access_counter !=
  ------------------
  |  Branch (707:6): [True: 0, False: 109k]
  ------------------
  708|   109k|	    stream->parent->real_stream->access_counter) {
  709|       |		/* parent has been modified behind this stream, we can't trust
  710|       |		   that our buffer is valid */
  711|      0|		return TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  712|      0|	}
  713|   109k|	return i_stream_is_buffer_invalid(stream->parent->real_stream);
  714|   109k|}
istream.c:i_stream_w_buffer_realloc:
  852|  8.82k|{
  853|  8.82k|	void *new_buffer;
  854|       |
  855|  8.82k|	if (stream->memarea != NULL &&
  ------------------
  |  Branch (855:6): [True: 7.29k, False: 1.53k]
  ------------------
  856|  8.82k|	    memarea_get_refcount(stream->memarea) == 1) {
  ------------------
  |  Branch (856:6): [True: 0, False: 7.29k]
  ------------------
  857|       |		/* Nobody else is referencing the memarea.
  858|       |		   We can just reallocate it. */
  859|      0|		memarea_free_without_callback(&stream->memarea);
  860|      0|		new_buffer = i_realloc(stream->w_buffer, old_size,
  861|      0|				       stream->buffer_size);
  862|  8.82k|	} else {
  863|  8.82k|		new_buffer = i_malloc(stream->buffer_size);
  864|  8.82k|		if (old_size > 0) {
  ------------------
  |  Branch (864:7): [True: 1.08k, False: 7.74k]
  ------------------
  865|  1.08k|			i_assert(stream->w_buffer != NULL);
  ------------------
  |  |  219|  1.08k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  1.08k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  1.08k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  1.08k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1.08k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  1.08k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  1.08k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.08k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  866|  1.08k|			memcpy(new_buffer, stream->w_buffer, old_size);
  ------------------
  |  |   84|  1.08k|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
  867|  1.08k|		}
  868|  8.82k|		if (stream->memarea != NULL)
  ------------------
  |  Branch (868:7): [True: 7.29k, False: 1.53k]
  ------------------
  869|  7.29k|			memarea_unref(&stream->memarea);
  870|  8.82k|	}
  871|       |
  872|  8.82k|	stream->w_buffer = new_buffer;
  873|  8.82k|	stream->buffer = new_buffer;
  874|       |
  875|  8.82k|	stream->memarea = memarea_init(stream->w_buffer, stream->buffer_size,
  ------------------
  |  |   12|  8.82k|	memarea_init(data, size - \
  |  |   13|  8.82k|		CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
  |  |  ------------------
  |  |  |  |  171|  8.82k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  8.82k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  8.82k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  8.82k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |   14|  8.82k|		(memarea_free_callback_t *)callback, context)
  ------------------
  876|  8.82k|				       i_stream_w_buffer_free, new_buffer);
  877|  8.82k|}
istream.c:i_stream_w_buffer_free:
  846|  8.82k|{
  847|  8.82k|	i_free(buf);
  ------------------
  |  |   19|  8.82k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  8.82k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  8.82k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  8.82k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  8.82k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  8.82k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  8.82k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  8.82k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  848|  8.82k|}
istream.c:i_stream_default_close:
 1076|  37.9k|{
 1077|  37.9k|	struct istream_private *_stream =
 1078|  37.9k|		container_of(stream, struct istream_private, iostream);
  ------------------
  |  |   30|  37.9k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  37.9k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  37.9k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  37.9k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  37.9k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  37.9k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
 1079|       |
 1080|  37.9k|	if (close_parent)
  ------------------
  |  Branch (1080:6): [True: 0, False: 37.9k]
  ------------------
 1081|      0|		i_stream_close(_stream->parent);
 1082|  37.9k|}
istream.c:i_stream_default_destroy:
 1085|  15.4k|{
 1086|  15.4k|	struct istream_private *_stream =
 1087|  15.4k|		container_of(stream, struct istream_private, iostream);
  ------------------
  |  |   30|  15.4k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  15.4k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  15.4k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  15.4k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  15.4k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  15.4k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
 1088|       |
 1089|  15.4k|	i_stream_free_buffer(_stream);
 1090|  15.4k|	i_stream_unref(&_stream->parent);
 1091|  15.4k|}
istream.c:i_stream_default_set_max_buffer_size:
 1065|  28.2k|{
 1066|  28.2k|	struct istream_private *_stream =
 1067|  28.2k|		container_of(stream, struct istream_private, iostream);
  ------------------
  |  |   30|  28.2k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  28.2k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  28.2k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  28.2k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  28.2k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  28.2k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
 1068|       |
 1069|  28.2k|	_stream->max_buffer_size = max_size;
 1070|  28.2k|	if (_stream->parent != NULL)
  ------------------
  |  Branch (1070:6): [True: 18.8k, False: 9.46k]
  ------------------
 1071|  18.8k|		i_stream_set_max_buffer_size(_stream->parent, max_size);
 1072|  28.2k|}

ostream.c:i_stream_read_more:
  231|  12.9k|{
  232|  12.9k|	int ret = i_stream_read_bytes(stream, data_r, size_r, 1);
  233|  12.9k|	i_assert(ret != -2); /* stream must have space for at least 1 byte */
  ------------------
  |  |  219|  12.9k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  12.9k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  12.9k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  12.9k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 12.9k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 12.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  12.9k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  12.9k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.9k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  234|  12.9k|	return ret;
  235|  12.9k|}
ostream.c:i_stream_read_bytes:
  223|  12.9k|{
  224|  12.9k|	i_assert(wanted > 0);
  ------------------
  |  |  219|  12.9k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  12.9k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  12.9k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  12.9k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 12.9k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 12.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  12.9k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  12.9k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.9k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  225|  12.9k|	return i_stream_read_data(stream, data_r, size_r, wanted - 1);
  226|  12.9k|}

event-log.c:event_recalculate_debug_level:
  110|  12.4k|{
  111|  12.4k|	event->debug_level_checked_filter_counter =
  112|  12.4k|		event_filter_replace_counter - 1;
  113|  12.4k|}
lib-event.c:event_recalculate_debug_level:
  110|  6.21k|{
  111|  6.21k|	event->debug_level_checked_filter_counter =
  112|  6.21k|		event_filter_replace_counter - 1;
  113|  6.21k|}

event_create:
  433|   522k|{
  434|   522k|	struct event *event;
  435|       |
  436|   522k|	event = event_create_internal(parent, source_filename, source_linenum);
  437|   522k|	(void)event_call_callbacks_noargs(event, EVENT_CALLBACK_TYPE_CREATE);
  438|   522k|	return event;
  439|   522k|}
event_create_passthrough:
  445|   253k|{
  446|   253k|	if (!parent->passthrough) {
  ------------------
  |  Branch (446:6): [True: 253k, False: 0]
  ------------------
  447|   253k|		if (event_last_passthrough != NULL) {
  ------------------
  |  Branch (447:7): [True: 0, False: 253k]
  ------------------
  448|       |			/* API is being used in a wrong or dangerous way */
  449|      0|			i_panic("Can't create multiple passthrough events - "
  450|      0|				"finish the earlier with ->event()");
  451|      0|		}
  452|   253k|		struct event *event =
  453|   253k|			event_create(parent, source_filename, source_linenum);
  454|   253k|		event->passthrough = TRUE;
  ------------------
  |  |   15|   253k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   253k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  455|       |		/* This event only intends to extend the parent event.
  456|       |		   Use the parent's creation timestamp. */
  457|   253k|		event->tv_created_ioloop = parent->tv_created_ioloop;
  458|   253k|		event->tv_created = parent->tv_created;
  459|   253k|		memcpy(&event->ru_last, &parent->ru_last, sizeof(parent->ru_last));
  ------------------
  |  |   84|   253k|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
  460|   253k|		event_last_passthrough = event;
  461|   253k|	} else {
  462|      0|		event_last_passthrough = parent;
  463|      0|	}
  464|   253k|	return &event_passthrough_vfuncs;
  465|   253k|}
event_ref:
  468|   515k|{
  469|   515k|	i_assert(event->refcount > 0);
  ------------------
  |  |  219|   515k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   515k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   515k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   515k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 515k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 515k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   515k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   515k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   515k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  470|       |
  471|   515k|	event->refcount++;
  472|   515k|	return event;
  473|   515k|}
event_unref:
  476|  1.05M|{
  477|  1.05M|	struct event *event = *_event;
  478|       |
  479|  1.05M|	if (event == NULL)
  ------------------
  |  Branch (479:6): [True: 12.4k, False: 1.03M]
  ------------------
  480|  12.4k|		return;
  481|  1.03M|	*_event = NULL;
  482|       |
  483|  1.03M|	i_assert(event->refcount > 0);
  ------------------
  |  |  219|  1.03M|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  1.03M|#  define STMT_START do
  |  |  ------------------
  |  |  220|  1.03M|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  1.03M|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1.03M]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1.03M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  1.03M|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  1.03M|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.03M|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  484|  1.03M|	if (--event->refcount > 0)
  ------------------
  |  Branch (484:6): [True: 515k, False: 522k]
  ------------------
  485|   515k|		return;
  486|  1.03M|	i_assert(event != current_global_event);
  ------------------
  |  |  219|   522k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   522k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   522k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   522k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 522k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 522k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   522k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  1.03M|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.03M|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  487|       |
  488|   522k|	event_call_callbacks_noargs(event, EVENT_CALLBACK_TYPE_FREE);
  489|       |
  490|   522k|	if (event_last_passthrough == event)
  ------------------
  |  Branch (490:6): [True: 0, False: 522k]
  ------------------
  491|      0|		event_last_passthrough = NULL;
  492|   522k|	if (event->log_prefix_from_system_pool)
  ------------------
  |  Branch (492:6): [True: 2.71k, False: 519k]
  ------------------
  493|   522k|		i_free(event->log_prefix);
  ------------------
  |  |   19|   522k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|   522k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  2.71k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.71k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  2.71k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  2.71k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  2.71k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  2.71k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  494|   522k|	i_free(event->sending_name);
  ------------------
  |  |   19|   522k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|   522k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|   522k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   522k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|   522k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|   522k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|   522k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|   522k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  495|   522k|	event_unref(&event->parent);
  496|       |
  497|   522k|	DLLIST_REMOVE(&events, event);
  ------------------
  |  |   28|   522k|	DLLIST_REMOVE_FULL(list, item, prev, next)
  |  |  ------------------
  |  |  |  |   15|   522k|#define DLLIST_REMOVE_FULL(list, item, prev, next) STMT_START { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   522k|#  define STMT_START do
  |  |  |  |  ------------------
  |  |  |  |   16|   522k|	if ((item)->prev != NULL) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (16:6): [True: 206k, False: 315k]
  |  |  |  |  ------------------
  |  |  |  |   17|   522k|		(item)->prev->next = (item)->next; \
  |  |  |  |   18|   522k|	else if ((*list) == item) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:11): [True: 315k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   19|   315k|		*(list) = (item)->next; \
  |  |  |  |   20|   522k|	if ((item)->next != NULL) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (20:6): [True: 516k, False: 5.27k]
  |  |  |  |  ------------------
  |  |  |  |   21|   516k|		(item)->next->prev = (item)->prev; \
  |  |  |  |   22|   516k|		(item)->next = NULL; \
  |  |  |  |   23|   516k|	} \
  |  |  |  |   24|   522k|	(item)->prev = NULL; \
  |  |  |  |   25|   522k|	} STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   522k|#  define STMT_END while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  498|   522k|	pool_unref(&event->pool);
  499|   522k|}
event_get_global:
  544|  13.0k|{
  545|  13.0k|	return current_global_event;
  546|  13.0k|}
event_reason_end:
  564|  25.6k|{
  565|  25.6k|	struct event_reason *reason = *_reason;
  566|       |
  567|  25.6k|	if (reason == NULL)
  ------------------
  |  Branch (567:6): [True: 25.6k, False: 0]
  ------------------
  568|  25.6k|		return;
  569|      0|	event_pop_global(reason->event);
  570|       |	/* This event was created only for global use. It shouldn't be
  571|       |	   permanently stored anywhere. This assert could help catch bugs. */
  572|      0|	i_assert(reason->event->refcount == 1);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  573|      0|	event_unref(&reason->event);
  574|      0|	i_free(reason);
  ------------------
  |  |   19|      0|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|      0|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|      0|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|      0|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|      0|		(mem) = NULL;			\
  |  |  |  |  |  |  134|      0|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  575|      0|}
event_set_append_log_prefix:
  659|   265k|{
  660|   265k|	return event_set_log_prefix(event, prefix, TRUE);
  ------------------
  |  |   15|   265k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   265k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  661|   265k|}
event_drop_parent_log_prefixes:
  670|  12.1k|{
  671|  12.1k|	event->log_prefixes_dropped = count;
  672|  12.1k|	return event;
  673|  12.1k|}
event_set_name:
  722|   253k|{
  723|   253k|	i_free(event->sending_name);
  ------------------
  |  |   19|   253k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|   253k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|   253k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   253k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|   253k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|   253k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|   253k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|   253k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  724|   253k|	event->sending_name = i_strdup(name);
  725|   253k|	return event;
  726|   253k|}
event_add_categories:
  925|  6.21k|{
  926|  6.21k|	struct event_category *representative;
  927|       |
  928|  6.21k|	if (!array_is_created(&event->categories))
  ------------------
  |  |  176|  6.21k|	array_is_created_i(&(array)->arr)
  ------------------
  |  Branch (928:6): [True: 6.21k, False: 0]
  ------------------
  929|  6.21k|		p_array_init(&event->categories, event->pool, 4);
  ------------------
  |  |   44|  6.21k|	array_create(array, pool, sizeof(**(array)->v), init_count)
  |  |  ------------------
  |  |  |  |  152|  6.21k|	array_create_i(&(array)->arr, pool, element_size, init_count)
  |  |  ------------------
  ------------------
  930|       |
  931|  12.4k|	for (unsigned int i = 0; categories[i] != NULL; i++) {
  ------------------
  |  Branch (931:27): [True: 6.21k, False: 6.21k]
  ------------------
  932|  6.21k|		representative = event_category_register(categories[i]);
  933|  6.21k|		if (!event_find_category(event, representative))
  ------------------
  |  Branch (933:7): [True: 6.21k, False: 0]
  ------------------
  934|  6.21k|			array_push_back(&event->categories, &representative);
  ------------------
  |  |  282|  6.21k|#define array_push_back(array, item) array_append(array, (item), 1)
  |  |  ------------------
  |  |  |  |  214|  6.21k|	TYPE_CHECKS(void, ARRAY_TYPE_CHECK(array, data), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  6.21k|	(FALSE ? (return_type)(checks) : (func))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (11:17): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:25): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  215|  6.21k|	array_append_i(&(array)->arr, data, count))
  |  |  ------------------
  ------------------
  935|  6.21k|	}
  936|  6.21k|	event_set_changed(event);
  937|  6.21k|	event_recalculate_debug_level(event);
  938|  6.21k|	return event;
  939|  6.21k|}
event_add_category:
  943|  6.21k|{
  944|  6.21k|	struct event_category *const categories[] = { category, NULL };
  945|  6.21k|	return event_add_categories(event, categories);
  946|  6.21k|}
event_find_field_nonrecursive:
  950|  1.17M|{
  951|  1.17M|	struct event_field *field;
  952|       |
  953|  1.17M|	if (!array_is_created(&event->fields))
  ------------------
  |  |  176|  1.17M|	array_is_created_i(&(array)->arr)
  ------------------
  |  Branch (953:6): [True: 414k, False: 764k]
  ------------------
  954|   414k|		return NULL;
  955|       |
  956|  1.46M|	array_foreach_modifiable(&event->fields, field) {
  ------------------
  |  |   87|   764k|	for (const void *elem ## _end = \
  |  |   88|   764k|		(const char *)(elem = ARRAY_TYPE_CAST_MODIFIABLE(array) \
  |  |  ------------------
  |  |  |  |   54|   764k|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  |  |   89|   764k|			buffer_get_modifiable_data((array)->arr.buffer, NULL)) + \
  |  |   90|   764k|			(array)->arr.buffer->used; \
  |  |   91|  2.21M|	     elem != elem ## _end; (elem)++)
  |  |  ------------------
  |  |  |  Branch (91:7): [True: 1.46M, False: 751k]
  |  |  ------------------
  ------------------
  957|  1.46M|		if (strcmp(field->key, key) == 0)
  ------------------
  |  Branch (957:7): [True: 12.5k, False: 1.45M]
  ------------------
  958|  12.5k|			return field;
  959|  1.46M|	}
  960|   751k|	return NULL;
  961|   764k|}
event_find_field_recursive:
  965|  13.0k|{
  966|  13.0k|	const struct event_field *field;
  967|       |
  968|  52.3k|	do {
  969|  52.3k|		if ((field = event_find_field_nonrecursive(event, key)) != NULL)
  ------------------
  |  Branch (969:7): [True: 0, False: 52.3k]
  ------------------
  970|      0|			return field;
  971|  52.3k|		event = event->parent;
  972|  52.3k|	} while (event != NULL);
  ------------------
  |  Branch (972:11): [True: 39.2k, False: 13.0k]
  ------------------
  973|       |
  974|       |	/* check also the global event and its parents */
  975|  13.0k|	event = event_get_global();
  976|  13.0k|	while (event != NULL) {
  ------------------
  |  Branch (976:9): [True: 0, False: 13.0k]
  ------------------
  977|      0|		if ((field = event_find_field_nonrecursive(event, key)) != NULL)
  ------------------
  |  Branch (977:7): [True: 0, False: 0]
  ------------------
  978|      0|			return field;
  979|      0|		event = event->parent;
  980|      0|	}
  981|  13.0k|	return NULL;
  982|  13.0k|}
event_add_str:
 1066|   705k|{
 1067|   705k|	struct event_field *field;
 1068|       |
 1069|   705k|	if (value == NULL) {
  ------------------
  |  Branch (1069:6): [True: 13.0k, False: 692k]
  ------------------
 1070|       |		/* Silently ignoring is perhaps better than assert-crashing?
 1071|       |		   However, if the field already exists, this should be the
 1072|       |		   same as event_field_clear() */
 1073|  13.0k|		if (event_find_field_recursive(event, key) == NULL)
  ------------------
  |  Branch (1073:7): [True: 13.0k, False: 0]
  ------------------
 1074|  13.0k|			return event;
 1075|      0|		value = "";
 1076|      0|	}
 1077|       |
 1078|   692k|	field = event_get_field(event, key, TRUE);
  ------------------
  |  |   15|   692k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   692k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1079|   692k|	field->value_type = EVENT_FIELD_VALUE_TYPE_STR;
 1080|   692k|	field->value.str = p_strdup(event->pool, value);
 1081|   692k|	return event;
 1082|   705k|}
event_add_int:
 1131|   433k|{
 1132|   433k|	struct event_field *field;
 1133|       |
 1134|   433k|	field = event_get_field(event, key, TRUE);
  ------------------
  |  |   15|   433k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   433k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1135|   433k|	field->value_type = EVENT_FIELD_VALUE_TYPE_INTMAX;
 1136|   433k|	field->value.intmax = num;
 1137|   433k|	return event;
 1138|   433k|}
event_send_abort:
 1368|  1.90M|{
 1369|       |	/* if the event is sent again, it needs a new name */
 1370|  1.90M|	i_free(event->sending_name);
  ------------------
  |  |   19|  1.90M|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  1.90M|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  1.90M|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.90M|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  1.90M|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  1.90M|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  1.90M|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  1.90M|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1371|  1.90M|	if (event->passthrough)
  ------------------
  |  Branch (1371:6): [True: 253k, False: 1.65M]
  ------------------
 1372|   253k|		event_unref(&event);
 1373|  1.90M|}
event_category_register_callback:
 1708|      1|{
 1709|      1|	array_push_back(&event_category_callbacks, &callback);
  ------------------
  |  |  282|      1|#define array_push_back(array, item) array_append(array, (item), 1)
  |  |  ------------------
  |  |  |  |  214|      1|	TYPE_CHECKS(void, ARRAY_TYPE_CHECK(array, data), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      1|	(FALSE ? (return_type)(checks) : (func))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      1|#  define FALSE (!1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (11:17): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:25): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  215|      1|	array_append_i(&(array)->arr, data, count))
  |  |  ------------------
  ------------------
 1710|      1|}
lib_event_init:
 1884|      1|{
 1885|      1|	i_array_init(&event_handlers, 4);
  ------------------
  |  |   46|      1|	p_array_init(array, default_pool, init_count)
  |  |  ------------------
  |  |  |  |   44|      1|	array_create(array, pool, sizeof(**(array)->v), init_count)
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      1|	array_create_i(&(array)->arr, pool, element_size, init_count)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1886|      1|	i_array_init(&event_category_callbacks, 4);
  ------------------
  |  |   46|      1|	p_array_init(array, default_pool, init_count)
  |  |  ------------------
  |  |  |  |   44|      1|	array_create(array, pool, sizeof(**(array)->v), init_count)
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      1|	array_create_i(&(array)->arr, pool, element_size, init_count)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1887|      1|	i_array_init(&event_registered_categories_internal, 16);
  ------------------
  |  |   46|      1|	p_array_init(array, default_pool, init_count)
  |  |  ------------------
  |  |  |  |   44|      1|	array_create(array, pool, sizeof(**(array)->v), init_count)
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      1|	array_create_i(&(array)->arr, pool, element_size, init_count)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1888|      1|	i_array_init(&event_registered_categories_representative, 16);
  ------------------
  |  |   46|      1|	p_array_init(array, default_pool, init_count)
  |  |  ------------------
  |  |  |  |   44|      1|	array_create(array, pool, sizeof(**(array)->v), init_count)
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      1|	array_create_i(&(array)->arr, pool, element_size, init_count)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1889|      1|}
lib-event.c:event_create_internal:
  407|   522k|{
  408|   522k|	struct event *event;
  409|   522k|	pool_t pool = pool_alloconly_create(MEMPOOL_GROWING"event", 1024);
  ------------------
  |  |   11|   522k|#define MEMPOOL_GROWING "GROWING-"
  ------------------
  410|       |
  411|   522k|	event = p_new(pool, struct event, 1);
  ------------------
  |  |   97|   522k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|   522k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|   522k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|   522k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|   522k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  412|   522k|	event->refcount = 1;
  413|   522k|	event->id = ++event_id_counter;
  414|   522k|	event->pool = pool;
  415|   522k|	event->tv_created_ioloop = ioloop_timeval;
  416|   522k|	event->min_log_level = LOG_TYPE_INFO;
  417|   522k|	i_gettimeofday(&event->tv_created);
  418|   522k|	event->source_filename = p_strdup(pool, source_filename);
  419|   522k|	event->source_linenum = source_linenum;
  420|   522k|	event->change_id = 1;
  421|   522k|	if (parent != NULL) {
  ------------------
  |  Branch (421:6): [True: 515k, False: 6.21k]
  ------------------
  422|   515k|		event->parent = parent;
  423|   515k|		event_ref(event->parent);
  424|   515k|		event_copy_parent_defaults(event, parent);
  425|   515k|	}
  426|   522k|	DLLIST_PREPEND(&events, event);
  ------------------
  |  |   13|   522k|	DLLIST_PREPEND_FULL(list, item, prev, next)
  |  |  ------------------
  |  |  |  |    5|   522k|#define DLLIST_PREPEND_FULL(list, item, prev, next) STMT_START { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   522k|#  define STMT_START do
  |  |  |  |  ------------------
  |  |  |  |    6|   522k|	(item)->prev = NULL; \
  |  |  |  |    7|   522k|	(item)->next = *(list); \
  |  |  |  |    8|   522k|	if (*(list) != NULL) (*(list))->prev = (item); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (8:6): [True: 516k, False: 5.27k]
  |  |  |  |  ------------------
  |  |  |  |    9|   522k|	*(list) = (item); \
  |  |  |  |   10|   522k|	} STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   522k|#  define STMT_END while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  427|   522k|	return event;
  428|   522k|}
lib-event.c:event_copy_parent_defaults:
  105|   515k|{
  106|   515k|	event->always_log_source = parent->always_log_source;
  107|   515k|	event->passthrough = parent->passthrough;
  108|   515k|	event->min_log_level = parent->min_log_level;
  109|   515k|	event->forced_debug = parent->forced_debug;
  110|   515k|	event->disable_callbacks = parent->disable_callbacks;
  111|   515k|}
lib-event.c:event_call_callbacks_noargs:
  153|  1.04M|{
  154|  1.04M|	va_list args;
  155|       |
  156|       |	/* the args are empty and not used for anything, but there doesn't seem
  157|       |	   to be any nice and standard way of passing an initialized va_list
  158|       |	   as a parameter without va_start(). */
  159|  1.04M|	va_start(args, type);
  160|  1.04M|	(void)event_call_callbacks(event, type, NULL, NULL, args);
  161|  1.04M|	va_end(args);
  162|  1.04M|}
lib-event.c:event_set_log_prefix:
  638|   265k|{
  639|   265k|	event->log_prefix_callback = NULL;
  640|   265k|	event->log_prefix_callback_context = NULL;
  641|   265k|	if (event->log_prefix == NULL) {
  ------------------
  |  Branch (641:6): [True: 262k, False: 2.71k]
  ------------------
  642|       |		/* allocate the first log prefix from the pool */
  643|   262k|		event->log_prefix = p_strdup(event->pool, prefix);
  644|   262k|	} else {
  645|       |		/* log prefix is being updated multiple times -
  646|       |		   switch to system pool so we don't keep leaking memory */
  647|  2.71k|		if (event->log_prefix_from_system_pool)
  ------------------
  |  Branch (647:7): [True: 0, False: 2.71k]
  ------------------
  648|  2.71k|			i_free(event->log_prefix);
  ------------------
  |  |   19|  2.71k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  2.71k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|      0|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|      0|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|      0|		(mem) = NULL;			\
  |  |  |  |  |  |  134|      0|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  649|  2.71k|		else
  650|  2.71k|			event->log_prefix_from_system_pool = TRUE;
  ------------------
  |  |   15|  2.71k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  2.71k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  651|  2.71k|		event->log_prefix = i_strdup(prefix);
  652|  2.71k|	}
  653|   265k|	event->log_prefix_replace = !append;
  654|   265k|	return event;
  655|   265k|}
lib-event.c:event_find_category:
  908|  6.21k|{
  909|  6.21k|	struct event_internal_category *internal = category->internal;
  910|  6.21k|	struct event_category *cat;
  911|       |
  912|       |	/* make sure we're always looking for a representative */
  913|  6.21k|	i_assert(category == &internal->representative);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  914|       |
  915|  6.21k|	array_foreach_elem(&event->categories, cat) {
  ------------------
  |  |  111|  6.21k|	for (const void *_foreach_end = \
  |  |  112|  6.21k|		CONST_PTR_OFFSET(*(array)->v, (array)->arr.buffer->used), \
  |  |  ------------------
  |  |  |  |   27|  6.21k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  |  |  113|  6.21k|	     *_foreach_ptr = CONST_PTR_OFFSET(*(array)->v, ARRAY_TYPE_CHECK(array, &elem) + \
  |  |  ------------------
  |  |  |  |   27|  24.8k|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  114|  6.21k|		COMPILE_ERROR_IF_TRUE(sizeof(elem) > sizeof(void *))) \
  |  |  115|  6.21k|		     ;							\
  |  |  116|  6.21k|	     (_foreach_ptr != _foreach_end &&		\
  |  |  ------------------
  |  |  |  Branch (116:8): [True: 0, False: 6.21k]
  |  |  ------------------
  |  |  117|  6.21k|	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   84|      0|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  |  |  ------------------
  |  |               	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (117:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  118|  6.21k|		;							\
  |  |  119|  6.21k|	     _foreach_ptr = CONST_PTR_OFFSET(_foreach_ptr, sizeof(elem)))
  |  |  ------------------
  |  |  |  |   27|      0|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  ------------------
  916|      0|		if (cat == category)
  ------------------
  |  Branch (916:7): [True: 0, False: 0]
  ------------------
  917|      0|			return TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  918|      0|	}
  919|  6.21k|	return FALSE;
  ------------------
  |  |   11|  6.21k|#  define FALSE (!1)
  ------------------
  920|  6.21k|}
lib-event.c:event_category_register:
  834|  6.21k|{
  835|  6.21k|	struct event_internal_category *internal = category->internal;
  836|  6.21k|	event_category_callback_t *callback;
  837|  6.21k|	bool allocated;
  838|       |
  839|  6.21k|	if (internal != NULL)
  ------------------
  |  Branch (839:6): [True: 6.21k, False: 1]
  ------------------
  840|  6.21k|		return &internal->representative; /* case 2 - see below */
  841|       |
  842|       |	/* register parent categories first */
  843|      1|	if (category->parent != NULL)
  ------------------
  |  Branch (843:6): [True: 0, False: 1]
  ------------------
  844|      0|		(void) event_category_register(category->parent);
  845|       |
  846|       |	/* There are four cases we need to handle:
  847|       |
  848|       |	   1) a new category is registered
  849|       |	   2) same category struct is re-registered - already handled above
  850|       |	      internal NULL check
  851|       |	   3) different category struct is registered, but it is identical
  852|       |	      to the previously registered one
  853|       |	   4) different category struct is registered, and it is different
  854|       |	      from the previously registered one - a programming error */
  855|      1|	internal = event_category_find_internal(category->name);
  856|      1|	if (internal == NULL) {
  ------------------
  |  Branch (856:6): [True: 1, False: 0]
  ------------------
  857|       |		/* case 1: first time we saw this name - allocate new */
  858|      1|		internal = i_new(struct event_internal_category, 1);
  ------------------
  |  |    8|      1|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|      1|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|      1|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|      1|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|      1|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      1|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  859|      1|		if (category->parent != NULL)
  ------------------
  |  Branch (859:7): [True: 0, False: 1]
  ------------------
  860|      0|			internal->parent = category->parent->internal;
  861|      1|		internal->name = i_strdup(category->name);
  862|      1|		internal->refcount = 1;
  863|      1|		internal->representative.name = internal->name;
  864|      1|		internal->representative.parent = category->parent;
  865|      1|		internal->representative.internal = internal;
  866|       |
  867|      1|		event_category_add_to_array(internal);
  868|       |
  869|      1|		allocated = TRUE;
  ------------------
  |  |   15|      1|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      1|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  870|      1|	} else {
  871|       |		/* case 3 or 4: someone registered this name before - share */
  872|      0|		if ((category->parent != NULL) &&
  ------------------
  |  Branch (872:7): [True: 0, False: 0]
  ------------------
  873|      0|		    (internal->parent != category->parent->internal)) {
  ------------------
  |  Branch (873:7): [True: 0, False: 0]
  ------------------
  874|       |			/* case 4 */
  875|      0|			struct event_internal_category *other =
  876|      0|				category->parent->internal;
  877|       |
  878|      0|			i_panic("event category parent mismatch detected: "
  879|      0|				"category %p internal %p (%s), "
  880|      0|				"internal parent %p (%s), public parent %p (%s)",
  881|      0|				category, internal, internal->name,
  882|      0|				internal->parent, internal->parent->name,
  883|      0|				other, other->name);
  884|      0|		}
  885|       |
  886|      0|		internal->refcount++;
  887|       |
  888|      0|		allocated = FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  889|      0|	}
  890|       |
  891|      1|	category->internal = internal;
  892|       |
  893|      1|	if (!allocated) {
  ------------------
  |  Branch (893:6): [True: 0, False: 1]
  ------------------
  894|       |		/* not the first registration of this category */
  895|      0|		return &internal->representative;
  896|      0|	}
  897|       |
  898|      2|	array_foreach_elem(&event_category_callbacks, callback) T_BEGIN {
  ------------------
  |  |  111|      1|	for (const void *_foreach_end = \
  |  |  112|      1|		CONST_PTR_OFFSET(*(array)->v, (array)->arr.buffer->used), \
  |  |  ------------------
  |  |  |  |   27|      1|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  |  |  113|      1|	     *_foreach_ptr = CONST_PTR_OFFSET(*(array)->v, ARRAY_TYPE_CHECK(array, &elem) + \
  |  |  ------------------
  |  |  |  |   27|      4|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  114|      1|		COMPILE_ERROR_IF_TRUE(sizeof(elem) > sizeof(void *))) \
  |  |  115|      1|		     ;							\
  |  |  116|      2|	     (_foreach_ptr != _foreach_end &&		\
  |  |  ------------------
  |  |  |  Branch (116:8): [True: 1, False: 1]
  |  |  ------------------
  |  |  117|      2|	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   84|      1|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  |  |  ------------------
  |  |               	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   15|      1|#  define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      1|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (117:7): [True: 1, False: 0]
  |  |  ------------------
  |  |  118|      1|		;							\
  |  |  119|      1|	     _foreach_ptr = CONST_PTR_OFFSET(_foreach_ptr, sizeof(elem)))
  |  |  ------------------
  |  |  |  |   27|      1|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  ------------------
              	array_foreach_elem(&event_category_callbacks, callback) T_BEGIN {
  ------------------
  |  |   68|      1|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|      1|#  define STMT_START do
  |  |  ------------------
  |  |   69|      1|		data_stack_frame_t _data_stack_cur_id = t_push(__FILE__ ":" T_XSTRING(__LINE__));
  |  |  ------------------
  |  |  |  |   66|      1|#define T_XSTRING(x)	T_STRING(x)	/* expand and then stringify */
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      1|#define T_STRING(x)	#x
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  899|      2|		callback(&internal->representative);
  900|      2|	} T_END;
  ------------------
  |  |   71|      1|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|      1|#  define STMT_START do
  |  |  ------------------
  |  |   72|      1|		if (unlikely(!t_pop(&_data_stack_cur_id))) \
  |  |  ------------------
  |  |  |  |  202|      1|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   73|      1|			i_panic("Leaked t_pop() call"); \
  |  |   74|      1|	} STMT_END; \
  |  |  ------------------
  |  |  |  |   64|      1|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   75|      1|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|      2|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  901|       |
  902|      1|	return &internal->representative;
  903|      1|}
lib-event.c:event_category_find_internal:
  805|      1|{
  806|      1|	struct event_internal_category *internal;
  807|       |
  808|      1|	array_foreach_elem(&event_registered_categories_internal, internal) {
  ------------------
  |  |  111|      1|	for (const void *_foreach_end = \
  |  |  112|      1|		CONST_PTR_OFFSET(*(array)->v, (array)->arr.buffer->used), \
  |  |  ------------------
  |  |  |  |   27|      1|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  |  |  113|      1|	     *_foreach_ptr = CONST_PTR_OFFSET(*(array)->v, ARRAY_TYPE_CHECK(array, &elem) + \
  |  |  ------------------
  |  |  |  |   27|      4|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  114|      1|		COMPILE_ERROR_IF_TRUE(sizeof(elem) > sizeof(void *))) \
  |  |  115|      1|		     ;							\
  |  |  116|      1|	     (_foreach_ptr != _foreach_end &&		\
  |  |  ------------------
  |  |  |  Branch (116:8): [True: 0, False: 1]
  |  |  ------------------
  |  |  117|      1|	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   84|      0|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  |  |  ------------------
  |  |               	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (117:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  118|      1|		;							\
  |  |  119|      1|	     _foreach_ptr = CONST_PTR_OFFSET(_foreach_ptr, sizeof(elem)))
  |  |  ------------------
  |  |  |  |   27|      0|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  ------------------
  809|      0|		if (strcmp(internal->name, name) == 0)
  ------------------
  |  Branch (809:7): [True: 0, False: 0]
  ------------------
  810|      0|			return internal;
  811|      0|	}
  812|       |
  813|      1|	return NULL;
  814|      1|}
lib-event.c:event_category_add_to_array:
  824|      1|{
  825|      1|	struct event_category *representative = &internal->representative;
  826|       |
  827|      1|	array_push_back(&event_registered_categories_internal, &internal);
  ------------------
  |  |  282|      1|#define array_push_back(array, item) array_append(array, (item), 1)
  |  |  ------------------
  |  |  |  |  214|      1|	TYPE_CHECKS(void, ARRAY_TYPE_CHECK(array, data), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      1|	(FALSE ? (return_type)(checks) : (func))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      1|#  define FALSE (!1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (11:17): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:25): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  215|      1|	array_append_i(&(array)->arr, data, count))
  |  |  ------------------
  ------------------
  828|      1|	array_push_back(&event_registered_categories_representative,
  ------------------
  |  |  282|      1|#define array_push_back(array, item) array_append(array, (item), 1)
  |  |  ------------------
  |  |  |  |  214|      1|	TYPE_CHECKS(void, ARRAY_TYPE_CHECK(array, data), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      1|	(FALSE ? (return_type)(checks) : (func))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      1|#  define FALSE (!1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (11:17): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:25): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  215|      1|	array_append_i(&(array)->arr, data, count))
  |  |  ------------------
  ------------------
  829|      1|			&representative);
  830|      1|}
lib-event.c:event_set_changed:
  118|  1.13M|{
  119|  1.13M|	event->change_id++;
  120|       |	/* It's unlikely that change_id will ever wrap, but lets be safe
  121|       |	   anyway. */
  122|  1.13M|	if (event->change_id == 0 ||
  ------------------
  |  Branch (122:6): [True: 0, False: 1.13M]
  ------------------
  123|  1.13M|	    event->change_id == event->sent_to_stats_id)
  ------------------
  |  Branch (123:6): [True: 0, False: 1.13M]
  ------------------
  124|      0|		event->change_id++;
  125|  1.13M|}
lib-event.c:event_get_field:
 1048|  1.12M|{
 1049|  1.12M|	struct event_field *field;
 1050|       |
 1051|  1.12M|	field = event_find_field_nonrecursive(event, key);
 1052|  1.12M|	if (field == NULL) {
  ------------------
  |  Branch (1052:6): [True: 1.11M, False: 12.5k]
  ------------------
 1053|  1.11M|		if (!array_is_created(&event->fields))
  ------------------
  |  |  176|  1.11M|	array_is_created_i(&(array)->arr)
  ------------------
  |  Branch (1053:7): [True: 401k, False: 712k]
  ------------------
 1054|  1.11M|			p_array_init(&event->fields, event->pool, 8);
  ------------------
  |  |   44|   401k|	array_create(array, pool, sizeof(**(array)->v), init_count)
  |  |  ------------------
  |  |  |  |  152|   401k|	array_create_i(&(array)->arr, pool, element_size, init_count)
  |  |  ------------------
  ------------------
 1055|  1.11M|		field = array_append_space(&event->fields);
  ------------------
  |  |  339|  1.11M|	ARRAY_TYPE_CAST_MODIFIABLE(array)array_append_space_i(&(array)->arr)
  |  |  ------------------
  |  |  |  |   54|  1.11M|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  ------------------
 1056|  1.11M|		field->key = p_strdup(event->pool, key);
 1057|  1.11M|	} else if (clear) {
  ------------------
  |  Branch (1057:13): [True: 12.5k, False: 0]
  ------------------
 1058|  12.5k|		i_zero(&field->value);
  ------------------
  |  |  249|  12.5k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  12.5k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  12.5k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1059|  12.5k|	}
 1060|  1.12M|	event_set_changed(event);
 1061|  1.12M|	return field;
 1062|  1.12M|}
lib-event.c:event_call_callbacks:
  130|  1.04M|{
  131|  1.04M|	event_callback_t *callback;
  132|       |
  133|  1.04M|	if (event->disable_callbacks)
  ------------------
  |  Branch (133:6): [True: 0, False: 1.04M]
  ------------------
  134|      0|		return TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  135|       |
  136|  1.04M|	array_foreach_elem(&event_handlers, callback) {
  ------------------
  |  |  111|  1.04M|	for (const void *_foreach_end = \
  |  |  112|  1.04M|		CONST_PTR_OFFSET(*(array)->v, (array)->arr.buffer->used), \
  |  |  ------------------
  |  |  |  |   27|  1.04M|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  |  |  113|  1.04M|	     *_foreach_ptr = CONST_PTR_OFFSET(*(array)->v, ARRAY_TYPE_CHECK(array, &elem) + \
  |  |  ------------------
  |  |  |  |   27|  4.17M|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  114|  1.04M|		COMPILE_ERROR_IF_TRUE(sizeof(elem) > sizeof(void *))) \
  |  |  115|  1.04M|		     ;							\
  |  |  116|  1.04M|	     (_foreach_ptr != _foreach_end &&		\
  |  |  ------------------
  |  |  |  Branch (116:8): [True: 0, False: 1.04M]
  |  |  ------------------
  |  |  117|  1.04M|	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   84|      0|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  |  |  ------------------
  |  |               	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (117:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  118|  1.04M|		;							\
  |  |  119|  1.04M|	     _foreach_ptr = CONST_PTR_OFFSET(_foreach_ptr, sizeof(elem)))
  |  |  ------------------
  |  |  |  |   27|      0|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  ------------------
  137|      0|		bool ret;
  138|       |
  139|      0|		T_BEGIN {
  ------------------
  |  |   68|      0|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |   69|      0|		data_stack_frame_t _data_stack_cur_id = t_push(__FILE__ ":" T_XSTRING(__LINE__));
  |  |  ------------------
  |  |  |  |   66|      0|#define T_XSTRING(x)	T_STRING(x)	/* expand and then stringify */
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define T_STRING(x)	#x
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  140|      0|			ret = callback(event, type, ctx, fmt, args);
  141|      0|		} T_END;
  ------------------
  |  |   71|      0|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |   72|      0|		if (unlikely(!t_pop(&_data_stack_cur_id))) \
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   73|      0|			i_panic("Leaked t_pop() call"); \
  |  |   74|      0|	} STMT_END; \
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   75|      0|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  142|      0|		if (!ret) {
  ------------------
  |  Branch (142:7): [True: 0, False: 0]
  ------------------
  143|       |			/* event sending was stopped */
  144|      0|			return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  145|      0|		}
  146|      0|	}
  147|  1.04M|	return TRUE;
  ------------------
  |  |   15|  1.04M|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  1.04M|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  148|  1.04M|}
lib-event.c:last_passthrough_event:
   98|   879k|{
   99|   879k|	i_assert(event_last_passthrough != NULL);
  ------------------
  |  |  219|   879k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   879k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   879k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   879k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 879k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 879k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   879k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   879k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   879k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  100|   879k|	return event_last_passthrough;
  101|   879k|}
lib-event.c:event_passthrough_set_name:
 1744|   253k|{
 1745|   253k|	event_set_name(last_passthrough_event(), name);
 1746|   253k|	return &event_passthrough_vfuncs;
 1747|   253k|}
lib-event.c:event_passthrough_add_str:
 1788|   217k|{
 1789|   217k|	event_add_str(last_passthrough_event(), key, value);
 1790|   217k|	return &event_passthrough_vfuncs;
 1791|   217k|}
lib-event.c:event_passthrough_add_int:
 1810|   154k|{
 1811|   154k|	event_add_int(last_passthrough_event(), key, num);
 1812|   154k|	return &event_passthrough_vfuncs;
 1813|   154k|}
lib-event.c:event_passthrough_event:
 1851|   253k|{
 1852|   253k|	struct event *event = last_passthrough_event();
 1853|   253k|	event_last_passthrough = NULL;
 1854|   253k|	return event;
 1855|   253k|}

lib_signals_ignore:
  572|      1|{
  573|      1|	if (signo < 0 || signo > MAX_SIGNAL_VALUE) {
  ------------------
  |  |   14|      1|#define MAX_SIGNAL_VALUE 63
  ------------------
  |  Branch (573:6): [True: 0, False: 1]
  |  Branch (573:19): [True: 0, False: 1]
  ------------------
  574|      0|		i_panic("Trying to ignore signal %d, but max is %d",
  575|      0|			signo, MAX_SIGNAL_VALUE);
  ------------------
  |  |   14|      0|#define MAX_SIGNAL_VALUE 63
  ------------------
  576|      0|	}
  577|       |
  578|      1|	i_assert(signal_handlers[signo] == NULL);
  ------------------
  |  |  219|      1|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      1|#  define STMT_START do
  |  |  ------------------
  |  |  220|      1|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      1|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      1|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      1|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      1|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  579|       |
  580|      1|	lib_signals_ignore_forced(signo, restart_syscalls);
  581|      1|}
lib_signals_init:
  694|      1|{
  695|      1|	int i;
  696|       |
  697|      1|	signals_initialized = TRUE;
  ------------------
  |  |   15|      1|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      1|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  698|      1|	io_loop_add_switch_callback(lib_signals_ioloop_switched);
  699|      1|	io_loop_add_destroy_callback(lib_signals_ioloop_destroyed);
  700|       |
  701|       |	/* add signals that were already registered */
  702|     64|	for (i = 0; i < MAX_SIGNAL_VALUE; i++) {
  ------------------
  |  |   14|     64|#define MAX_SIGNAL_VALUE 63
  ------------------
  |  Branch (702:14): [True: 63, False: 1]
  ------------------
  703|     63|		if (signal_handlers[i] != NULL)
  ------------------
  |  Branch (703:7): [True: 0, False: 63]
  ------------------
  704|      0|			lib_signals_set(i, signal_handlers[i]->flags);
  705|     63|	}
  706|      1|}
lib-signals.c:lib_signals_ioloop_switch:
  421|  12.4k|{
  422|  12.4k|	struct signal_handler *h;
  423|       |
  424|  12.4k|	if (current_ioloop == NULL || sig_pipe_fd[0] <= 0)
  ------------------
  |  Branch (424:6): [True: 6.21k, False: 6.21k]
  |  Branch (424:32): [True: 6.21k, False: 0]
  ------------------
  425|  12.4k|		return;
  426|       |
  427|       |	/* initialize current_ioloop for signal handlers created before the
  428|       |	   first ioloop. */
  429|      0|	for (int signo = 0; signo < MAX_SIGNAL_VALUE; signo++) {
  ------------------
  |  |   14|      0|#define MAX_SIGNAL_VALUE 63
  ------------------
  |  Branch (429:22): [True: 0, False: 0]
  ------------------
  430|      0|		for (h = signal_handlers[signo]; h != NULL; h = h->next) {
  ------------------
  |  Branch (430:36): [True: 0, False: 0]
  ------------------
  431|      0|			if ((h->flags & LIBSIG_FLAG_IOLOOP_AUTOMOVE) != 0)
  ------------------
  |  Branch (431:8): [True: 0, False: 0]
  ------------------
  432|      0|				lib_signals_ioloop_unref(&h->sig_ioloop);
  433|      0|			if (h->sig_ioloop == NULL)
  ------------------
  |  Branch (433:8): [True: 0, False: 0]
  ------------------
  434|      0|				h->sig_ioloop = lib_signals_ioloop_ref(current_ioloop);
  435|      0|		}
  436|      0|	}
  437|      0|	have_missing_ioloops = FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  438|      0|}
lib-signals.c:lib_signals_ioloop_find:
  188|  6.21k|{
  189|  6.21k|	struct signal_ioloop *l;
  190|       |
  191|  6.21k|	for (l = signal_ioloops; l != NULL; l = l->next) {
  ------------------
  |  Branch (191:27): [True: 0, False: 6.21k]
  ------------------
  192|      0|		if (l->ioloop == ioloop)
  ------------------
  |  Branch (192:7): [True: 0, False: 0]
  ------------------
  193|      0|			break;
  194|      0|	}
  195|  6.21k|	return l;
  196|  6.21k|}
lib-signals.c:lib_signals_ignore_forced:
  549|      1|{
  550|      1|	struct sigaction act;
  551|       |
  552|      1|	if (sigemptyset(&act.sa_mask) < 0)
  ------------------
  |  Branch (552:6): [True: 0, False: 1]
  ------------------
  553|      0|		i_fatal("sigemptyset(): %m");
  554|      1|	if (restart_syscalls) {
  ------------------
  |  Branch (554:6): [True: 1, False: 0]
  ------------------
  555|      1|		act.sa_flags = SA_RESTART;
  556|      1|		act.sa_handler = SIG_IGN;
  557|      1|	} else {
  558|      0|#ifdef SA_SIGINFO
  559|      0|		act.sa_flags = SA_SIGINFO;
  560|      0|		act.sa_sigaction = sig_ignore;
  561|       |#else
  562|       |		act.sa_flags = 0;
  563|       |		act.sa_handler = sig_ignore;
  564|       |#endif
  565|      0|	}
  566|       |
  567|      1|	if (sigaction(signo, &act, NULL) < 0)
  ------------------
  |  Branch (567:6): [True: 0, False: 1]
  ------------------
  568|      0|		i_fatal("sigaction(%d): %m", signo);
  569|      1|}
lib-signals.c:signal_check_shadowed:
  296|  12.4k|{
  297|  12.4k|	struct signal_ioloop *sig_ioloop;
  298|       |
  299|  12.4k|	if (!array_is_created(&pending_shadowed_signals) ||
  ------------------
  |  |  176|  24.8k|	array_is_created_i(&(array)->arr)
  ------------------
  |  Branch (299:6): [True: 12.4k, False: 0]
  ------------------
  300|  12.4k|	    array_count(&pending_shadowed_signals) == 0)
  ------------------
  |  |  200|      0|	array_count_i(&(array)->arr)
  ------------------
  |  Branch (300:6): [True: 0, False: 0]
  ------------------
  301|  12.4k|		return;
  302|       |
  303|      0|	sig_ioloop = lib_signals_ioloop_find(current_ioloop);
  304|      0|	if (sig_ioloop != NULL)
  ------------------
  |  Branch (304:6): [True: 0, False: 0]
  ------------------
  305|      0|		io_set_pending(sig_ioloop->io);
  306|      0|}
lib-signals.c:lib_signals_ioloop_switched:
  441|  12.4k|{
  442|  12.4k|	ioloop_switched = TRUE;
  ------------------
  |  |   15|  12.4k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  12.4k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  443|       |
  444|  12.4k|	lib_signals_ioloop_switch();
  445|       |
  446|       |	/* check whether we can now handle any shadowed delayed signals */
  447|  12.4k|	signal_check_shadowed();
  448|  12.4k|}
lib-signals.c:lib_signals_ioloop_destroyed:
  451|  6.21k|{
  452|  6.21k|	struct signal_ioloop *sig_ioloop;
  453|       |
  454|  6.21k|	sig_ioloop = lib_signals_ioloop_find(ioloop);
  455|  6.21k|	if (sig_ioloop != NULL) {
  ------------------
  |  Branch (455:6): [True: 0, False: 6.21k]
  ------------------
  456|      0|		io_remove(&sig_ioloop->io);
  457|      0|		sig_ioloop->ioloop = NULL;
  458|      0|	}
  459|  6.21k|}

lib_atexit_priority:
   78|      2|{
   79|      2|	struct atexit_callback *cb;
   80|      2|	const struct atexit_callback *callbacks;
   81|      2|	unsigned int i, count;
   82|       |
   83|      2|	if (!array_is_created(&atexit_callbacks))
  ------------------
  |  |  176|      2|	array_is_created_i(&(array)->arr)
  ------------------
  |  Branch (83:6): [True: 1, False: 1]
  ------------------
   84|      2|		i_array_init(&atexit_callbacks, 8);
  ------------------
  |  |   46|      2|	p_array_init(array, default_pool, init_count)
  |  |  ------------------
  |  |  |  |   44|      1|	array_create(array, pool, sizeof(**(array)->v), init_count)
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      1|	array_create_i(&(array)->arr, pool, element_size, init_count)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   85|      1|	else {
   86|       |		/* skip if it's already added */
   87|      1|		callbacks = array_get(&atexit_callbacks, &count);
  ------------------
  |  |  255|      1|	ARRAY_TYPE_CAST_CONST(array)array_get_i(&(array)->arr, count)
  |  |  ------------------
  |  |  |  |   52|      1|	(typeof(*(array)->v))
  |  |  ------------------
  ------------------
   88|      2|		for (i = count; i > 0; i--) {
  ------------------
  |  Branch (88:19): [True: 1, False: 1]
  ------------------
   89|      1|			if (callbacks[i-1].callback == callback) {
  ------------------
  |  Branch (89:8): [True: 0, False: 1]
  ------------------
   90|      0|				i_assert(callbacks[i-1].priority == priority);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   91|      0|				return;
   92|      0|			}
   93|      1|		}
   94|      1|	}
   95|      2|	cb = array_append_space(&atexit_callbacks);
  ------------------
  |  |  339|      2|	ARRAY_TYPE_CAST_MODIFIABLE(array)array_append_space_i(&(array)->arr)
  |  |  ------------------
  |  |  |  |   54|      2|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  ------------------
   96|      2|	cb->priority = priority;
   97|      2|	cb->callback = callback;
   98|      2|}
lib_set_clean_exit:
  137|      1|{
  138|      1|	lib_clean_exit = set;
  139|      1|}
lib_init:
  162|      1|{
  163|      1|	i_assert(!lib_initialized);
  ------------------
  |  |  219|      1|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      1|#  define STMT_START do
  |  |  ------------------
  |  |  220|      1|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      1|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      1|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      1|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      1|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  164|      1|	random_init();
  165|      1|	data_stack_init();
  166|      1|	hostpid_init();
  167|      1|	lib_open_non_stdio_dev_null();
  168|      1|	lib_event_init();
  169|      1|	event_filter_init();
  170|      1|	var_expand_extensions_init();
  171|       |
  172|       |	/* Default to clean exit. Otherwise there would be too many accidents
  173|       |	   with e.g. command line parsing errors that try to return instead
  174|       |	   of using lib_exit(). master_service_init_finish() will change this
  175|       |	   again to be FALSE. */
  176|      1|	lib_set_clean_exit(TRUE);
  ------------------
  |  |   15|      1|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      1|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  177|      1|	atexit(lib_atexit_handler);
  178|       |
  179|      1|	lib_initialized = TRUE;
  ------------------
  |  |   15|      1|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      1|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  180|      1|}
lib_is_initialized:
  183|  6.21k|{
  184|  6.21k|	return lib_initialized;
  185|  6.21k|}
lib.c:lib_open_non_stdio_dev_null:
  119|      1|{
  120|      1|	dev_null_fd = open("/dev/null", O_WRONLY);
  121|      1|	if (dev_null_fd == -1)
  ------------------
  |  Branch (121:6): [True: 0, False: 1]
  ------------------
  122|      0|		i_fatal("open(/dev/null) failed: %m");
  123|       |	/* Make sure stdin, stdout and stderr fds exist. We especially rely on
  124|       |	   stderr being available and a lot of code doesn't like fd being 0.
  125|       |	   We'll open /dev/null as write-only also for stdin, since if any
  126|       |	   reads are attempted from it we'll want them to fail. */
  127|      1|	while (dev_null_fd < STDERR_FILENO) {
  ------------------
  |  Branch (127:9): [True: 0, False: 1]
  ------------------
  128|      0|		dev_null_fd = dup(dev_null_fd);
  129|      0|		if (dev_null_fd == -1)
  ------------------
  |  Branch (129:7): [True: 0, False: 0]
  ------------------
  130|      0|			i_fatal("dup(/dev/null) failed: %m");
  131|      0|	}
  132|       |	/* close the actual /dev/null fd on exec*(), but keep it in stdio fds */
  133|      1|	fd_close_on_exec(dev_null_fd, TRUE);
  ------------------
  |  |   15|      1|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      1|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  134|      1|}
lib.c:lib_atexit_handler:
  148|      1|{
  149|       |	/* We're already in exit code path. Avoid using any functions that
  150|       |	   might cause strange breakage. Especially anything that could call
  151|       |	   exit() again could cause infinite looping in some OSes. */
  152|      1|	if (!lib_clean_exit) {
  ------------------
  |  Branch (152:6): [True: 0, False: 1]
  ------------------
  153|      0|		const char *error = "Unexpected exit - converting to abort\n";
  154|      0|		if (write(STDERR_FILENO, error, strlen(error)) < 0) {
  ------------------
  |  Branch (154:7): [True: 0, False: 0]
  ------------------
  155|       |			/* ignore */
  156|      0|		}
  157|      0|		abort();
  158|      0|	}
  159|      1|}

smtp-server-cmd-data.c:i_memcpy:
   79|  6.40k|static inline void *i_memcpy(void *dest, const void *src, size_t n) {
   80|  6.40k|	i_assert(dest != NULL && src != NULL);
  ------------------
  |  |  219|  6.40k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.40k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.40k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  12.8k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.40k]
  |  |  |  |  |  Branch (202:45): [True: 6.40k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 6.40k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.40k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.40k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.40k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|  6.40k|	return memcpy(dest, src, n);
   82|  6.40k|}
smtp-server-transaction.c:i_memcpy:
   79|  50.3k|static inline void *i_memcpy(void *dest, const void *src, size_t n) {
   80|  50.3k|	i_assert(dest != NULL && src != NULL);
  ------------------
  |  |  219|  50.3k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  50.3k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  50.3k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   100k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 50.3k]
  |  |  |  |  |  Branch (202:45): [True: 50.3k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 50.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  50.3k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  50.3k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  50.3k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|  50.3k|	return memcpy(dest, src, n);
   82|  50.3k|}
smtp-address.c:i_memcpy:
   79|  69.8k|static inline void *i_memcpy(void *dest, const void *src, size_t n) {
   80|  69.8k|	i_assert(dest != NULL && src != NULL);
  ------------------
  |  |  219|  69.8k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  69.8k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  69.8k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   139k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 69.8k]
  |  |  |  |  |  Branch (202:45): [True: 69.8k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 69.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  69.8k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  69.8k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  69.8k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|  69.8k|	return memcpy(dest, src, n);
   82|  69.8k|}
base64.c:i_memcpy:
   79|  12.4k|static inline void *i_memcpy(void *dest, const void *src, size_t n) {
   80|  12.4k|	i_assert(dest != NULL && src != NULL);
  ------------------
  |  |  219|  12.4k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  12.4k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  12.4k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  24.8k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 12.4k]
  |  |  |  |  |  Branch (202:45): [True: 12.4k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 12.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  12.4k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  12.4k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.4k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|  12.4k|	return memcpy(dest, src, n);
   82|  12.4k|}
guid.c:i_memcpy:
   79|  6.21k|static inline void *i_memcpy(void *dest, const void *src, size_t n) {
   80|  6.21k|	i_assert(dest != NULL && src != NULL);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  12.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:45): [True: 6.21k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 6.21k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|  6.21k|	return memcpy(dest, src, n);
   82|  6.21k|}
istream.c:i_memcpy:
   79|  1.08k|static inline void *i_memcpy(void *dest, const void *src, size_t n) {
   80|  1.08k|	i_assert(dest != NULL && src != NULL);
  ------------------
  |  |  219|  1.08k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  1.08k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  1.08k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  2.16k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1.08k]
  |  |  |  |  |  Branch (202:45): [True: 1.08k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 1.08k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  1.08k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  1.08k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.08k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|  1.08k|	return memcpy(dest, src, n);
   82|  1.08k|}
ioloop.c:i_memcpy:
   79|  34.3k|static inline void *i_memcpy(void *dest, const void *src, size_t n) {
   80|  34.3k|	i_assert(dest != NULL && src != NULL);
  ------------------
  |  |  219|  34.3k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  34.3k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  34.3k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  68.7k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 34.3k]
  |  |  |  |  |  Branch (202:45): [True: 34.3k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 34.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  34.3k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  34.3k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  34.3k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|  34.3k|	return memcpy(dest, src, n);
   82|  34.3k|}
lib-event.c:i_memcpy:
   79|   253k|static inline void *i_memcpy(void *dest, const void *src, size_t n) {
   80|   253k|	i_assert(dest != NULL && src != NULL);
  ------------------
  |  |  219|   253k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   253k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   253k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   506k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 253k]
  |  |  |  |  |  Branch (202:45): [True: 253k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 253k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   253k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   253k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   253k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|   253k|	return memcpy(dest, src, n);
   82|   253k|}
mempool-alloconly.c:i_memcpy:
   79|     23|static inline void *i_memcpy(void *dest, const void *src, size_t n) {
   80|     23|	i_assert(dest != NULL && src != NULL);
  ------------------
  |  |  219|     23|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|     23|#  define STMT_START do
  |  |  ------------------
  |  |  220|     23|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|     46|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 23]
  |  |  |  |  |  Branch (202:45): [True: 23, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 23, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|     23|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|     23|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|     23|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|     23|	return memcpy(dest, src, n);
   82|     23|}
mempool-datastack.c:i_memcpy:
   79|    154|static inline void *i_memcpy(void *dest, const void *src, size_t n) {
   80|    154|	i_assert(dest != NULL && src != NULL);
  ------------------
  |  |  219|    154|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    154|#  define STMT_START do
  |  |  ------------------
  |  |  220|    154|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    308|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 154]
  |  |  |  |  |  Branch (202:45): [True: 154, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 154, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    154|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    154|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    154|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|    154|	return memcpy(dest, src, n);
   82|    154|}
mempool-unsafe-datastack.c:i_memcpy:
   79|     95|static inline void *i_memcpy(void *dest, const void *src, size_t n) {
   80|     95|	i_assert(dest != NULL && src != NULL);
  ------------------
  |  |  219|     95|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|     95|#  define STMT_START do
  |  |  ------------------
  |  |  220|     95|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    190|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 95]
  |  |  |  |  |  Branch (202:45): [True: 95, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 95, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|     95|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|     95|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|     95|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|     95|	return memcpy(dest, src, n);
   82|     95|}
net.c:i_memcpy:
   79|    528|static inline void *i_memcpy(void *dest, const void *src, size_t n) {
   80|    528|	i_assert(dest != NULL && src != NULL);
  ------------------
  |  |  219|    528|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    528|#  define STMT_START do
  |  |  ------------------
  |  |  220|    528|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  1.05k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 528]
  |  |  |  |  |  Branch (202:45): [True: 528, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 528, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    528|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    528|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    528|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|    528|	return memcpy(dest, src, n);
   82|    528|}
ostream-file.c:i_memcpy:
   79|   126k|static inline void *i_memcpy(void *dest, const void *src, size_t n) {
   80|   126k|	i_assert(dest != NULL && src != NULL);
  ------------------
  |  |  219|   126k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   126k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   126k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   253k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 126k]
  |  |  |  |  |  Branch (202:45): [True: 126k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 126k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   126k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   126k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   126k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|   126k|	return memcpy(dest, src, n);
   82|   126k|}
randgen.c:i_memcpy:
   79|      1|static inline void *i_memcpy(void *dest, const void *src, size_t n) {
   80|      1|	i_assert(dest != NULL && src != NULL);
  ------------------
  |  |  219|      1|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      1|#  define STMT_START do
  |  |  ------------------
  |  |  220|      1|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      2|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1]
  |  |  |  |  |  Branch (202:45): [True: 1, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      1|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      1|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      1|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|      1|	return memcpy(dest, src, n);
   82|      1|}

smtp-server-cmd-data.c:malloc_multiply_check:
   13|  21.0k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  21.0k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 21.0k]
  |  Branch (16:40): [True: 0, False: 21.0k]
  ------------------
   17|  21.0k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  21.0k|	return a * b;
   22|  21.0k|}
smtp-server-reply.c:malloc_multiply_check:
   13|   115k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|   115k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 115k]
  |  Branch (16:40): [True: 0, False: 115k]
  ------------------
   17|   115k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|   115k|	return a * b;
   22|   115k|}
smtp-server-command.c:malloc_multiply_check:
   13|   246k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|   246k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 246k]
  |  Branch (16:40): [True: 0, False: 246k]
  ------------------
   17|   246k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|   246k|	return a * b;
   22|   246k|}
smtp-server-recipient.c:malloc_multiply_check:
   13|  12.1k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  12.1k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 12.1k]
  |  Branch (16:40): [True: 0, False: 12.1k]
  ------------------
   17|  12.1k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  12.1k|	return a * b;
   22|  12.1k|}
smtp-server-transaction.c:malloc_multiply_check:
   13|  4.54k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  4.54k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 4.54k]
  |  Branch (16:40): [True: 0, False: 4.54k]
  ------------------
   17|  4.54k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  4.54k|	return a * b;
   22|  4.54k|}
smtp-server-connection.c:malloc_multiply_check:
   13|  6.21k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  6.21k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 6.21k]
  |  Branch (16:40): [True: 0, False: 6.21k]
  ------------------
   17|  6.21k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  6.21k|	return a * b;
   22|  6.21k|}
smtp-server.c:malloc_multiply_check:
   13|  6.21k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  6.21k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 6.21k]
  |  Branch (16:40): [True: 0, False: 6.21k]
  ------------------
   17|  6.21k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  6.21k|	return a * b;
   22|  6.21k|}
smtp-address.c:malloc_add_check:
   35|  69.8k|{
   36|       |	/* the first sizeof-checks are intended to optimize away this entire
   37|       |	   if-check for types that are small enough to never wrap size_t. */
   38|  69.8k|	if ((sizeof_a >= sizeof(size_t) || sizeof_b >= sizeof(size_t)) &&
  ------------------
  |  Branch (38:7): [True: 69.8k, False: 0]
  |  Branch (38:37): [True: 0, False: 0]
  ------------------
   39|  69.8k|	    SIZE_MAX - a < b) {
  ------------------
  |  Branch (39:6): [True: 0, False: 69.8k]
  ------------------
   40|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu + %zu",
   41|      0|			fname, linenum, a, b);
   42|      0|	}
   43|  69.8k|	return a + b;
   44|  69.8k|}
smtp-command-parser.c:malloc_multiply_check:
   13|  6.21k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  6.21k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 6.21k]
  |  Branch (16:40): [True: 0, False: 6.21k]
  ------------------
   17|  6.21k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  6.21k|	return a * b;
   22|  6.21k|}
smtp-server-cmd-helo.c:malloc_multiply_check:
   13|  7.24k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  7.24k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 7.24k]
  |  Branch (16:40): [True: 0, False: 7.24k]
  ------------------
   17|  7.24k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  7.24k|	return a * b;
   22|  7.24k|}
smtp-server-cmd-mail.c:malloc_multiply_check:
   13|  12.6k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  12.6k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 12.6k]
  |  Branch (16:40): [True: 0, False: 12.6k]
  ------------------
   17|  12.6k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  12.6k|	return a * b;
   22|  12.6k|}
smtp-server-cmd-rcpt.c:malloc_multiply_check:
   13|  12.1k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  12.1k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 12.1k]
  |  Branch (16:40): [True: 0, False: 12.1k]
  ------------------
   17|  12.1k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  12.1k|	return a * b;
   22|  12.1k|}
istream-dot.c:malloc_multiply_check:
   13|  1.55k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  1.55k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 1.55k]
  |  Branch (16:40): [True: 0, False: 1.55k]
  ------------------
   17|  1.55k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  1.55k|	return a * b;
   22|  1.55k|}
buffer.c:malloc_multiply_check:
   13|   863k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|   863k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 863k]
  |  Branch (16:40): [True: 0, False: 863k]
  ------------------
   17|   863k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|   863k|	return a * b;
   22|   863k|}
connection.c:malloc_multiply_check:
   13|  6.21k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  6.21k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 6.21k]
  |  Branch (16:40): [True: 0, False: 6.21k]
  ------------------
   17|  6.21k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  6.21k|	return a * b;
   22|  6.21k|}
data-stack.c:malloc_add_check:
   35|     21|{
   36|       |	/* the first sizeof-checks are intended to optimize away this entire
   37|       |	   if-check for types that are small enough to never wrap size_t. */
   38|     21|	if ((sizeof_a >= sizeof(size_t) || sizeof_b >= sizeof(size_t)) &&
  ------------------
  |  Branch (38:7): [True: 21, False: 0]
  |  Branch (38:37): [True: 0, False: 0]
  ------------------
   39|     21|	    SIZE_MAX - a < b) {
  ------------------
  |  Branch (39:6): [True: 0, False: 21]
  ------------------
   40|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu + %zu",
   41|      0|			fname, linenum, a, b);
   42|      0|	}
   43|     21|	return a + b;
   44|     21|}
iostream-pump.c:malloc_multiply_check:
   13|  6.21k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  6.21k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 6.21k]
  |  Branch (16:40): [True: 0, False: 6.21k]
  ------------------
   17|  6.21k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  6.21k|	return a * b;
   22|  6.21k|}
istream.c:malloc_multiply_check:
   13|  2.93k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  2.93k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 2.93k]
  |  Branch (16:40): [True: 0, False: 2.93k]
  ------------------
   17|  2.93k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  2.93k|	return a * b;
   22|  2.93k|}
istream-chain.c:malloc_multiply_check:
   13|  12.1k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  12.1k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 12.1k]
  |  Branch (16:40): [True: 0, False: 12.1k]
  ------------------
   17|  12.1k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  12.1k|	return a * b;
   22|  12.1k|}
istream-data.c:malloc_multiply_check:
   13|  6.21k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  6.21k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 6.21k]
  |  Branch (16:40): [True: 0, False: 6.21k]
  ------------------
   17|  6.21k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  6.21k|	return a * b;
   22|  6.21k|}
istream-failure-at.c:malloc_multiply_check:
   13|  1.55k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  1.55k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 1.55k]
  |  Branch (16:40): [True: 0, False: 1.55k]
  ------------------
   17|  1.55k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  1.55k|	return a * b;
   22|  1.55k|}
istream-file.c:malloc_multiply_check:
   13|  6.21k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  6.21k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 6.21k]
  |  Branch (16:40): [True: 0, False: 6.21k]
  ------------------
   17|  6.21k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  6.21k|	return a * b;
   22|  6.21k|}
istream-limit.c:malloc_multiply_check:
   13|  12.8k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  12.8k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 12.8k]
  |  Branch (16:40): [True: 0, False: 12.8k]
  ------------------
   17|  12.8k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  12.8k|	return a * b;
   22|  12.8k|}
istream-sized.c:malloc_multiply_check:
   13|  12.8k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  12.8k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 12.8k]
  |  Branch (16:40): [True: 0, False: 12.8k]
  ------------------
   17|  12.8k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  12.8k|	return a * b;
   22|  12.8k|}
ioloop.c:malloc_multiply_check:
   13|   143k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|   143k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 143k]
  |  Branch (16:40): [True: 0, False: 143k]
  ------------------
   17|   143k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|   143k|	return a * b;
   22|   143k|}
ioloop-epoll.c:malloc_multiply_check:
   13|  18.6k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  18.6k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 18.6k]
  |  Branch (16:40): [True: 0, False: 18.6k]
  ------------------
   17|  18.6k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  18.6k|	return a * b;
   22|  18.6k|}
lib-event.c:malloc_multiply_check:
   13|   522k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|   522k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 522k]
  |  Branch (16:40): [True: 0, False: 522k]
  ------------------
   17|   522k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|   522k|	return a * b;
   22|   522k|}
memarea.c:malloc_multiply_check:
   13|  8.82k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  8.82k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 8.82k]
  |  Branch (16:40): [True: 0, False: 8.82k]
  ------------------
   17|  8.82k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  8.82k|	return a * b;
   22|  8.82k|}
mempool-alloconly.c:malloc_multiply_check:
   13|   667k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|   667k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 667k]
  |  Branch (16:40): [True: 0, False: 667k]
  ------------------
   17|   667k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|   667k|	return a * b;
   22|   667k|}
mempool-datastack.c:malloc_multiply_check:
   13|   293k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|   293k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 293k]
  |  Branch (16:40): [True: 0, False: 293k]
  ------------------
   17|   293k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|   293k|	return a * b;
   22|   293k|}
ostream-file.c:malloc_multiply_check:
   13|  12.4k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  12.4k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 12.4k]
  |  Branch (16:40): [True: 0, False: 12.4k]
  ------------------
   17|  12.4k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  12.4k|	return a * b;
   22|  12.4k|}
priorityq.c:malloc_multiply_check:
   13|  6.21k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  6.21k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 6.21k]
  |  Branch (16:40): [True: 0, False: 6.21k]
  ------------------
   17|  6.21k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  6.21k|	return a * b;
   22|  6.21k|}
strfuncs.c:malloc_multiply_check:
   13|  43.3k|{
   14|       |	/* the first sizeof-checks are intended to optimize away this entire
   15|       |	   if-check for types that are small enough to never wrap size_t. */
   16|  43.3k|	if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) &&
  ------------------
  |  Branch (16:7): [True: 0, False: 43.3k]
  |  Branch (16:40): [True: 0, False: 43.3k]
  ------------------
   17|  43.3k|	    b != 0 && (a > SIZE_MAX / b)) {
  ------------------
  |  Branch (17:6): [True: 0, False: 0]
  |  Branch (17:16): [True: 0, False: 0]
  ------------------
   18|      0|		i_panic("file %s: line %d: memory allocation overflow: %zu * %zu",
   19|      0|			fname, linenum, a, b);
   20|      0|	}
   21|  43.3k|	return a * b;
   22|  43.3k|}

memarea_init:
   24|  8.82k|{
   25|  8.82k|	struct memarea *area;
   26|       |
   27|  8.82k|	i_assert(callback != NULL);
  ------------------
  |  |  219|  8.82k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  8.82k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  8.82k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  8.82k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 8.82k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 8.82k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  8.82k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  8.82k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  8.82k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   28|       |
   29|  8.82k|	area = i_new(struct memarea, 1);
  ------------------
  |  |    8|  8.82k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  8.82k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  8.82k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  8.82k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  8.82k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  8.82k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   30|  8.82k|	area->data = data;
   31|  8.82k|	area->size = size;
   32|  8.82k|	area->callback = callback;
   33|  8.82k|	area->context = context;
   34|  8.82k|	area->refcount = 1;
   35|  8.82k|	return area;
   36|  8.82k|}
memarea_init_empty:
   39|  10.2k|{
   40|  10.2k|	i_assert(memarea_empty.refcount > 0);
  ------------------
  |  |  219|  10.2k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  10.2k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  10.2k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  10.2k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 10.2k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 10.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  10.2k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  10.2k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  10.2k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   41|  10.2k|	memarea_empty.refcount++;
   42|  10.2k|	return &memarea_empty;
   43|  10.2k|}
memarea_ref:
   46|  1.48k|{
   47|  1.48k|	i_assert(area->refcount > 0);
  ------------------
  |  |  219|  1.48k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  1.48k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  1.48k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  1.48k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1.48k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1.48k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  1.48k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  1.48k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.48k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   48|  1.48k|	area->refcount++;
   49|  1.48k|}
memarea_unref:
   52|  20.5k|{
   53|  20.5k|	struct memarea *area = *_area;
   54|       |
   55|  20.5k|	*_area = NULL;
   56|  20.5k|	i_assert(area->refcount > 0);
  ------------------
  |  |  219|  20.5k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  20.5k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  20.5k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  20.5k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 20.5k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  20.5k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  20.5k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  20.5k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   57|       |
   58|  20.5k|	if (--area->refcount > 0)
  ------------------
  |  Branch (58:6): [True: 11.7k, False: 8.82k]
  ------------------
   59|  11.7k|		return;
   60|  20.5k|	i_assert(area != &memarea_empty);
  ------------------
  |  |  219|  8.82k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  8.82k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  8.82k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  8.82k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 8.82k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 8.82k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  8.82k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  20.5k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  20.5k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   61|  8.82k|	area->callback(area->context);
   62|  8.82k|	i_free(area);
  ------------------
  |  |   19|  8.82k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  8.82k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  8.82k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  8.82k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  8.82k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  8.82k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  8.82k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  8.82k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   63|  8.82k|}
memarea_get_refcount:
   75|  32.5k|{
   76|  32.5k|	i_assert(area->refcount > 0);
  ------------------
  |  |  219|  32.5k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  32.5k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  32.5k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  32.5k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 32.5k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 32.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  32.5k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  32.5k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  32.5k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   77|  32.5k|	return area->refcount;
   78|  32.5k|}

pool_alloconly_create:
  229|   667k|{
  230|   667k|	struct alloconly_pool apool, *new_apool;
  231|   667k|	size_t min_alloc = SIZEOF_POOLBLOCK +
  ------------------
  |  |  145|   667k|#define SIZEOF_POOLBLOCK (MEM_ALIGN(sizeof(struct pool_block)))
  |  |  ------------------
  |  |  |  |   22|   667k|	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  732|   667k|#define MEM_ALIGN_SIZE 8
  |  |  |  |  ------------------
  |  |  |  |               	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  732|   667k|#define MEM_ALIGN_SIZE 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  232|   667k|		MEM_ALIGN(sizeof(struct alloconly_pool) + SENTRY_COUNT);
  ------------------
  |  |   22|   667k|	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  ------------------
  |  |  |  |  732|   667k|#define MEM_ALIGN_SIZE 8
  |  |  ------------------
  |  |               	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  ------------------
  |  |  |  |  732|   667k|#define MEM_ALIGN_SIZE 8
  |  |  ------------------
  ------------------
  233|       |
  234|   667k|	(void) COMPILE_ERROR_IF_TRUE(POOL_ALLOCONLY_MAX_EXTRA >
  ------------------
  |  |  180|   667k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  ------------------
  |  |  |  |   11|   667k|#  define FALSE (!1)
  |  |  ------------------
  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  ------------------
  ------------------
  235|   667k|				     (SSIZE_T_MAX - POOL_MAX_ALLOC_SIZE));
  236|       |
  237|       |#ifdef DEBUG
  238|       |	min_alloc += MEM_ALIGN(strlen(name) + 1 + SENTRY_COUNT) +
  239|       |		sizeof(size_t)*2;
  240|       |#endif
  241|       |
  242|       |	/* create a fake alloconly_pool so we can call block_alloc() */
  243|   667k|	i_zero(&apool);
  ------------------
  |  |  249|   667k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|   667k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|   667k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  244|   667k|	apool.pool = static_alloconly_pool;
  245|   667k|	apool.refcount = 1;
  246|       |
  247|   667k|	if (size < min_alloc)
  ------------------
  |  Branch (247:6): [True: 0, False: 667k]
  ------------------
  248|      0|		size = nearest_power(size + min_alloc);
  249|   667k|	block_alloc(&apool, size);
  250|       |
  251|       |	/* now allocate the actual alloconly_pool from the created block */
  252|   667k|	new_apool = p_new(&apool.pool, struct alloconly_pool, 1);
  ------------------
  |  |   97|   667k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|   667k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|   667k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|   667k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|   667k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  253|   667k|	*new_apool = apool;
  254|       |#ifdef DEBUG
  255|       |	if (str_begins(name, MEMPOOL_GROWING, &name) ||
  256|       |	    getenv("DEBUG_SILENT") != NULL)
  257|       |		new_apool->disable_warning = TRUE;
  258|       |	new_apool->name = p_strdup(&new_apool->pool, name);
  259|       |
  260|       |	/* set base_size so p_clear() doesn't trash alloconly_pool structure. */
  261|       |	new_apool->base_size = new_apool->block->size - new_apool->block->left;
  262|       |	new_apool->block->last_alloc_size = 0;
  263|       |#endif
  264|       |	/* the first pool allocations must be from the first block */
  265|   667k|	i_assert(new_apool->block->prev == NULL);
  ------------------
  |  |  219|   667k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   667k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   667k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   667k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 667k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 667k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   667k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   667k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   667k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  266|       |
  267|   667k|	return &new_apool->pool;
  268|   667k|}
mempool-alloconly.c:block_alloc:
  356|   830k|{
  357|   830k|	struct pool_block *block;
  358|       |
  359|   830k|	i_assert(size > SIZEOF_POOLBLOCK);
  ------------------
  |  |  219|   830k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   830k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   830k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   830k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 830k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 830k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   830k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   830k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   830k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  360|   830k|	i_assert(size <= SSIZE_T_MAX);
  ------------------
  |  |  219|   830k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   830k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   830k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   830k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 830k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 830k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   830k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   830k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   830k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  361|       |
  362|   830k|	if (apool->block != NULL) {
  ------------------
  |  Branch (362:6): [True: 162k, False: 667k]
  ------------------
  363|       |		/* each block is at least twice the size of the previous one */
  364|   162k|		if (size <= apool->block->size)
  ------------------
  |  Branch (364:7): [True: 154k, False: 8.22k]
  ------------------
  365|   154k|			size += apool->block->size;
  366|       |
  367|       |		/* avoid crashing in nearest_power() if size is too large */
  368|   162k|		size = I_MIN(size, SSIZE_T_MAX);
  ------------------
  |  |   35|   162k|#define I_MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 162k, False: 0]
  |  |  ------------------
  ------------------
  369|   162k|		size = nearest_power(size);
  370|       |		/* nearest_power() could have grown size to SSIZE_T_MAX+1 */
  371|   162k|		size = I_MIN(size, SSIZE_T_MAX);
  ------------------
  |  |   35|   162k|#define I_MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 162k, False: 0]
  |  |  ------------------
  ------------------
  372|       |#ifdef DEBUG
  373|       |		if (!apool->disable_warning) {
  374|       |			/* i_debug() overwrites unallocated data in data
  375|       |			   stack, so make sure everything is allocated before
  376|       |			   calling it. */
  377|       |			t_buffer_alloc_last_full();
  378|       |			i_debug("Growing pool '%s' with: %zu",
  379|       |				  apool->name, size);
  380|       |		}
  381|       |#endif
  382|   162k|	}
  383|       |
  384|   830k|	block = calloc(size, 1);
  385|   830k|	if (unlikely(block == NULL)) {
  ------------------
  |  |  202|   830k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 830k]
  |  |  |  Branch (202:44): [True: 0, False: 830k]
  |  |  ------------------
  ------------------
  386|      0|		i_fatal_status(FATAL_OUTOFMEM, "block_alloc(%zu"
  387|      0|			       "): Out of memory", size);
  388|      0|	}
  389|   830k|	block->prev = apool->block;
  390|   830k|	apool->block = block;
  391|       |
  392|   830k|	block->size = size - SIZEOF_POOLBLOCK;
  ------------------
  |  |  145|   830k|#define SIZEOF_POOLBLOCK (MEM_ALIGN(sizeof(struct pool_block)))
  |  |  ------------------
  |  |  |  |   22|   830k|	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  732|   830k|#define MEM_ALIGN_SIZE 8
  |  |  |  |  ------------------
  |  |  |  |               	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  732|   830k|#define MEM_ALIGN_SIZE 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  393|   830k|	block->left = block->size;
  394|   830k|}
mempool-alloconly.c:pool_alloconly_unref:
  340|   667k|{
  341|   667k|	struct alloconly_pool *apool =
  342|   667k|		container_of(*pool, struct alloconly_pool, pool);
  ------------------
  |  |   30|   667k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|   667k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|   667k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|   667k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|   667k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|   667k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  343|       |
  344|       |	/* erase the pointer before freeing anything, as the pointer may
  345|       |	   exist inside the pool's memory area */
  346|   667k|	*pool = NULL;
  347|       |
  348|   667k|	if (--apool->refcount > 0)
  ------------------
  |  Branch (348:6): [True: 0, False: 667k]
  ------------------
  349|      0|		return;
  350|       |
  351|   667k|	pool_external_refs_unref(&apool->pool);
  352|   667k|	pool_alloconly_destroy(apool);
  353|   667k|}
mempool-alloconly.c:pool_alloconly_destroy:
  311|   667k|{
  312|       |	/* destroy all but the last block */
  313|   667k|	pool_alloconly_free_blocks_until_last(apool);
  314|       |
  315|       |	/* destroy the last block */
  316|   667k|	pool_alloconly_free_block(apool, apool->block);
  317|   667k|}
mempool-alloconly.c:pool_alloconly_free_blocks_until_last:
  297|   667k|{
  298|   667k|	struct pool_block *block;
  299|       |
  300|       |	/* destroy all blocks but the oldest, which contains the
  301|       |	   struct alloconly_pool allocation. */
  302|   830k|	while (apool->block->prev != NULL) {
  ------------------
  |  Branch (302:9): [True: 162k, False: 667k]
  ------------------
  303|   162k|		block = apool->block;
  304|   162k|		apool->block = block->prev;
  305|       |
  306|   162k|		pool_alloconly_free_block(apool, block);
  307|   162k|	}
  308|   667k|}
mempool-alloconly.c:pool_alloconly_free_block:
  283|   830k|{
  284|       |#ifdef DEBUG
  285|       |	safe_memset(block, CLEAR_CHR, SIZEOF_POOLBLOCK + block->size);
  286|       |#else
  287|   830k|	if (apool->clean_frees) {
  ------------------
  |  Branch (287:6): [True: 0, False: 830k]
  ------------------
  288|      0|		safe_memset(block, CLEAR_CHR,
  ------------------
  |  |  157|      0|#  define CLEAR_CHR 0
  ------------------
  289|      0|			    SIZEOF_POOLBLOCK + block->size);
  ------------------
  |  |  145|      0|#define SIZEOF_POOLBLOCK (MEM_ALIGN(sizeof(struct pool_block)))
  |  |  ------------------
  |  |  |  |   22|      0|	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  732|      0|#define MEM_ALIGN_SIZE 8
  |  |  |  |  ------------------
  |  |  |  |               	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  732|      0|#define MEM_ALIGN_SIZE 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  290|      0|	}
  291|   830k|#endif
  292|   830k|	free(block);
  293|   830k|}
mempool-alloconly.c:pool_alloconly_malloc:
  397|  5.66M|{
  398|  5.66M|	struct alloconly_pool *apool =
  399|  5.66M|		container_of(pool, struct alloconly_pool, pool);
  ------------------
  |  |   30|  5.66M|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  5.66M|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  5.66M|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  5.66M|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  5.66M|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  5.66M|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  400|  5.66M|	void *mem;
  401|  5.66M|	size_t alloc_size;
  402|       |
  403|  5.66M|#ifndef DEBUG
  404|  5.66M|	alloc_size = MEM_ALIGN(size);
  ------------------
  |  |   22|  5.66M|	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  ------------------
  |  |  |  |  732|  5.66M|#define MEM_ALIGN_SIZE 8
  |  |  ------------------
  |  |               	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  ------------------
  |  |  |  |  732|  5.66M|#define MEM_ALIGN_SIZE 8
  |  |  ------------------
  ------------------
  405|       |#else
  406|       |	alloc_size = MEM_ALIGN(sizeof(size)) + MEM_ALIGN(size + SENTRY_COUNT);
  407|       |#endif
  408|       |
  409|  5.66M|	if (apool->block->left < alloc_size) {
  ------------------
  |  Branch (409:6): [True: 162k, False: 5.49M]
  ------------------
  410|       |		/* we need a new block */
  411|   162k|		block_alloc(apool, alloc_size + SIZEOF_POOLBLOCK);
  ------------------
  |  |  145|   162k|#define SIZEOF_POOLBLOCK (MEM_ALIGN(sizeof(struct pool_block)))
  |  |  ------------------
  |  |  |  |   22|   162k|	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  732|   162k|#define MEM_ALIGN_SIZE 8
  |  |  |  |  ------------------
  |  |  |  |               	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  732|   162k|#define MEM_ALIGN_SIZE 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  412|   162k|	}
  413|       |
  414|  5.66M|	mem = POOL_BLOCK_DATA(apool->block) +
  ------------------
  |  |  148|  5.66M|	((unsigned char *) (block) + SIZEOF_POOLBLOCK)
  |  |  ------------------
  |  |  |  |  145|  5.66M|#define SIZEOF_POOLBLOCK (MEM_ALIGN(sizeof(struct pool_block)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  5.66M|	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  732|  5.66M|#define MEM_ALIGN_SIZE 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  732|  5.66M|#define MEM_ALIGN_SIZE 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  415|  5.66M|		(apool->block->size - apool->block->left);
  416|       |
  417|  5.66M|	apool->block->left -= alloc_size;
  418|  5.66M|	apool->block->last_alloc_size = alloc_size;
  419|       |#ifdef DEBUG
  420|       |	memcpy(mem, &size, sizeof(size));
  421|       |	mem = PTR_OFFSET(mem, MEM_ALIGN(sizeof(size)));
  422|       |	/* write CLEAR_CHRs to sentry */
  423|       |	memset(PTR_OFFSET(mem, size), CLEAR_CHR,
  424|       |	       MEM_ALIGN(size + SENTRY_COUNT) - size);
  425|       |#endif
  426|  5.66M|	return mem;
  427|  5.66M|}
mempool-alloconly.c:pool_alloconly_realloc:
  465|    617|{
  466|    617|	struct alloconly_pool *apool =
  467|    617|		container_of(pool, struct alloconly_pool, pool);
  ------------------
  |  |   30|    617|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|    617|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|    617|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|    617|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|    617|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|    617|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  468|    617|	unsigned char *new_mem;
  469|       |
  470|    617|	if (new_size <= old_size)
  ------------------
  |  Branch (470:6): [True: 0, False: 617]
  ------------------
  471|      0|		return mem;
  472|       |
  473|    617|	new_size = MEM_ALIGN(new_size);
  ------------------
  |  |   22|    617|	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  ------------------
  |  |  |  |  732|    617|#define MEM_ALIGN_SIZE 8
  |  |  ------------------
  |  |               	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  ------------------
  |  |  |  |  732|    617|#define MEM_ALIGN_SIZE 8
  |  |  ------------------
  ------------------
  474|       |
  475|       |	/* see if we can directly grow it */
  476|    617|	if (!pool_alloconly_try_grow(apool, mem, new_size)) {
  ------------------
  |  Branch (476:6): [True: 23, False: 594]
  ------------------
  477|       |		/* slow way - allocate + copy */
  478|     23|		new_mem = pool_alloconly_malloc(pool, new_size);
  479|     23|		if (old_size > 0)
  ------------------
  |  Branch (479:7): [True: 23, False: 0]
  ------------------
  480|     23|			memcpy(new_mem, mem, old_size);
  ------------------
  |  |   84|     23|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
  481|     23|		mem = new_mem;
  482|     23|	}
  483|       |
  484|    617|	return mem;
  485|    617|}
mempool-alloconly.c:pool_alloconly_try_grow:
  445|    617|{
  446|       |	/* see if we want to grow the memory we allocated last */
  447|    617|	if (POOL_BLOCK_DATA(apool->block) +
  ------------------
  |  |  148|    617|	((unsigned char *) (block) + SIZEOF_POOLBLOCK)
  |  |  ------------------
  |  |  |  |  145|    617|#define SIZEOF_POOLBLOCK (MEM_ALIGN(sizeof(struct pool_block)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    617|	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  732|    617|#define MEM_ALIGN_SIZE 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(((size) + MEM_ALIGN_SIZE-1) & ~((size_t) MEM_ALIGN_SIZE-1))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  732|    617|#define MEM_ALIGN_SIZE 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (447:6): [True: 617, False: 0]
  ------------------
  448|    617|	    (apool->block->size - apool->block->left -
  449|    617|	     apool->block->last_alloc_size) == mem) {
  450|       |		/* yeah, see if we can grow */
  451|    617|		if (apool->block->left >= size-apool->block->last_alloc_size) {
  ------------------
  |  Branch (451:7): [True: 594, False: 23]
  ------------------
  452|       |			/* just shrink the available size */
  453|    594|			apool->block->left -=
  454|    594|				size - apool->block->last_alloc_size;
  455|    594|			apool->block->last_alloc_size = size;
  456|    594|			return TRUE;
  ------------------
  |  |   15|    594|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|    594|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  457|    594|		}
  458|    617|	}
  459|       |
  460|     23|	return FALSE;
  ------------------
  |  |   11|     23|#  define FALSE (!1)
  ------------------
  461|    617|}
mempool-alloconly.c:pool_alloconly_get_max_easy_alloc_size:
  513|    617|{
  514|    617|	struct alloconly_pool *apool =
  515|    617|		container_of(pool, struct alloconly_pool, pool);
  ------------------
  |  |   30|    617|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|    617|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|    617|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|    617|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|    617|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|    617|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  516|       |
  517|    617|	return apool->block->left;
  518|    617|}

pool_datastack_create:
   98|   293k|{
   99|   293k|	struct datastack_pool *dpool;
  100|       |
  101|   293k|	dpool = t_new(struct datastack_pool, 1);
  ------------------
  |  |  126|   293k|	((type *) t_malloc0(MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|   293k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |  127|   293k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|   293k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|   293k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  102|   293k|	dpool->pool = static_data_stack_pool;
  103|   293k|	dpool->refcount = 1;
  104|   293k|	dpool->data_stack_frame = data_stack_frame_id;
  105|   293k|	return &dpool->pool;
  106|   293k|}
mempool-datastack.c:pool_data_stack_malloc:
  139|   405k|{
  140|   405k|	struct datastack_pool *dpool =
  141|   405k|		container_of(pool, struct datastack_pool, pool);
  ------------------
  |  |   30|   405k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|   405k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|   405k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|   405k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|   405k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|   405k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  142|       |
  143|   405k|	if (unlikely(dpool->data_stack_frame != data_stack_frame_id))
  ------------------
  |  |  202|   405k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 405k]
  |  |  |  Branch (202:44): [True: 0, False: 405k]
  |  |  ------------------
  ------------------
  144|      0|		i_panic("pool_data_stack_malloc(): stack frame changed");
  145|       |
  146|   405k|	return t_malloc0(size);
  147|   405k|}
mempool-datastack.c:pool_data_stack_realloc:
  160|  5.92k|{
  161|  5.92k|	struct datastack_pool *dpool =
  162|  5.92k|		container_of(pool, struct datastack_pool, pool);
  ------------------
  |  |   30|  5.92k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  5.92k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  5.92k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  5.92k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  5.92k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  5.92k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  163|  5.92k|	void *new_mem;
  164|       |
  165|       |	/* @UNSAFE */
  166|  5.92k|	if (unlikely(dpool->data_stack_frame != data_stack_frame_id))
  ------------------
  |  |  202|  5.92k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 5.92k]
  |  |  |  Branch (202:44): [True: 0, False: 5.92k]
  |  |  ------------------
  ------------------
  167|      0|		i_panic("pool_data_stack_realloc(): stack frame changed");
  168|       |
  169|  5.92k|	if (old_size >= new_size)
  ------------------
  |  Branch (169:6): [True: 0, False: 5.92k]
  ------------------
  170|      0|		return mem;
  171|       |
  172|  5.92k|	if (!t_try_realloc(mem, new_size)) {
  ------------------
  |  Branch (172:6): [True: 154, False: 5.77k]
  ------------------
  173|    154|		new_mem = t_malloc_no0(new_size);
  174|    154|		if (old_size > 0)
  ------------------
  |  Branch (174:7): [True: 154, False: 0]
  ------------------
  175|    154|			memcpy(new_mem, mem, old_size);
  ------------------
  |  |   84|    154|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
  176|    154|		mem = new_mem;
  177|    154|	}
  178|       |
  179|  5.92k|	memset((char *) mem + old_size, 0, new_size - old_size);
  180|  5.92k|	return mem;
  181|  5.92k|}
mempool-datastack.c:pool_data_stack_get_max_easy_alloc_size:
  189|  5.92k|{
  190|  5.92k|	return t_get_bytes_available();
  191|  5.92k|}

pool_system_free:
  118|  1.10M|{
  119|       |#ifdef DEBUG
  120|       |	int old_errno = errno;
  121|       |#endif
  122|       |#if defined(HAVE_MALLOC_USABLE_SIZE) && defined(DEBUG)
  123|       |	safe_memset(mem, CLEAR_CHR, malloc_usable_size(mem));
  124|       |#endif
  125|  1.10M|	free(mem);
  126|       |#ifdef DEBUG
  127|       |	/* we rely on errno not changing. it shouldn't. */
  128|       |	i_assert(errno == old_errno);
  129|       |#endif
  130|  1.10M|}
mempool-system.c:pool_system_malloc:
   99|  1.10M|{
  100|  1.10M|	void *mem;
  101|       |#ifdef DEBUG
  102|       |	int old_errno = errno;
  103|       |#endif
  104|       |
  105|  1.10M|	mem = calloc(size, 1);
  106|  1.10M|	if (unlikely(mem == NULL)) {
  ------------------
  |  |  202|  1.10M|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 1.10M]
  |  |  |  Branch (202:44): [True: 0, False: 1.10M]
  |  |  ------------------
  ------------------
  107|      0|		i_fatal_status(FATAL_OUTOFMEM, "pool_system_malloc(%zu): "
  108|      0|			       "Out of memory", size);
  109|      0|	}
  110|       |#ifdef DEBUG
  111|       |	/* we rely on errno not changing. it shouldn't. */
  112|       |	i_assert(errno == old_errno);
  113|       |#endif
  114|  1.10M|	return mem;
  115|  1.10M|}

mempool-unsafe-datastack.c:pool_unsafe_data_stack_malloc:
   98|  95.6k|{
   99|  95.6k|	return t_malloc0(size);
  100|  95.6k|}
mempool-unsafe-datastack.c:pool_unsafe_data_stack_realloc:
  110|  5.22k|{
  111|  5.22k|	void *new_mem;
  112|       |
  113|       |	/* @UNSAFE */
  114|  5.22k|	if (old_size >= new_size)
  ------------------
  |  Branch (114:6): [True: 0, False: 5.22k]
  ------------------
  115|      0|		return mem;
  116|       |
  117|  5.22k|	if (!t_try_realloc(mem, new_size)) {
  ------------------
  |  Branch (117:6): [True: 95, False: 5.12k]
  ------------------
  118|     95|		new_mem = t_malloc_no0(new_size);
  119|     95|		if (old_size > 0)
  ------------------
  |  Branch (119:7): [True: 95, False: 0]
  ------------------
  120|     95|			memcpy(new_mem, mem, old_size);
  ------------------
  |  |   84|     95|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
  121|     95|		mem = new_mem;
  122|     95|	}
  123|       |
  124|  5.22k|	memset((char *) mem + old_size, 0, new_size - old_size);
  125|  5.22k|	return mem;
  126|  5.22k|}

pool_get_exp_grown_size:
   14|  6.54k|{
   15|  6.54k|	size_t exp_size, easy_size;
   16|       |
   17|  6.54k|	i_assert(old_size < min_size);
  ------------------
  |  |  219|  6.54k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.54k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.54k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.54k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.54k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.54k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.54k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.54k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   18|       |
   19|  6.54k|	exp_size = nearest_power(min_size);
   20|  6.54k|	easy_size = old_size + p_get_max_easy_alloc_size(pool);
   21|       |
   22|  6.54k|	if (easy_size < exp_size && easy_size >= min_size)
  ------------------
  |  Branch (22:6): [True: 160, False: 6.38k]
  |  Branch (22:30): [True: 105, False: 55]
  ------------------
   23|    105|		exp_size = easy_size;
   24|  6.54k|	i_assert(exp_size >= min_size);
  ------------------
  |  |  219|  6.54k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.54k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.54k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.54k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.54k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.54k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.54k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.54k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   25|  6.54k|	return exp_size;
   26|  6.54k|}
pool_external_refs_unref:
   37|   667k|{
   38|   667k|	if (array_is_created(&pool->external_refs)) {
  ------------------
  |  |  176|   667k|	array_is_created_i(&(array)->arr)
  |  |  ------------------
  |  |  |  Branch (176:2): [True: 0, False: 667k]
  |  |  ------------------
  ------------------
   39|      0|		pool_t external_pool;
   40|      0|		array_foreach_elem(&pool->external_refs, external_pool)
  ------------------
  |  |  111|      0|	for (const void *_foreach_end = \
  |  |  112|      0|		CONST_PTR_OFFSET(*(array)->v, (array)->arr.buffer->used), \
  |  |  ------------------
  |  |  |  |   27|      0|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  |  |  113|      0|	     *_foreach_ptr = CONST_PTR_OFFSET(*(array)->v, ARRAY_TYPE_CHECK(array, &elem) + \
  |  |  ------------------
  |  |  |  |   27|      0|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  |  Branch (27:52): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  114|      0|		COMPILE_ERROR_IF_TRUE(sizeof(elem) > sizeof(void *))) \
  |  |  115|      0|		     ;							\
  |  |  116|      0|	     (_foreach_ptr != _foreach_end &&		\
  |  |  ------------------
  |  |  |  Branch (116:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  117|      0|	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   84|      0|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  |  |  ------------------
  |  |               	     (memcpy(&elem, _foreach_ptr, sizeof(elem)), TRUE)) \
  |  |  ------------------
  |  |  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (117:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  118|      0|		;							\
  |  |  119|      0|	     _foreach_ptr = CONST_PTR_OFFSET(_foreach_ptr, sizeof(elem)))
  |  |  ------------------
  |  |  |  |   27|      0|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  |  |  ------------------
  ------------------
   41|      0|			pool_unref(&external_pool);
   42|      0|		array_free(&pool->external_refs);
  ------------------
  |  |  160|      0|	array_free_i(&(array)->arr)
  ------------------
   43|      0|	}
   44|   667k|}

smtp-server-cmd-data.c:p_malloc:
  108|  21.0k|{
  109|  21.0k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  42.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 21.0k]
  |  |  |  Branch (202:45): [True: 0, False: 21.0k]
  |  |  |  Branch (202:45): [True: 0, False: 21.0k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  21.0k|	return pool->v->malloc(pool, size);
  113|  21.0k|}
smtp-server-reply.c:p_malloc:
  108|   115k|{
  109|   115k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|   231k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 115k]
  |  |  |  Branch (202:45): [True: 0, False: 115k]
  |  |  |  Branch (202:45): [True: 0, False: 115k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|   115k|	return pool->v->malloc(pool, size);
  113|   115k|}
smtp-server-command.c:pool_unref:
  164|   116k|{
  165|   116k|	if (*pool != NULL)
  ------------------
  |  |   14|   116k|#  define NULL ((void *)0)
  ------------------
  |  Branch (165:6): [True: 116k, False: 0]
  ------------------
  166|   116k|		(*pool)->v->unref(pool);
  167|   116k|}
smtp-server-command.c:p_malloc:
  108|   246k|{
  109|   246k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|   492k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 246k]
  |  |  |  Branch (202:45): [True: 0, False: 246k]
  |  |  |  Branch (202:45): [True: 0, False: 246k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|   246k|	return pool->v->malloc(pool, size);
  113|   246k|}
smtp-server-recipient.c:p_malloc:
  108|  12.1k|{
  109|  12.1k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  24.3k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 12.1k]
  |  |  |  Branch (202:45): [True: 0, False: 12.1k]
  |  |  |  Branch (202:45): [True: 0, False: 12.1k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  12.1k|	return pool->v->malloc(pool, size);
  113|  12.1k|}
smtp-server-recipient.c:pool_unref:
  164|  12.1k|{
  165|  12.1k|	if (*pool != NULL)
  ------------------
  |  |   14|  12.1k|#  define NULL ((void *)0)
  ------------------
  |  Branch (165:6): [True: 12.1k, False: 0]
  ------------------
  166|  12.1k|		(*pool)->v->unref(pool);
  167|  12.1k|}
smtp-server-transaction.c:p_malloc:
  108|  4.54k|{
  109|  4.54k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  9.09k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 4.54k]
  |  |  |  Branch (202:45): [True: 0, False: 4.54k]
  |  |  |  Branch (202:45): [True: 0, False: 4.54k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  4.54k|	return pool->v->malloc(pool, size);
  113|  4.54k|}
smtp-server-transaction.c:pool_unref:
  164|  4.54k|{
  165|  4.54k|	if (*pool != NULL)
  ------------------
  |  |   14|  4.54k|#  define NULL ((void *)0)
  ------------------
  |  Branch (165:6): [True: 4.54k, False: 0]
  ------------------
  166|  4.54k|		(*pool)->v->unref(pool);
  167|  4.54k|}
smtp-server-connection.c:p_malloc:
  108|  6.21k|{
  109|  6.21k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  12.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  Branch (202:45): [True: 0, False: 6.21k]
  |  |  |  Branch (202:45): [True: 0, False: 6.21k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  6.21k|	return pool->v->malloc(pool, size);
  113|  6.21k|}
smtp-server-connection.c:p_free_internal:
  138|  72.0k|{
  139|  72.0k|	if (mem != NULL)
  ------------------
  |  |   14|  72.0k|#  define NULL ((void *)0)
  ------------------
  |  Branch (139:6): [True: 18.5k, False: 53.5k]
  ------------------
  140|  18.5k|		pool->v->free(pool, mem);
  141|  72.0k|}
smtp-server-connection.c:pool_unref:
  164|  6.21k|{
  165|  6.21k|	if (*pool != NULL)
  ------------------
  |  |   14|  6.21k|#  define NULL ((void *)0)
  ------------------
  |  Branch (165:6): [True: 6.21k, False: 0]
  ------------------
  166|  6.21k|		(*pool)->v->unref(pool);
  167|  6.21k|}
smtp-server.c:p_malloc:
  108|  6.21k|{
  109|  6.21k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  12.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  Branch (202:45): [True: 0, False: 6.21k]
  |  |  |  Branch (202:45): [True: 0, False: 6.21k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  6.21k|	return pool->v->malloc(pool, size);
  113|  6.21k|}
smtp-server.c:pool_unref:
  164|  6.21k|{
  165|  6.21k|	if (*pool != NULL)
  ------------------
  |  |   14|  6.21k|#  define NULL ((void *)0)
  ------------------
  |  Branch (165:6): [True: 6.21k, False: 0]
  ------------------
  166|  6.21k|		(*pool)->v->unref(pool);
  167|  6.21k|}
smtp-address.c:p_malloc:
  108|  49.7k|{
  109|  49.7k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  99.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 49.7k]
  |  |  |  Branch (202:45): [True: 0, False: 49.7k]
  |  |  |  Branch (202:45): [True: 0, False: 49.7k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  49.7k|	return pool->v->malloc(pool, size);
  113|  49.7k|}
smtp-command-parser.c:p_malloc:
  108|  6.21k|{
  109|  6.21k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  12.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  Branch (202:45): [True: 0, False: 6.21k]
  |  |  |  Branch (202:45): [True: 0, False: 6.21k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  6.21k|	return pool->v->malloc(pool, size);
  113|  6.21k|}
smtp-command-parser.c:p_free_internal:
  138|   398k|{
  139|   398k|	if (mem != NULL)
  ------------------
  |  |   14|   398k|#  define NULL ((void *)0)
  ------------------
  |  Branch (139:6): [True: 209k, False: 189k]
  ------------------
  140|   209k|		pool->v->free(pool, mem);
  141|   398k|}
smtp-server-cmd-helo.c:p_malloc:
  108|  7.24k|{
  109|  7.24k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  14.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 7.24k]
  |  |  |  Branch (202:45): [True: 0, False: 7.24k]
  |  |  |  Branch (202:45): [True: 0, False: 7.24k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  7.24k|	return pool->v->malloc(pool, size);
  113|  7.24k|}
smtp-server-cmd-helo.c:p_free_internal:
  138|  7.24k|{
  139|  7.24k|	if (mem != NULL)
  ------------------
  |  |   14|  7.24k|#  define NULL ((void *)0)
  ------------------
  |  Branch (139:6): [True: 1.79k, False: 5.45k]
  ------------------
  140|  1.79k|		pool->v->free(pool, mem);
  141|  7.24k|}
smtp-server-cmd-mail.c:p_malloc:
  108|  12.6k|{
  109|  12.6k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  25.2k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 12.6k]
  |  |  |  Branch (202:45): [True: 0, False: 12.6k]
  |  |  |  Branch (202:45): [True: 0, False: 12.6k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  12.6k|	return pool->v->malloc(pool, size);
  113|  12.6k|}
smtp-server-cmd-rcpt.c:p_malloc:
  108|  12.1k|{
  109|  12.1k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  24.3k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 12.1k]
  |  |  |  Branch (202:45): [True: 0, False: 12.1k]
  |  |  |  Branch (202:45): [True: 0, False: 12.1k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  12.1k|	return pool->v->malloc(pool, size);
  113|  12.1k|}
istream-dot.c:p_malloc:
  108|  1.55k|{
  109|  1.55k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  3.10k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 1.55k]
  |  |  |  Branch (202:45): [True: 0, False: 1.55k]
  |  |  |  Branch (202:45): [True: 0, False: 1.55k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  1.55k|	return pool->v->malloc(pool, size);
  113|  1.55k|}
buffer.c:p_malloc:
  108|  1.72M|{
  109|  1.72M|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  3.45M|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 1.72M]
  |  |  |  Branch (202:45): [True: 0, False: 1.72M]
  |  |  |  Branch (202:45): [True: 0, False: 1.72M]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  1.72M|	return pool->v->malloc(pool, size);
  113|  1.72M|}
buffer.c:p_free_internal:
  138|   283k|{
  139|   283k|	if (mem != NULL)
  ------------------
  |  |   14|   283k|#  define NULL ((void *)0)
  ------------------
  |  Branch (139:6): [True: 283k, False: 0]
  ------------------
  140|   283k|		pool->v->free(pool, mem);
  141|   283k|}
buffer.c:p_realloc:
  117|  6.54k|{
  118|  6.54k|	if (unlikely(new_size == 0 || new_size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  13.0k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 6.54k]
  |  |  |  Branch (202:45): [True: 0, False: 6.54k]
  |  |  |  Branch (202:45): [True: 0, False: 6.54k]
  |  |  ------------------
  ------------------
  119|      0|		i_panic("Trying to reallocate %zu -> %zu bytes",
  120|      0|			old_size, new_size);
  121|       |
  122|  6.54k|	if (mem == NULL)
  ------------------
  |  |   14|  6.54k|#  define NULL ((void *)0)
  ------------------
  |  Branch (122:6): [True: 0, False: 6.54k]
  ------------------
  123|      0|		return pool->v->malloc(pool, new_size);
  124|       |
  125|  6.54k|	return pool->v->realloc(pool, mem, old_size, new_size);
  126|  6.54k|}
connection.c:p_free_internal:
  138|  43.5k|{
  139|  43.5k|	if (mem != NULL)
  ------------------
  |  |   14|  43.5k|#  define NULL ((void *)0)
  ------------------
  |  Branch (139:6): [True: 18.6k, False: 24.8k]
  ------------------
  140|  18.6k|		pool->v->free(pool, mem);
  141|  43.5k|}
connection.c:p_malloc:
  108|  6.21k|{
  109|  6.21k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  12.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  Branch (202:45): [True: 0, False: 6.21k]
  |  |  |  Branch (202:45): [True: 0, False: 6.21k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  6.21k|	return pool->v->malloc(pool, size);
  113|  6.21k|}
hostpid.c:p_free_internal:
  138|      2|{
  139|      2|	if (mem != NULL)
  ------------------
  |  |   14|      2|#  define NULL ((void *)0)
  ------------------
  |  Branch (139:6): [True: 0, False: 2]
  ------------------
  140|      0|		pool->v->free(pool, mem);
  141|      2|}
imem.c:p_malloc:
  108|  8.82k|{
  109|  8.82k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  17.6k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 8.82k]
  |  |  |  Branch (202:45): [True: 0, False: 8.82k]
  |  |  |  Branch (202:45): [True: 0, False: 8.82k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  8.82k|	return pool->v->malloc(pool, size);
  113|  8.82k|}
imem.c:p_realloc:
  117|  12.1k|{
  118|  12.1k|	if (unlikely(new_size == 0 || new_size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  24.3k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 12.1k]
  |  |  |  Branch (202:45): [True: 0, False: 12.1k]
  |  |  |  Branch (202:45): [True: 0, False: 12.1k]
  |  |  ------------------
  ------------------
  119|      0|		i_panic("Trying to reallocate %zu -> %zu bytes",
  120|      0|			old_size, new_size);
  121|       |
  122|  12.1k|	if (mem == NULL)
  ------------------
  |  |   14|  12.1k|#  define NULL ((void *)0)
  ------------------
  |  Branch (122:6): [True: 12.1k, False: 0]
  ------------------
  123|  12.1k|		return pool->v->malloc(pool, new_size);
  124|       |
  125|      0|	return pool->v->realloc(pool, mem, old_size, new_size);
  126|  12.1k|}
iostream.c:p_free_internal:
  138|   175k|{
  139|   175k|	if (mem != NULL)
  ------------------
  |  |   14|   175k|#  define NULL ((void *)0)
  ------------------
  |  Branch (139:6): [True: 86.4k, False: 89.0k]
  ------------------
  140|  86.4k|		pool->v->free(pool, mem);
  141|   175k|}
iostream-pump.c:p_malloc:
  108|  6.21k|{
  109|  6.21k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  12.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  Branch (202:45): [True: 0, False: 6.21k]
  |  |  |  Branch (202:45): [True: 0, False: 6.21k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  6.21k|	return pool->v->malloc(pool, size);
  113|  6.21k|}
iostream-pump.c:p_free_internal:
  138|  6.21k|{
  139|  6.21k|	if (mem != NULL)
  ------------------
  |  |   14|  6.21k|#  define NULL ((void *)0)
  ------------------
  |  Branch (139:6): [True: 6.21k, False: 0]
  ------------------
  140|  6.21k|		pool->v->free(pool, mem);
  141|  6.21k|}
istream.c:p_free_internal:
  138|  36.6k|{
  139|  36.6k|	if (mem != NULL)
  ------------------
  |  |   14|  36.6k|#  define NULL ((void *)0)
  ------------------
  |  Branch (139:6): [True: 22.7k, False: 13.8k]
  ------------------
  140|  22.7k|		pool->v->free(pool, mem);
  141|  36.6k|}
istream.c:p_malloc:
  108|  2.93k|{
  109|  2.93k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  5.86k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 2.93k]
  |  |  |  Branch (202:45): [True: 0, False: 2.93k]
  |  |  |  Branch (202:45): [True: 0, False: 2.93k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  2.93k|	return pool->v->malloc(pool, size);
  113|  2.93k|}
istream-chain.c:p_malloc:
  108|  12.1k|{
  109|  12.1k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  24.3k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 12.1k]
  |  |  |  Branch (202:45): [True: 0, False: 12.1k]
  |  |  |  Branch (202:45): [True: 0, False: 12.1k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  12.1k|	return pool->v->malloc(pool, size);
  113|  12.1k|}
istream-chain.c:p_free_internal:
  138|  9.55k|{
  139|  9.55k|	if (mem != NULL)
  ------------------
  |  |   14|  9.55k|#  define NULL ((void *)0)
  ------------------
  |  Branch (139:6): [True: 9.55k, False: 0]
  ------------------
  140|  9.55k|		pool->v->free(pool, mem);
  141|  9.55k|}
istream-data.c:p_malloc:
  108|  6.21k|{
  109|  6.21k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  12.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  Branch (202:45): [True: 0, False: 6.21k]
  |  |  |  Branch (202:45): [True: 0, False: 6.21k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  6.21k|	return pool->v->malloc(pool, size);
  113|  6.21k|}
istream-failure-at.c:p_malloc:
  108|  1.55k|{
  109|  1.55k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  3.10k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 1.55k]
  |  |  |  Branch (202:45): [True: 0, False: 1.55k]
  |  |  |  Branch (202:45): [True: 0, False: 1.55k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  1.55k|	return pool->v->malloc(pool, size);
  113|  1.55k|}
istream-failure-at.c:p_free_internal:
  138|  1.55k|{
  139|  1.55k|	if (mem != NULL)
  ------------------
  |  |   14|  1.55k|#  define NULL ((void *)0)
  ------------------
  |  Branch (139:6): [True: 1.55k, False: 0]
  ------------------
  140|  1.55k|		pool->v->free(pool, mem);
  141|  1.55k|}
istream-file.c:p_malloc:
  108|  6.21k|{
  109|  6.21k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  12.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  Branch (202:45): [True: 0, False: 6.21k]
  |  |  |  Branch (202:45): [True: 0, False: 6.21k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  6.21k|	return pool->v->malloc(pool, size);
  113|  6.21k|}
istream-limit.c:p_malloc:
  108|  12.8k|{
  109|  12.8k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  25.6k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 12.8k]
  |  |  |  Branch (202:45): [True: 0, False: 12.8k]
  |  |  |  Branch (202:45): [True: 0, False: 12.8k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  12.8k|	return pool->v->malloc(pool, size);
  113|  12.8k|}
istream-sized.c:p_malloc:
  108|  12.8k|{
  109|  12.8k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  25.6k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 12.8k]
  |  |  |  Branch (202:45): [True: 0, False: 12.8k]
  |  |  |  Branch (202:45): [True: 0, False: 12.8k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  12.8k|	return pool->v->malloc(pool, size);
  113|  12.8k|}
ioloop.c:p_malloc:
  108|   143k|{
  109|   143k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|   287k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 143k]
  |  |  |  Branch (202:45): [True: 0, False: 143k]
  |  |  |  Branch (202:45): [True: 0, False: 143k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|   143k|	return pool->v->malloc(pool, size);
  113|   143k|}
ioloop.c:p_free_internal:
  138|  50.2k|{
  139|  50.2k|	if (mem != NULL)
  ------------------
  |  |   14|  50.2k|#  define NULL ((void *)0)
  ------------------
  |  Branch (139:6): [True: 50.2k, False: 0]
  ------------------
  140|  50.2k|		pool->v->free(pool, mem);
  141|  50.2k|}
ioloop-epoll.c:p_malloc:
  108|  18.6k|{
  109|  18.6k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  37.2k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 18.6k]
  |  |  |  Branch (202:45): [True: 0, False: 18.6k]
  |  |  |  Branch (202:45): [True: 0, False: 18.6k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  18.6k|	return pool->v->malloc(pool, size);
  113|  18.6k|}
ioloop-epoll.c:p_free_internal:
  138|   143k|{
  139|   143k|	if (mem != NULL)
  ------------------
  |  |   14|   143k|#  define NULL ((void *)0)
  ------------------
  |  Branch (139:6): [True: 112k, False: 31.0k]
  ------------------
  140|   112k|		pool->v->free(pool, mem);
  141|   143k|}
lib-event.c:p_free_internal:
  138|  2.68M|{
  139|  2.68M|	if (mem != NULL)
  ------------------
  |  |   14|  2.68M|#  define NULL ((void *)0)
  ------------------
  |  Branch (139:6): [True: 256k, False: 2.43M]
  ------------------
  140|   256k|		pool->v->free(pool, mem);
  141|  2.68M|}
lib-event.c:pool_unref:
  164|   522k|{
  165|   522k|	if (*pool != NULL)
  ------------------
  |  |   14|   522k|#  define NULL ((void *)0)
  ------------------
  |  Branch (165:6): [True: 522k, False: 0]
  ------------------
  166|   522k|		(*pool)->v->unref(pool);
  167|   522k|}
lib-event.c:p_malloc:
  108|   522k|{
  109|   522k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  1.04M|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 522k]
  |  |  |  Branch (202:45): [True: 0, False: 522k]
  |  |  |  Branch (202:45): [True: 0, False: 522k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|   522k|	return pool->v->malloc(pool, size);
  113|   522k|}
memarea.c:p_malloc:
  108|  8.82k|{
  109|  8.82k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  17.6k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 8.82k]
  |  |  |  Branch (202:45): [True: 0, False: 8.82k]
  |  |  |  Branch (202:45): [True: 0, False: 8.82k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  8.82k|	return pool->v->malloc(pool, size);
  113|  8.82k|}
memarea.c:p_free_internal:
  138|  8.82k|{
  139|  8.82k|	if (mem != NULL)
  ------------------
  |  |   14|  8.82k|#  define NULL ((void *)0)
  ------------------
  |  Branch (139:6): [True: 8.82k, False: 0]
  ------------------
  140|  8.82k|		pool->v->free(pool, mem);
  141|  8.82k|}
mempool.c:p_get_max_easy_alloc_size:
  149|  6.54k|{
  150|  6.54k|	return pool->v->get_max_easy_alloc_size(pool);
  151|  6.54k|}
mempool-alloconly.c:p_malloc:
  108|   667k|{
  109|   667k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  1.33M|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 667k]
  |  |  |  Branch (202:45): [True: 0, False: 667k]
  |  |  |  Branch (202:45): [True: 0, False: 667k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|   667k|	return pool->v->malloc(pool, size);
  113|   667k|}
ostream.c:p_free_internal:
  138|  12.4k|{
  139|  12.4k|	if (mem != NULL)
  ------------------
  |  |   14|  12.4k|#  define NULL ((void *)0)
  ------------------
  |  Branch (139:6): [True: 0, False: 12.4k]
  ------------------
  140|      0|		pool->v->free(pool, mem);
  141|  12.4k|}
ostream-file.c:p_free_internal:
  138|  12.4k|{
  139|  12.4k|	if (mem != NULL)
  ------------------
  |  |   14|  12.4k|#  define NULL ((void *)0)
  ------------------
  |  Branch (139:6): [True: 12.1k, False: 244]
  ------------------
  140|  12.1k|		pool->v->free(pool, mem);
  141|  12.4k|}
ostream-file.c:p_malloc:
  108|  12.4k|{
  109|  12.4k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  24.8k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 12.4k]
  |  |  |  Branch (202:45): [True: 0, False: 12.4k]
  |  |  |  Branch (202:45): [True: 0, False: 12.4k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  12.4k|	return pool->v->malloc(pool, size);
  113|  12.4k|}
priorityq.c:p_malloc:
  108|  6.21k|{
  109|  6.21k|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  12.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  Branch (202:45): [True: 0, False: 6.21k]
  |  |  |  Branch (202:45): [True: 0, False: 6.21k]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  6.21k|	return pool->v->malloc(pool, size);
  113|  6.21k|}
priorityq.c:p_free_internal:
  138|  6.21k|{
  139|  6.21k|	if (mem != NULL)
  ------------------
  |  |   14|  6.21k|#  define NULL ((void *)0)
  ------------------
  |  Branch (139:6): [True: 6.21k, False: 0]
  ------------------
  140|  6.21k|		pool->v->free(pool, mem);
  141|  6.21k|}
strfuncs.c:p_malloc:
  108|  3.57M|{
  109|  3.57M|	if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  7.14M|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 3.57M]
  |  |  |  Branch (202:45): [True: 0, False: 3.57M]
  |  |  |  Branch (202:45): [True: 0, False: 3.57M]
  |  |  ------------------
  ------------------
  110|      0|		i_panic("Trying to allocate %zu bytes", size);
  111|       |
  112|  3.57M|	return pool->v->malloc(pool, size);
  113|  3.57M|}
strfuncs.c:p_realloc:
  117|  5.22k|{
  118|  5.22k|	if (unlikely(new_size == 0 || new_size > POOL_MAX_ALLOC_SIZE))
  ------------------
  |  |  202|  10.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 5.22k]
  |  |  |  Branch (202:45): [True: 0, False: 5.22k]
  |  |  |  Branch (202:45): [True: 0, False: 5.22k]
  |  |  ------------------
  ------------------
  119|      0|		i_panic("Trying to reallocate %zu -> %zu bytes",
  120|      0|			old_size, new_size);
  121|       |
  122|  5.22k|	if (mem == NULL)
  ------------------
  |  |   14|  5.22k|#  define NULL ((void *)0)
  ------------------
  |  Branch (122:6): [True: 0, False: 5.22k]
  ------------------
  123|      0|		return pool->v->malloc(pool, new_size);
  124|       |
  125|  5.22k|	return pool->v->realloc(pool, mem, old_size, new_size);
  126|  5.22k|}

net_set_nonblock:
  379|  18.6k|{
  380|  18.6k|	fd_set_nonblock(fd, nonblock);
  381|  18.6k|}
net_set_tcp_nodelay:
  396|  6.21k|{
  397|  6.21k|	int val = nodelay;
  398|       |
  399|  6.21k|	return setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof(val));
  400|  6.21k|}
net_getsockname:
  746|  12.4k|{
  747|  12.4k|	union sockaddr_union so;
  748|  12.4k|	socklen_t addrlen;
  749|       |
  750|  12.4k|	i_assert(fd >= 0);
  ------------------
  |  |  219|  12.4k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  12.4k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  12.4k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  12.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 12.4k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 12.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  12.4k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  12.4k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.4k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  751|       |
  752|  12.4k|	i_zero(&so);
  ------------------
  |  |  249|  12.4k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  12.4k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  12.4k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  753|  12.4k|	addrlen = sizeof(so);
  754|  12.4k|	if (getsockname(fd, &so.sa, &addrlen) == -1)
  ------------------
  |  Branch (754:6): [True: 0, False: 12.4k]
  ------------------
  755|      0|		return -1;
  756|  12.4k|	if (so.sin.sin_family == AF_UNIX) {
  ------------------
  |  Branch (756:6): [True: 12.4k, False: 0]
  ------------------
  757|  12.4k|		if (addr != NULL)
  ------------------
  |  Branch (757:7): [True: 12.4k, False: 0]
  ------------------
  758|  12.4k|			i_zero(addr);
  ------------------
  |  |  249|  12.4k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  12.4k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  12.4k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  759|  12.4k|		if (port != NULL) *port = 0;
  ------------------
  |  Branch (759:7): [True: 0, False: 12.4k]
  ------------------
  760|  12.4k|	} else {
  761|      0|		if (addr != NULL) sin_get_ip(&so, addr);
  ------------------
  |  Branch (761:7): [True: 0, False: 0]
  ------------------
  762|      0|		if (port != NULL) *port = sin_get_port(&so);
  ------------------
  |  Branch (762:7): [True: 0, False: 0]
  ------------------
  763|      0|	}
  764|  12.4k|	return 0;
  765|  12.4k|}
net_getpeername:
  768|  6.21k|{
  769|  6.21k|	union sockaddr_union so;
  770|  6.21k|	socklen_t addrlen;
  771|       |
  772|  6.21k|	i_assert(fd >= 0);
  ------------------
  |  |  219|  6.21k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.21k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.21k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.21k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.21k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.21k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  773|       |
  774|  6.21k|	i_zero(&so);
  ------------------
  |  |  249|  6.21k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  775|  6.21k|	addrlen = sizeof(so);
  776|  6.21k|	if (getpeername(fd, &so.sa, &addrlen) == -1)
  ------------------
  |  Branch (776:6): [True: 0, False: 6.21k]
  ------------------
  777|      0|		return -1;
  778|  6.21k|	if (so.sin.sin_family == AF_UNIX) {
  ------------------
  |  Branch (778:6): [True: 6.21k, False: 0]
  ------------------
  779|  6.21k|		if (addr != NULL)
  ------------------
  |  Branch (779:7): [True: 6.21k, False: 0]
  ------------------
  780|  6.21k|			i_zero(addr);
  ------------------
  |  |  249|  6.21k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  781|  6.21k|		if (port != NULL) *port = 0;
  ------------------
  |  Branch (781:7): [True: 6.21k, False: 0]
  ------------------
  782|  6.21k|	} else {
  783|      0|		if (addr != NULL) sin_get_ip(&so, addr);
  ------------------
  |  Branch (783:7): [True: 0, False: 0]
  ------------------
  784|      0|		if (port != NULL) *port = sin_get_port(&so);
  ------------------
  |  Branch (784:7): [True: 0, False: 0]
  ------------------
  785|      0|	}
  786|  6.21k|	return 0;
  787|  6.21k|}
net_getunixcred:
  806|  6.21k|{
  807|  6.21k|#if defined(SO_PEERCRED)
  808|       |# if defined(HAVE_STRUCT_SOCKPEERCRED)
  809|       |	/* OpenBSD (may also provide getpeereid, but we also want pid) */
  810|       |	struct sockpeercred ucred;
  811|       |# else
  812|       |	/* Linux */
  813|  6.21k|	struct ucred ucred;
  814|  6.21k|# endif
  815|  6.21k|	socklen_t len = sizeof(ucred);
  816|       |
  817|  6.21k|	if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &ucred, &len) < 0) {
  ------------------
  |  Branch (817:6): [True: 0, False: 6.21k]
  ------------------
  818|      0|		i_error("getsockopt(SO_PEERCRED) failed: %m");
  819|      0|		return -1;
  820|      0|	}
  821|  6.21k|	cred_r->uid = ucred.uid;
  822|  6.21k|	cred_r->gid = ucred.gid;
  823|  6.21k|	cred_r->pid = ucred.pid;
  824|  6.21k|	return 0;
  825|       |#elif defined(LOCAL_PEEREID)
  826|       |	/* NetBSD (may also provide getpeereid, but we also want pid) */
  827|       |	struct unpcbid ucred;
  828|       |	socklen_t len = sizeof(ucred);
  829|       |
  830|       |	if (getsockopt(fd, 0, LOCAL_PEEREID, &ucred, &len) < 0) {
  831|       |		i_error("getsockopt(LOCAL_PEEREID) failed: %m");
  832|       |		return -1;
  833|       |	}
  834|       |
  835|       |	cred_r->uid = ucred.unp_euid;
  836|       |	cred_r->gid = ucred.unp_egid;
  837|       |	cred_r->pid = ucred.unp_pid;
  838|       |	return 0;
  839|       |#elif defined(HAVE_GETPEEREID)
  840|       |	/* OSX 10.4+, FreeBSD 4.6+, OpenBSD 3.0+, NetBSD 5.0+ */
  841|       |	if (getpeereid(fd, &cred_r->uid, &cred_r->gid) < 0) {
  842|       |		i_error("getpeereid() failed: %m");
  843|       |		return -1;
  844|       |	}
  845|       |	cred_r->pid = (pid_t)-1;
  846|       |	return 0;
  847|       |#elif defined(LOCAL_PEERCRED)
  848|       |	/* Older FreeBSD */
  849|       |	struct xucred ucred;
  850|       |	socklen_t len = sizeof(ucred);
  851|       |
  852|       |	if (getsockopt(fd, 0, LOCAL_PEERCRED, &ucred, &len) < 0) {
  853|       |		i_error("getsockopt(LOCAL_PEERCRED) failed: %m");
  854|       |		return -1;
  855|       |	}
  856|       |
  857|       |	if (ucred.cr_version != XUCRED_VERSION) {
  858|       |		errno = EINVAL;
  859|       |		return -1;
  860|       |	}
  861|       |
  862|       |	cred_r->uid = ucred.cr_uid;
  863|       |	cred_r->gid = ucred.cr_gid;
  864|       |	cred_r->pid = (pid_t)-1;
  865|       |	return 0;
  866|       |#elif defined(HAVE_GETPEERUCRED)
  867|       |	/* Solaris */
  868|       |	ucred_t *ucred = NULL;
  869|       |
  870|       |	if (getpeerucred(fd, &ucred) < 0) {
  871|       |		i_error("getpeerucred() failed: %m");
  872|       |		return -1;
  873|       |	}
  874|       |	cred_r->uid = ucred_geteuid(ucred);
  875|       |	cred_r->gid = ucred_getrgid(ucred);
  876|       |	cred_r->pid = ucred_getpid(ucred);
  877|       |	ucred_free(ucred);
  878|       |
  879|       |	if (cred_r->uid == (uid_t)-1 ||
  880|       |	    cred_r->gid == (gid_t)-1) {
  881|       |		errno = EINVAL;
  882|       |		return -1;
  883|       |	}
  884|       |	return 0;
  885|       |#elif defined(NEEDS_LOCAL_CREDS)
  886|       |	/* NetBSD < 5 */
  887|       |	int i, n, on;
  888|       |	struct iovec iov;
  889|       |	struct msghdr msg;
  890|       |	struct {
  891|       |		struct cmsghdr ch;
  892|       |		char buf[110];
  893|       |	} cdata;
  894|       |	struct sockcred *sc;
  895|       |
  896|       |	iov.iov_base = (char *)&on;
  897|       |	iov.iov_len = 1;
  898|       |
  899|       |	sc = (struct sockcred *)cdata.buf;
  900|       |	sc->sc_uid = sc->sc_euid = sc->sc_gid = sc->sc_egid = -1;
  901|       |	i_zero(&cdata.ch);
  902|       |
  903|       |	i_zero(&msg);
  904|       |
  905|       |	msg.msg_iov = &iov;
  906|       |	msg.msg_iovlen = 1;
  907|       |	msg.msg_control = &cdata;
  908|       |	msg.msg_controllen = sizeof(cdata.ch) + sizeof(cdata.buf);
  909|       |
  910|       |	for (i = 0; i < 10; i++) {
  911|       |		n = recvmsg(fd, &msg, MSG_WAITALL | MSG_PEEK);
  912|       |		if (n >= 0 || errno != EAGAIN)
  913|       |			break;
  914|       |		usleep(100);
  915|       |	}
  916|       |	if (n < 0) {
  917|       |		i_error("recvmsg() failed: %m");
  918|       |		return -1;
  919|       |	}
  920|       |	cred_r->uid = sc->sc_euid;
  921|       |	cred_r->gid = sc->sc_egid;
  922|       |	cred_r->pid = (pid_t)-1;
  923|       |	return 0;
  924|       |#else
  925|       |	errno = EINVAL;
  926|       |	return -1;
  927|       |#endif
  928|  6.21k|}
net_addr2ip:
  987|  1.99k|{
  988|  1.99k|	int ret;
  989|       |
  990|  1.99k|	if (net_addr2ip_inet4_fast(addr, ip_r))
  ------------------
  |  Branch (990:6): [True: 154, False: 1.84k]
  ------------------
  991|    154|		return 0;
  992|       |
  993|  1.99k|	T_BEGIN {
  ------------------
  |  |   68|  1.84k|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  1.84k|#  define STMT_START do
  |  |  ------------------
  |  |   69|  1.84k|		data_stack_frame_t _data_stack_cur_id = t_push(__FILE__ ":" T_XSTRING(__LINE__));
  |  |  ------------------
  |  |  |  |   66|  1.84k|#define T_XSTRING(x)	T_STRING(x)	/* expand and then stringify */
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|  1.84k|#define T_STRING(x)	#x
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  994|  1.84k|		if (strchr(addr, ':') != NULL) {
  ------------------
  |  Branch (994:7): [True: 167, False: 1.67k]
  ------------------
  995|    167|			if (addr[0] == '[') {
  ------------------
  |  Branch (995:8): [True: 0, False: 167]
  ------------------
  996|       |				/* allow [ipv6 addr] */
  997|      0|				size_t len = strlen(addr);
  998|      0|				if (addr[len-1] == ']')
  ------------------
  |  Branch (998:9): [True: 0, False: 0]
  ------------------
  999|      0|					addr = t_strndup(addr+1, len-2);
 1000|      0|			}
 1001|    167|		}
 1002|       |
 1003|  1.84k|		struct addrinfo *res = NULL;
 1004|  1.84k|		const struct addrinfo hints = {
 1005|  1.84k|			.ai_flags = AI_NUMERICHOST,
 1006|  1.84k|		};
 1007|  1.84k|		if ((ret = getaddrinfo(addr, NULL, &hints, &res)) == 0) {
  ------------------
  |  Branch (1007:7): [True: 528, False: 1.31k]
  ------------------
 1008|    528|			i_assert(res != NULL);
  ------------------
  |  |  219|    528|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    528|#  define STMT_START do
  |  |  ------------------
  |  |  220|    528|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    528|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 528]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 528]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    528|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    528|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    528|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1009|    528|			const union sockaddr_union *so =
 1010|    528|				(union sockaddr_union *)res->ai_addr;
 1011|    528|			sin_get_ip(so, ip_r);
 1012|    528|		}
 1013|  1.84k|		if (res != NULL)
  ------------------
  |  Branch (1013:7): [True: 528, False: 1.31k]
  ------------------
 1014|    528|			freeaddrinfo(res);
 1015|  1.84k|		ret = net_handle_gai_error("getaddrinfo", ret, TRUE);
  ------------------
  |  |   15|  1.84k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  1.84k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1016|  1.84k|	} T_END;
  ------------------
  |  |   71|  1.84k|	STMT_START { \
  |  |  ------------------
  |  |  |  |   63|  1.84k|#  define STMT_START do
  |  |  ------------------
  |  |   72|  1.84k|		if (unlikely(!t_pop(&_data_stack_cur_id))) \
  |  |  ------------------
  |  |  |  |  202|  1.84k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1.84k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1.84k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   73|  1.84k|			i_panic("Leaked t_pop() call"); \
  |  |   74|  1.84k|	} STMT_END; \
  |  |  ------------------
  |  |  |  |   64|  1.84k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   75|  1.84k|	} STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.84k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1017|  1.84k|	return ret != 0 ? -1 : 0;
  ------------------
  |  Branch (1017:9): [True: 1.31k, False: 528]
  ------------------
 1018|  1.84k|}
net.c:sin_get_ip:
  149|    528|{
  150|       |	/* IP structs may be sent across processes. Clear the whole struct
  151|       |	   first to make sure it won't leak any data across processes. */
  152|    528|	i_zero(ip);
  ------------------
  |  |  249|    528|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|    528|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|    528|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|       |
  154|    528|	ip->family = so->sin.sin_family;
  155|       |
  156|    528|	if (ip->family == AF_INET6) {
  ------------------
  |  Branch (156:6): [True: 66, False: 462]
  ------------------
  157|     66|		memcpy(&ip->u.ip6, &so->sin6.sin6_addr, sizeof(ip->u.ip6));
  ------------------
  |  |   84|     66|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
  158|     66|		ip->scope_id = so->sin6.sin6_scope_id;
  159|    462|	} else if (ip->family == AF_INET)
  ------------------
  |  Branch (159:13): [True: 462, False: 0]
  ------------------
  160|    462|		memcpy(&ip->u.ip4, &so->sin.sin_addr, sizeof(ip->u.ip4));
  ------------------
  |  |   84|    462|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
  161|      0|	else
  162|      0|		i_zero(&ip->u);
  ------------------
  |  |  249|      0|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  163|    528|}
net.c:net_handle_gai_error:
   54|  1.84k|{
   55|  1.84k|	if (gai_errno == 0)
  ------------------
  |  Branch (55:6): [True: 528, False: 1.31k]
  ------------------
   56|    528|		return 0;
   57|  1.31k|	switch (gai_errno) {
   58|       |	/* errors that are not logged */
   59|      0|#ifdef EAI_ADDRFAMILY
   60|      0|	case EAI_ADDRFAMILY:
  ------------------
  |  Branch (60:2): [True: 0, False: 1.31k]
  ------------------
   61|      0|#endif
   62|      0|	case EAI_FAMILY:
  ------------------
  |  Branch (62:2): [True: 0, False: 1.31k]
  ------------------
   63|      0|#ifdef EAI_NODATA
   64|      0|	case EAI_NODATA:
  ------------------
  |  Branch (64:2): [True: 0, False: 1.31k]
  ------------------
   65|      0|#endif
   66|  1.31k|	case EAI_NONAME:
  ------------------
  |  Branch (66:2): [True: 1.31k, False: 0]
  ------------------
   67|  1.31k|		break;
   68|      0|	case EAI_MEMORY:
  ------------------
  |  Branch (68:2): [True: 0, False: 1.31k]
  ------------------
   69|      0|		i_fatal_status(FATAL_OUTOFMEM, "%s() failed: %s",
   70|      0|			       function, gai_strerror(gai_errno));
   71|      0|	case EAI_SYSTEM:
  ------------------
  |  Branch (71:2): [True: 0, False: 1.31k]
  ------------------
   72|      0|		if (log)
  ------------------
  |  Branch (72:7): [True: 0, False: 0]
  ------------------
   73|      0|			i_error("%s() failed: %m", function);
   74|      0|		break;
   75|      0|	default:
  ------------------
  |  Branch (75:2): [True: 0, False: 1.31k]
  ------------------
   76|      0|		if (log)
  ------------------
  |  Branch (76:7): [True: 0, False: 0]
  ------------------
   77|      0|			i_error("%s() failed: %s", function,
   78|      0|				gai_strerror(gai_errno));
   79|      0|		break;
   80|  1.31k|	}
   81|  1.31k|	return gai_errno;
   82|  1.31k|}
net.c:net_addr2ip_inet4_fast:
  958|  1.99k|{
  959|  1.99k|	uint8_t *saddr = (void *)&ip->u.ip4.s_addr;
  960|  1.99k|	unsigned int i, num;
  961|       |
  962|  1.99k|	if (str_parse_uint(addr, &num, &addr) < 0)
  ------------------
  |  Branch (962:6): [True: 1.01k, False: 979]
  ------------------
  963|  1.01k|		return FALSE;
  ------------------
  |  |   11|  1.01k|#  define FALSE (!1)
  ------------------
  964|       |
  965|       |	/* try to parse as a.b.c.d */
  966|    979|	i = 0;
  967|  2.07k|	for (;;) {
  968|  2.07k|		if (num >= 256)
  ------------------
  |  Branch (968:7): [True: 394, False: 1.67k]
  ------------------
  969|    394|			return FALSE;
  ------------------
  |  |   11|    394|#  define FALSE (!1)
  ------------------
  970|  1.67k|		saddr[i] = num;
  971|  1.67k|		if (i == 3)
  ------------------
  |  Branch (971:7): [True: 256, False: 1.42k]
  ------------------
  972|    256|			break;
  973|  1.42k|		i++;
  974|  1.42k|		if (*addr != '.')
  ------------------
  |  Branch (974:7): [True: 158, False: 1.26k]
  ------------------
  975|    158|			return FALSE;
  ------------------
  |  |   11|    158|#  define FALSE (!1)
  ------------------
  976|  1.26k|		addr++;
  977|  1.26k|		if (str_parse_uint(addr, &num, &addr) < 0)
  ------------------
  |  Branch (977:7): [True: 171, False: 1.09k]
  ------------------
  978|    171|			return FALSE;
  ------------------
  |  |   11|    171|#  define FALSE (!1)
  ------------------
  979|  1.26k|	}
  980|    256|	if (*addr != '\0')
  ------------------
  |  Branch (980:6): [True: 102, False: 154]
  ------------------
  981|    102|		return FALSE;
  ------------------
  |  |   11|    102|#  define FALSE (!1)
  ------------------
  982|    154|	ip->family = AF_INET;
  983|    154|	return TRUE;
  ------------------
  |  |   15|    154|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|    154|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  984|    256|}

o_stream_file_close:
   56|  18.6k|{
   57|  18.6k|	struct file_ostream *fstream =
   58|  18.6k|		container_of(stream, struct file_ostream, ostream.iostream);
  ------------------
  |  |   30|  18.6k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  18.6k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  18.6k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  18.6k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  18.6k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  18.6k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
   59|       |
   60|  18.6k|	stream_closed(fstream);
   61|  18.6k|}
o_stream_file_writev:
  159|  39.1k|{
  160|  39.1k|	const char *syscall = NULL;
  161|  39.1k|	ssize_t ret;
  162|  39.1k|	size_t size, sent;
  163|  39.1k|	unsigned int i;
  164|       |
  165|  39.1k|	if (iov_count == 1) {
  ------------------
  |  Branch (165:6): [True: 39.1k, False: 0]
  ------------------
  166|  39.1k|		i_assert(iov->iov_len > 0);
  ------------------
  |  |  219|  39.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  39.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  39.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  39.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 39.1k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 39.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  39.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  39.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  39.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  167|       |
  168|  39.1k|		if (!fstream->file ||
  ------------------
  |  Branch (168:7): [True: 39.1k, False: 0]
  ------------------
  169|  39.1k|		    fstream->real_offset == fstream->buffer_offset) {
  ------------------
  |  Branch (169:7): [True: 0, False: 0]
  ------------------
  170|  39.1k|			syscall = "write";
  171|  39.1k|			ret = write(fstream->fd, iov->iov_base, iov->iov_len);
  172|  39.1k|			if (ret > 0)
  ------------------
  |  Branch (172:8): [True: 38.4k, False: 694]
  ------------------
  173|  38.4k|				fstream->real_offset += ret;
  174|  39.1k|		} else {
  175|      0|			syscall = "pwrite";
  176|      0|			ret = pwrite(fstream->fd, iov->iov_base, iov->iov_len,
  177|      0|				     fstream->buffer_offset);
  178|      0|		}
  179|  39.1k|	} else {
  180|      0|		if (o_stream_lseek(fstream) < 0) {
  ------------------
  |  Branch (180:7): [True: 0, False: 0]
  ------------------
  181|      0|			*error_r = t_strdup(o_stream_get_error(&fstream->ostream.ostream));
  182|      0|			return -1;
  183|      0|		}
  184|       |
  185|      0|		syscall = "writev";
  186|      0|		sent = 0;
  187|      0|		while (iov_count > IOV_MAX) {
  ------------------
  |  Branch (187:10): [True: 0, False: 0]
  ------------------
  188|      0|			size = 0;
  189|      0|			for (i = 0; i < IOV_MAX; i++)
  ------------------
  |  Branch (189:16): [True: 0, False: 0]
  ------------------
  190|      0|				size += iov[i].iov_len;
  191|       |
  192|      0|			ret = writev(fstream->fd, (const struct iovec *)iov,
  193|      0|				     IOV_MAX);
  194|      0|			if (ret != (ssize_t)size) {
  ------------------
  |  Branch (194:8): [True: 0, False: 0]
  ------------------
  195|      0|				break;
  196|      0|			}
  197|       |
  198|      0|			fstream->real_offset += ret;
  199|      0|			sent += ret;
  200|      0|			iov += IOV_MAX;
  201|      0|			iov_count -= IOV_MAX;
  202|      0|		}
  203|       |
  204|      0|		if (iov_count <= IOV_MAX) {
  ------------------
  |  Branch (204:7): [True: 0, False: 0]
  ------------------
  205|      0|			size = 0;
  206|      0|			for (i = 0; i < iov_count; i++)
  ------------------
  |  Branch (206:16): [True: 0, False: 0]
  ------------------
  207|      0|				size += iov[i].iov_len;
  208|       |
  209|      0|			ret = writev(fstream->fd, (const struct iovec *)iov,
  210|      0|				     iov_count);
  211|      0|			if (ret > 0)
  ------------------
  |  Branch (211:8): [True: 0, False: 0]
  ------------------
  212|      0|				fstream->real_offset += ret;
  213|      0|		}
  214|      0|		if (ret > 0)
  ------------------
  |  Branch (214:7): [True: 0, False: 0]
  ------------------
  215|      0|			ret += sent;
  216|      0|		else if (!fstream->file && sent > 0) {
  ------------------
  |  Branch (216:12): [True: 0, False: 0]
  |  Branch (216:30): [True: 0, False: 0]
  ------------------
  217|       |			/* return what we managed to get sent */
  218|      0|			ret = sent;
  219|      0|		}
  220|      0|	}
  221|  39.1k|	if (ret < 0) {
  ------------------
  |  Branch (221:6): [True: 694, False: 38.4k]
  ------------------
  222|    694|		i_assert(syscall != NULL);
  ------------------
  |  |  219|    694|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    694|#  define STMT_START do
  |  |  ------------------
  |  |  220|    694|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    694|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 694]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 694]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    694|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    694|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    694|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  223|    694|		*error_r = t_strdup_printf("%s() failed: %m", syscall);
  224|    694|	}
  225|  39.1k|	return ret;
  226|  39.1k|}
o_stream_file_sendv:
  610|   127k|{
  611|   127k|	struct file_ostream *fstream =
  612|   127k|		container_of(stream, struct file_ostream, ostream);
  ------------------
  |  |   30|   127k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|   127k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|   127k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|   127k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|   127k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|   127k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  613|   127k|	size_t size, total_size, added, optimal_size;
  614|   127k|	unsigned int i;
  615|   127k|	ssize_t ret = 0;
  616|       |
  617|   254k|	for (i = 0, size = 0; i < iov_count; i++)
  ------------------
  |  Branch (617:24): [True: 127k, False: 127k]
  ------------------
  618|   127k|		size += iov[i].iov_len;
  619|   127k|	total_size = size;
  620|       |
  621|   127k|	if (size > get_unused_space(fstream) && !IS_STREAM_EMPTY(fstream)) {
  ------------------
  |  |   27|  12.9k|	((fstream)->head == (fstream)->tail && !(fstream)->full)
  |  |  ------------------
  |  |  |  Branch (27:3): [True: 12.9k, False: 0]
  |  |  |  Branch (27:41): [True: 12.6k, False: 273]
  |  |  ------------------
  ------------------
  |  Branch (621:6): [True: 12.9k, False: 114k]
  ------------------
  622|    273|		if (o_stream_file_flush(stream) < 0)
  ------------------
  |  Branch (622:7): [True: 0, False: 273]
  ------------------
  623|      0|			return -1;
  624|    273|	}
  625|       |
  626|   127k|	optimal_size = I_MIN(fstream->optimal_block_size,
  ------------------
  |  |   35|   127k|#define I_MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 120k, False: 6.73k]
  |  |  ------------------
  ------------------
  627|   127k|			     fstream->ostream.max_buffer_size);
  628|   127k|	if (IS_STREAM_EMPTY(fstream) &&
  ------------------
  |  |   27|   254k|	((fstream)->head == (fstream)->tail && !(fstream)->full)
  |  |  ------------------
  |  |  |  Branch (27:3): [True: 38.4k, False: 88.9k]
  |  |  |  Branch (27:41): [True: 38.1k, False: 273]
  |  |  ------------------
  ------------------
  629|   127k|	    (!stream->corked || size >= optimal_size)) {
  ------------------
  |  Branch (629:7): [True: 263, False: 37.8k]
  |  Branch (629:26): [True: 664, False: 37.2k]
  ------------------
  630|       |		/* send immediately */
  631|    927|		ret = o_stream_file_writev_full(fstream, iov, iov_count);
  632|    927|		if (ret < 0)
  ------------------
  |  Branch (632:7): [True: 0, False: 927]
  ------------------
  633|      0|			return -1;
  634|       |
  635|    927|		size = ret;
  636|  1.50k|		while (size > 0 && iov_count > 0 && size >= iov[0].iov_len) {
  ------------------
  |  Branch (636:10): [True: 927, False: 580]
  |  Branch (636:22): [True: 927, False: 0]
  |  Branch (636:39): [True: 580, False: 347]
  ------------------
  637|    580|			size -= iov[0].iov_len;
  638|    580|			iov++;
  639|    580|			iov_count--;
  640|    580|		}
  641|       |
  642|    927|		if (iov_count == 0)
  ------------------
  |  Branch (642:7): [True: 580, False: 347]
  ------------------
  643|    927|			i_assert(size == 0);
  ------------------
  |  |  219|    580|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    580|#  define STMT_START do
  |  |  ------------------
  |  |  220|    580|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    580|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 580]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 580]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    580|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    580|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    580|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  644|    347|		else {
  645|    347|			added = o_stream_add(fstream,
  646|    347|					CONST_PTR_OFFSET(iov[0].iov_base, size),
  ------------------
  |  |   27|    347|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  ------------------
  647|    347|					iov[0].iov_len - size);
  648|    347|			ret += added;
  649|       |
  650|    347|			if (added != iov[0].iov_len - size) {
  ------------------
  |  Branch (650:8): [True: 273, False: 74]
  ------------------
  651|       |				/* buffer full */
  652|    273|				stream->ostream.offset += ret;
  653|    273|				return ret;
  654|    273|			}
  655|       |
  656|     74|			iov++;
  657|     74|			iov_count--;
  658|     74|		}
  659|    927|	}
  660|       |
  661|       |	/* buffer it, at least partly */
  662|   253k|	for (i = 0; i < iov_count; i++) {
  ------------------
  |  Branch (662:14): [True: 126k, False: 126k]
  ------------------
  663|   126k|		added = o_stream_add(fstream, iov[i].iov_base, iov[i].iov_len);
  664|   126k|		ret += added;
  665|   126k|		if (added != iov[i].iov_len)
  ------------------
  |  Branch (665:7): [True: 273, False: 126k]
  ------------------
  666|    273|			break;
  667|   126k|	}
  668|   127k|	stream->ostream.offset += ret;
  669|   127k|	i_assert((size_t)ret <= total_size);
  ------------------
  |  |  219|   127k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   127k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   127k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   127k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 127k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 127k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   127k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   127k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   127k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  670|   127k|	i_assert((size_t)ret == total_size || !fstream->file);
  ------------------
  |  |  219|   127k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   127k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   127k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   127k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 127k]
  |  |  |  |  |  Branch (202:45): [True: 126k, False: 273]
  |  |  |  |  |  Branch (202:45): [True: 273, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   127k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   127k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   127k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  671|   127k|	return ret;
  672|   127k|}
o_stream_create_file_common:
 1021|  12.4k|{
 1022|  12.4k|	struct ostream *ostream;
 1023|       |
 1024|  12.4k|	fstream->fd = fd;
 1025|  12.4k|	fstream->autoclose_fd = autoclose_fd;
 1026|  12.4k|	fstream->optimal_block_size = DEFAULT_OPTIMAL_BLOCK_SIZE;
  ------------------
  |  |   23|  12.4k|#define DEFAULT_OPTIMAL_BLOCK_SIZE IO_BLOCK_SIZE
  |  |  ------------------
  |  |  |  |  169|  12.4k|#  define IO_BLOCK_SIZE 8192
  |  |  ------------------
  ------------------
 1027|       |
 1028|  12.4k|	fstream->ostream.iostream.close = o_stream_file_close;
 1029|  12.4k|	fstream->ostream.iostream.destroy = o_stream_file_destroy;
 1030|       |
 1031|  12.4k|	fstream->ostream.cork = o_stream_file_cork;
 1032|  12.4k|	fstream->ostream.flush = o_stream_file_flush;
 1033|  12.4k|	fstream->ostream.flush_pending = o_stream_file_flush_pending;
 1034|  12.4k|	fstream->ostream.get_buffer_used_size =
 1035|  12.4k|		o_stream_file_get_buffer_used_size;
 1036|  12.4k|	fstream->ostream.seek = o_stream_file_seek;
 1037|  12.4k|	fstream->ostream.sendv = o_stream_file_sendv;
 1038|  12.4k|	fstream->ostream.write_at = o_stream_file_write_at;
 1039|  12.4k|	fstream->ostream.send_istream = o_stream_file_send_istream;
 1040|  12.4k|	fstream->ostream.switch_ioloop_to = o_stream_file_switch_ioloop_to;
 1041|       |
 1042|  12.4k|	fstream->writev = o_stream_file_writev;
 1043|       |
 1044|  12.4k|	fstream->ostream.max_buffer_size = max_buffer_size;
 1045|  12.4k|	ostream = o_stream_create(&fstream->ostream, NULL, fd);
 1046|       |
 1047|  12.4k|	if (max_buffer_size == 0)
  ------------------
  |  Branch (1047:6): [True: 0, False: 12.4k]
  ------------------
 1048|      0|		fstream->ostream.max_buffer_size = fstream->optimal_block_size;
 1049|       |
 1050|  12.4k|	return ostream;
 1051|  12.4k|}
o_stream_create_fd:
 1115|  12.4k|{
 1116|  12.4k|	return o_stream_create_fd_common(fd, max_buffer_size, FALSE);
  ------------------
  |  |   11|  12.4k|#  define FALSE (!1)
  ------------------
 1117|  12.4k|}
ostream-file.c:stream_closed:
   37|  18.6k|{
   38|  18.6k|	io_remove(&fstream->io);
   39|       |
   40|  18.6k|	if (fstream->autoclose_fd && fstream->fd != -1) {
  ------------------
  |  Branch (40:6): [True: 0, False: 18.6k]
  |  Branch (40:31): [True: 0, False: 0]
  ------------------
   41|       |		/* Ignore ECONNRESET because we don't really care about it here,
   42|       |		   as we are closing the socket down in any case. There might be
   43|       |		   unsent data but nothing we can do about that. */
   44|      0|		if (unlikely(close(fstream->fd) < 0 && errno != ECONNRESET)) {
  ------------------
  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   45|      0|			i_error("file_ostream.close(%s) failed: %m",
   46|      0|				o_stream_get_name(&fstream->ostream.ostream));
   47|      0|		}
   48|      0|	}
   49|  18.6k|	fstream->fd = -1;
   50|       |
   51|  18.6k|	fstream->ostream.ostream.closed = TRUE;
  ------------------
  |  |   15|  18.6k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  18.6k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   52|  18.6k|}
ostream-file.c:get_unused_space:
  445|   254k|{
  446|   254k|	if (fstream->head > fstream->tail) {
  ------------------
  |  Branch (446:6): [True: 0, False: 254k]
  ------------------
  447|       |		/* XXXT...HXXX */
  448|      0|		return fstream->head - fstream->tail;
  449|   254k|	} else if (fstream->head < fstream->tail) {
  ------------------
  |  Branch (449:13): [True: 177k, False: 76.2k]
  ------------------
  450|       |		/* ...HXXXT... */
  451|   177k|		return (fstream->buffer_size - fstream->tail) + fstream->head;
  452|   177k|	} else {
  453|       |		/* either fully unused or fully used */
  454|  76.2k|		return fstream->full ? 0 : fstream->buffer_size;
  ------------------
  |  Branch (454:10): [True: 546, False: 75.7k]
  ------------------
  455|  76.2k|	}
  456|   254k|}
ostream-file.c:o_stream_file_flush:
  422|  74.2k|{
  423|  74.2k|	struct file_ostream *fstream =
  424|  74.2k|		container_of(stream, struct file_ostream, ostream);
  ------------------
  |  |   30|  74.2k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  74.2k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  74.2k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  74.2k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  74.2k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  74.2k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  425|       |
  426|  74.2k|	return buffer_flush(fstream);
  427|  74.2k|}
ostream-file.c:buffer_flush:
  336|   116k|{
  337|   116k|	struct const_iovec iov[2];
  338|   116k|	int iov_len;
  339|   116k|	ssize_t ret;
  340|       |
  341|   116k|	iov_len = o_stream_fill_iovec(fstream, iov);
  342|   116k|	if (iov_len > 0) {
  ------------------
  |  Branch (342:6): [True: 38.2k, False: 78.0k]
  ------------------
  343|  38.2k|		ret = o_stream_file_writev_full(fstream, iov, iov_len);
  344|  38.2k|		if (ret < 0)
  ------------------
  |  Branch (344:7): [True: 0, False: 38.2k]
  ------------------
  345|      0|			return -1;
  346|       |
  347|  38.2k|		update_buffer(fstream, ret);
  348|  38.2k|	}
  349|       |
  350|   116k|	return IS_STREAM_EMPTY(fstream) ? 1 : 0;
  ------------------
  |  |   27|   116k|	((fstream)->head == (fstream)->tail && !(fstream)->full)
  |  |  ------------------
  |  |  |  Branch (27:3): [True: 116k, False: 138]
  |  |  |  Branch (27:41): [True: 115k, False: 556]
  |  |  ------------------
  ------------------
  351|   116k|}
ostream-file.c:o_stream_fill_iovec:
  314|   116k|{
  315|   116k|	if (IS_STREAM_EMPTY(fstream))
  ------------------
  |  |   27|   116k|	((fstream)->head == (fstream)->tail && !(fstream)->full)
  |  |  ------------------
  |  |  |  Branch (27:3): [True: 78.8k, False: 37.4k]
  |  |  |  Branch (27:41): [True: 78.0k, False: 809]
  |  |  ------------------
  ------------------
  316|  78.0k|		return 0;
  317|       |
  318|  38.2k|	if (fstream->head < fstream->tail) {
  ------------------
  |  Branch (318:6): [True: 37.4k, False: 809]
  ------------------
  319|  37.4k|		iov[0].iov_base = fstream->buffer + fstream->head;
  320|  37.4k|		iov[0].iov_len = fstream->tail - fstream->head;
  321|  37.4k|		return 1;
  322|  37.4k|	} else {
  323|    809|		iov[0].iov_base = fstream->buffer + fstream->head;
  324|    809|		iov[0].iov_len = fstream->buffer_size - fstream->head;
  325|    809|		if (fstream->tail == 0)
  ------------------
  |  Branch (325:7): [True: 809, False: 0]
  ------------------
  326|    809|			return 1;
  327|      0|		else {
  328|      0|			iov[1].iov_base = fstream->buffer;
  329|      0|			iov[1].iov_len = fstream->tail;
  330|      0|			return 2;
  331|      0|		}
  332|    809|	}
  333|  38.2k|}
ostream-file.c:update_buffer:
   86|  38.2k|{
   87|  38.2k|	size_t used;
   88|       |
   89|  38.2k|	if (IS_STREAM_EMPTY(fstream) || size == 0)
  ------------------
  |  |   27|  76.4k|	((fstream)->head == (fstream)->tail && !(fstream)->full)
  |  |  ------------------
  |  |  |  Branch (27:3): [True: 809, False: 37.4k]
  |  |  |  Branch (27:41): [True: 0, False: 809]
  |  |  ------------------
  ------------------
  |  Branch (89:34): [True: 694, False: 37.5k]
  ------------------
   90|    694|		return;
   91|       |
   92|  37.5k|	if (fstream->head < fstream->tail) {
  ------------------
  |  Branch (92:6): [True: 37.2k, False: 253]
  ------------------
   93|       |		/* ...HXXXT... */
   94|  37.2k|		used = fstream->tail - fstream->head;
   95|  37.2k|		i_assert(size <= used);
  ------------------
  |  |  219|  37.2k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  37.2k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  37.2k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  37.2k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 37.2k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 37.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  37.2k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  37.2k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  37.2k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   96|  37.2k|		fstream->head += size;
   97|  37.2k|	} else {
   98|       |		/* XXXT...HXXX */
   99|    253|		used = fstream->buffer_size - fstream->head;
  100|    253|		if (size > used) {
  ------------------
  |  Branch (100:7): [True: 0, False: 253]
  ------------------
  101|      0|			size -= used;
  102|      0|			i_assert(size <= fstream->tail);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  103|      0|			fstream->head = size;
  104|    253|		} else {
  105|    253|			fstream->head += size;
  106|    253|		}
  107|       |
  108|    253|		fstream->full = FALSE;
  ------------------
  |  |   11|    253|#  define FALSE (!1)
  ------------------
  109|    253|	}
  110|       |
  111|  37.5k|	if (fstream->head == fstream->tail)
  ------------------
  |  Branch (111:6): [True: 37.2k, False: 253]
  ------------------
  112|  37.2k|		fstream->head = fstream->tail = 0;
  113|       |
  114|  37.5k|	if (fstream->head == fstream->buffer_size)
  ------------------
  |  Branch (114:6): [True: 253, False: 37.2k]
  ------------------
  115|    253|		fstream->head = 0;
  116|  37.5k|}
ostream-file.c:o_stream_file_writev_full:
  232|  39.1k|{
  233|  39.1k|	const char *error = NULL;
  234|  39.1k|	ssize_t ret, ret2;
  235|  39.1k|	size_t size, total_size;
  236|  39.1k|	bool partial;
  237|  39.1k|	unsigned int i;
  238|       |
  239|  78.3k|	for (i = 0, total_size = 0; i < iov_count; i++)
  ------------------
  |  Branch (239:30): [True: 39.1k, False: 39.1k]
  ------------------
  240|  39.1k|		total_size += iov[i].iov_len;
  241|       |
  242|  39.1k|	o_stream_socket_cork(fstream);
  243|  39.1k|	ret = fstream->writev(fstream, iov, iov_count, &error);
  244|  39.1k|	partial = ret != (ssize_t)total_size;
  245|       |
  246|  39.1k|	if (ret < 0) {
  ------------------
  |  Branch (246:6): [True: 694, False: 38.4k]
  ------------------
  247|    694|		i_assert(error != NULL);
  ------------------
  |  |  219|    694|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    694|#  define STMT_START do
  |  |  ------------------
  |  |  220|    694|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    694|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 694]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 694]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    694|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    694|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    694|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  248|    694|		if (fstream->file) {
  ------------------
  |  Branch (248:7): [True: 0, False: 694]
  ------------------
  249|      0|			if (errno == EINTR) {
  ------------------
  |  Branch (249:8): [True: 0, False: 0]
  ------------------
  250|       |				/* automatically retry */
  251|      0|				return o_stream_file_writev_full(fstream, iov, iov_count);
  252|      0|			}
  253|    694|		} else if (errno == EAGAIN || errno == EINTR) {
  ------------------
  |  Branch (253:14): [True: 694, False: 0]
  |  Branch (253:33): [True: 0, False: 0]
  ------------------
  254|       |			/* try again later */
  255|    694|			return 0;
  256|    694|		}
  257|      0|		io_stream_set_error(&fstream->ostream.iostream, "%s", error);
  258|      0|		fstream->ostream.ostream.stream_errno = errno;
  259|      0|		stream_closed(fstream);
  260|      0|		return -1;
  261|    694|	}
  262|  38.4k|	if (unlikely(ret == 0 && fstream->file)) {
  ------------------
  |  |  202|  38.4k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 38.4k]
  |  |  |  Branch (202:45): [True: 0, False: 38.4k]
  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  263|       |		/* assume out of disk space */
  264|      0|		fstream->ostream.ostream.stream_errno = ENOSPC;
  265|      0|		stream_closed(fstream);
  266|      0|		return -1;
  267|      0|	}
  268|  38.4k|	fstream->buffer_offset += ret;
  269|  38.4k|	if (partial && fstream->file) {
  ------------------
  |  Branch (269:6): [True: 347, False: 38.1k]
  |  Branch (269:17): [True: 0, False: 347]
  ------------------
  270|       |		/* we failed to write everything to a file. either we ran out
  271|       |		   of disk space or we're writing to NFS. try to write the
  272|       |		   rest to resolve this. */
  273|      0|		size = ret;
  274|      0|		while (iov_count > 0 && size >= iov->iov_len) {
  ------------------
  |  Branch (274:10): [True: 0, False: 0]
  |  Branch (274:27): [True: 0, False: 0]
  ------------------
  275|      0|			size -= iov->iov_len;
  276|      0|			iov++;
  277|      0|			iov_count--;
  278|      0|		}
  279|      0|		i_assert(iov_count > 0);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  280|      0|		if (size == 0)
  ------------------
  |  Branch (280:7): [True: 0, False: 0]
  ------------------
  281|      0|			ret2 = o_stream_file_writev_full(fstream, iov, iov_count);
  282|      0|		else {
  283|       |			/* write the first iov separately */
  284|      0|			struct const_iovec new_iov;
  285|       |
  286|      0|			new_iov.iov_base =
  287|      0|				CONST_PTR_OFFSET(iov->iov_base, size);
  ------------------
  |  |   27|      0|	((const void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  ------------------
  288|      0|			new_iov.iov_len = iov->iov_len - size;
  289|      0|			ret2 = o_stream_file_writev_full(fstream, &new_iov, 1);
  290|      0|			if (ret2 > 0) {
  ------------------
  |  Branch (290:8): [True: 0, False: 0]
  ------------------
  291|      0|				i_assert((size_t)ret2 == new_iov.iov_len);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  292|       |				/* write the rest */
  293|      0|				if (iov_count > 1) {
  ------------------
  |  Branch (293:9): [True: 0, False: 0]
  ------------------
  294|      0|					ret += ret2;
  295|      0|					ret2 = o_stream_file_writev_full(fstream, iov + 1,
  296|      0|							       iov_count - 1);
  297|      0|				}
  298|      0|			}
  299|      0|		}
  300|      0|		i_assert(ret2 != 0);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  301|      0|		if (ret2 < 0)
  ------------------
  |  Branch (301:7): [True: 0, False: 0]
  ------------------
  302|      0|			ret = ret2;
  303|      0|		else
  304|      0|			ret += ret2;
  305|      0|	}
  306|  38.4k|	i_assert(ret < 0 || !fstream->file ||
  ------------------
  |  |  219|  38.4k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  38.4k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  38.4k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   115k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 38.4k]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 38.4k]
  |  |  |  |  |  Branch (202:45): [True: 38.4k, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  38.4k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  38.4k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  38.4k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  307|  38.4k|		 (size_t)ret == total_size);
  308|  38.4k|	return ret;
  309|  38.4k|}
ostream-file.c:o_stream_socket_cork:
  119|  39.1k|{
  120|  39.1k|	if (fstream->ostream.corked && !fstream->socket_cork_set) {
  ------------------
  |  Branch (120:6): [True: 38.8k, False: 337]
  |  Branch (120:33): [True: 38.8k, False: 0]
  ------------------
  121|  38.8k|		if (!fstream->no_socket_cork) {
  ------------------
  |  Branch (121:7): [True: 0, False: 38.8k]
  ------------------
  122|      0|			if (net_set_cork(fstream->fd, TRUE) < 0)
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  |  Branch (122:8): [True: 0, False: 0]
  ------------------
  123|      0|				fstream->no_socket_cork = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  124|      0|			else
  125|      0|				fstream->socket_cork_set = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  126|      0|		}
  127|  38.8k|	}
  128|  39.1k|}
ostream-file.c:o_stream_add:
  567|   126k|{
  568|   126k|	struct iostream_private *iostream = &fstream->ostream.iostream;
  569|   126k|	size_t unused, sent;
  570|   126k|	int i;
  571|       |
  572|   126k|	unused = get_unused_space(fstream);
  573|   126k|	if (unused < size)
  ------------------
  |  Branch (573:6): [True: 12.5k, False: 114k]
  ------------------
  574|  12.5k|		o_stream_grow_buffer(fstream, size-unused);
  575|       |
  576|   126k|	sent = 0;
  577|   253k|	for (i = 0; i < 2 && sent < size && !fstream->full; i++) {
  ------------------
  |  Branch (577:14): [True: 253k, False: 0]
  |  Branch (577:23): [True: 127k, False: 126k]
  |  Branch (577:38): [True: 126k, False: 546]
  ------------------
  578|   126k|		unused = fstream->tail >= fstream->head ?
  ------------------
  |  Branch (578:12): [True: 126k, False: 0]
  ------------------
  579|   126k|			fstream->buffer_size - fstream->tail :
  580|   126k|			fstream->head - fstream->tail;
  581|       |
  582|   126k|		if (unused > size-sent)
  ------------------
  |  Branch (582:7): [True: 126k, False: 278]
  ------------------
  583|   126k|			unused = size-sent;
  584|   126k|		memcpy(fstream->buffer + fstream->tail,
  ------------------
  |  |   84|   126k|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
  585|   126k|		       CONST_PTR_OFFSET(data, sent), unused);
  586|   126k|		sent += unused;
  587|       |
  588|   126k|		fstream->tail += unused;
  589|   126k|		if (fstream->tail == fstream->buffer_size)
  ------------------
  |  Branch (589:7): [True: 278, False: 126k]
  ------------------
  590|    278|			fstream->tail = 0;
  591|       |
  592|   126k|		if (fstream->head == fstream->tail &&
  ------------------
  |  Branch (592:7): [True: 278, False: 126k]
  ------------------
  593|   126k|		    fstream->buffer_size > 0)
  ------------------
  |  Branch (593:7): [True: 278, False: 0]
  ------------------
  594|    278|			fstream->full = TRUE;
  ------------------
  |  |   15|    278|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|    278|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  595|   126k|	}
  596|       |
  597|   126k|	if (sent != 0 && fstream->io == NULL &&
  ------------------
  |  Branch (597:6): [True: 126k, False: 273]
  |  Branch (597:19): [True: 126k, False: 0]
  ------------------
  598|   126k|	    !fstream->ostream.corked && !fstream->file) {
  ------------------
  |  Branch (598:6): [True: 0, False: 126k]
  |  Branch (598:34): [True: 0, False: 0]
  ------------------
  599|      0|		fstream->io = io_add_to(io_stream_get_ioloop(iostream),
  ------------------
  |  |   68|      0|	io_add_to(ioloop, fd, condition, __FILE__, __LINE__ - \
  |  |   69|      0|		CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
  |  |  ------------------
  |  |  |  |  171|      0|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|      0|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |   70|      0|		(io_callback_t *)callback, context)
  ------------------
  600|      0|					fstream->fd, IO_WRITE, stream_send_io,
  601|      0|				     	fstream);
  602|      0|	}
  603|       |
  604|   126k|	return sent;
  605|   126k|}
ostream-file.c:o_stream_grow_buffer:
  490|  12.5k|{
  491|  12.5k|	size_t size, new_size, end_size;
  492|       |
  493|  12.5k|	size = nearest_power(fstream->buffer_size + bytes);
  494|  12.5k|	if (size > fstream->ostream.max_buffer_size) {
  ------------------
  |  Branch (494:6): [True: 546, False: 12.0k]
  ------------------
  495|       |		/* limit the size */
  496|    546|		size = fstream->ostream.max_buffer_size;
  497|  12.0k|	} else if (fstream->ostream.corked) {
  ------------------
  |  Branch (497:13): [True: 12.0k, False: 0]
  ------------------
  498|       |		/* try to use optimal buffer size with corking */
  499|  12.0k|		new_size = I_MIN(fstream->optimal_block_size,
  ------------------
  |  |   35|  12.0k|#define I_MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 6.21k, False: 5.82k]
  |  |  ------------------
  ------------------
  500|  12.0k|				 fstream->ostream.max_buffer_size);
  501|  12.0k|		if (new_size > size)
  ------------------
  |  Branch (501:7): [True: 11.9k, False: 103]
  ------------------
  502|  11.9k|			size = new_size;
  503|  12.0k|	}
  504|       |
  505|  12.5k|	if (size <= fstream->buffer_size)
  ------------------
  |  Branch (505:6): [True: 397, False: 12.1k]
  ------------------
  506|    397|		return;
  507|       |
  508|  12.1k|	fstream->buffer = i_realloc(fstream->buffer,
  509|  12.1k|				    fstream->buffer_size, size);
  510|       |
  511|  12.1k|	if (fstream->tail <= fstream->head && !IS_STREAM_EMPTY(fstream)) {
  ------------------
  |  |   27|  12.1k|	((fstream)->head == (fstream)->tail && !(fstream)->full)
  |  |  ------------------
  |  |  |  Branch (27:3): [True: 12.1k, False: 0]
  |  |  |  Branch (27:41): [True: 12.1k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (511:6): [True: 12.1k, False: 0]
  ------------------
  512|       |		/* move head forward to end of buffer */
  513|      0|		end_size = fstream->buffer_size - fstream->head;
  514|      0|		memmove(fstream->buffer + size - end_size,
  515|      0|			fstream->buffer + fstream->head, end_size);
  516|      0|		fstream->head = size - end_size;
  517|      0|	}
  518|       |
  519|  12.1k|	fstream->full = FALSE;
  ------------------
  |  |   11|  12.1k|#  define FALSE (!1)
  ------------------
  520|  12.1k|	fstream->buffer_size = size;
  521|  12.1k|}
ostream-file.c:stream_send_io:
  524|  34.3k|{
  525|  34.3k|	struct ostream *ostream = &fstream->ostream.ostream;
  526|  34.3k|	struct iostream_private *iostream = &fstream->ostream.iostream;
  527|  34.3k|	bool use_cork = !fstream->ostream.corked;
  528|  34.3k|	int ret;
  529|       |
  530|       |	/* Set flush_pending = FALSE first before calling the flush callback,
  531|       |	   and change it to TRUE only if callback returns 0. That way the
  532|       |	   callback can call o_stream_set_flush_pending() again and we don't
  533|       |	   forget it even if flush callback returns 1. */
  534|  34.3k|	fstream->flush_pending = FALSE;
  ------------------
  |  |   11|  34.3k|#  define FALSE (!1)
  ------------------
  535|       |
  536|  34.3k|	o_stream_ref(ostream);
  537|  34.3k|	if (use_cork)
  ------------------
  |  Branch (537:6): [True: 34.3k, False: 0]
  ------------------
  538|  34.3k|		o_stream_cork(ostream);
  539|  34.3k|	if (fstream->ostream.callback != NULL)
  ------------------
  |  Branch (539:6): [True: 34.3k, False: 0]
  ------------------
  540|  34.3k|		ret = fstream->ostream.callback(fstream->ostream.context);
  541|      0|	else
  542|      0|		ret = o_stream_file_flush(&fstream->ostream);
  543|  34.3k|	if (use_cork)
  ------------------
  |  Branch (543:6): [True: 34.3k, False: 0]
  ------------------
  544|  34.3k|		o_stream_uncork(ostream);
  545|       |
  546|  34.3k|	if (ret == 0)
  ------------------
  |  Branch (546:6): [True: 0, False: 34.3k]
  ------------------
  547|      0|		fstream->flush_pending = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  548|       |
  549|  34.3k|	if (!fstream->flush_pending && IS_STREAM_EMPTY(fstream)) {
  ------------------
  |  |   27|  10.0k|	((fstream)->head == (fstream)->tail && !(fstream)->full)
  |  |  ------------------
  |  |  |  Branch (27:3): [True: 9.93k, False: 69]
  |  |  |  Branch (27:41): [True: 9.93k, False: 5]
  |  |  ------------------
  ------------------
  |  Branch (549:6): [True: 10.0k, False: 24.3k]
  ------------------
  550|  9.93k|		io_remove(&fstream->io);
  551|  24.3k|	} else if (!fstream->ostream.ostream.closed) {
  ------------------
  |  Branch (551:13): [True: 23.8k, False: 501]
  ------------------
  552|       |		/* Add the IO handler if it's not there already. Callback
  553|       |		   might have just returned 0 without there being any data
  554|       |		   to be sent. */
  555|  23.8k|		if (fstream->io == NULL) {
  ------------------
  |  Branch (555:7): [True: 0, False: 23.8k]
  ------------------
  556|      0|			fstream->io = io_add_to(io_stream_get_ioloop(iostream),
  ------------------
  |  |   68|      0|	io_add_to(ioloop, fd, condition, __FILE__, __LINE__ - \
  |  |   69|      0|		CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
  |  |  ------------------
  |  |  |  |  171|      0|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|      0|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |   70|      0|		(io_callback_t *)callback, context)
  ------------------
  557|      0|						fstream->fd, IO_WRITE,
  558|      0|						stream_send_io, fstream);
  559|      0|		}
  560|  23.8k|	}
  561|       |
  562|  34.3k|	o_stream_unref(&ostream);
  563|  34.3k|}
ostream-file.c:o_stream_file_destroy:
   64|  12.4k|{
   65|  12.4k|	struct file_ostream *fstream =
   66|  12.4k|		container_of(stream, struct file_ostream, ostream.iostream);
  ------------------
  |  |   30|  12.4k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  12.4k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  12.4k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  12.4k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  12.4k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  12.4k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
   67|       |
   68|  12.4k|	i_free(fstream->buffer);
  ------------------
  |  |   19|  12.4k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  12.4k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  12.4k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  12.4k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  12.4k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  12.4k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  12.4k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  12.4k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   69|  12.4k|}
ostream-file.c:o_stream_file_cork:
  372|   157k|{
  373|   157k|	struct file_ostream *fstream =
  374|   157k|		container_of(stream, struct file_ostream, ostream);
  ------------------
  |  |   30|   157k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|   157k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|   157k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|   157k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|   157k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|   157k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  375|   157k|	struct iostream_private *iostream = &fstream->ostream.iostream;
  376|   157k|	int ret;
  377|       |
  378|   157k|	if (stream->corked != set && !stream->ostream.closed) {
  ------------------
  |  Branch (378:6): [True: 84.0k, False: 73.6k]
  |  Branch (378:31): [True: 84.0k, False: 0]
  ------------------
  379|  84.0k|		if (set && fstream->io != NULL)
  ------------------
  |  Branch (379:7): [True: 42.0k, False: 42.0k]
  |  Branch (379:14): [True: 35.8k, False: 6.21k]
  ------------------
  380|  35.8k|			io_remove(&fstream->io);
  381|  48.2k|		else if (!set) {
  ------------------
  |  Branch (381:12): [True: 42.0k, False: 6.21k]
  ------------------
  382|       |			/* buffer flushing might close the stream */
  383|  42.0k|			ret = buffer_flush(fstream);
  384|  42.0k|			stream->last_errors_not_checked = TRUE;
  ------------------
  |  |   15|  42.0k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  42.0k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  385|  42.0k|			if (fstream->io == NULL &&
  ------------------
  |  Branch (385:8): [True: 42.0k, False: 0]
  ------------------
  386|  42.0k|			    (ret == 0 || fstream->flush_pending) &&
  ------------------
  |  Branch (386:9): [True: 347, False: 41.6k]
  |  Branch (386:21): [True: 25.5k, False: 16.1k]
  ------------------
  387|  42.0k|			    !stream->ostream.closed) {
  ------------------
  |  Branch (387:8): [True: 25.8k, False: 0]
  ------------------
  388|  25.8k|				fstream->io = io_add_to(
  ------------------
  |  |   68|  25.8k|	io_add_to(ioloop, fd, condition, __FILE__, __LINE__ - \
  |  |   69|  25.8k|		CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
  |  |  ------------------
  |  |  |  |  171|  25.8k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  25.8k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  25.8k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  25.8k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |   70|  25.8k|		(io_callback_t *)callback, context)
  ------------------
  389|  25.8k|					io_stream_get_ioloop(iostream),
  390|  25.8k|					fstream->fd, IO_WRITE,
  391|  25.8k|					stream_send_io, fstream);
  392|  25.8k|			}
  393|  42.0k|		}
  394|  84.0k|		if (stream->ostream.closed) {
  ------------------
  |  Branch (394:7): [True: 0, False: 84.0k]
  ------------------
  395|       |			/* flushing may have closed the stream already */
  396|      0|			return;
  397|      0|		}
  398|       |
  399|  84.0k|		if (fstream->socket_cork_set) {
  ------------------
  |  Branch (399:7): [True: 0, False: 84.0k]
  ------------------
  400|      0|			i_assert(!set);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  401|      0|			if (net_set_cork(fstream->fd, FALSE) < 0)
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  |  Branch (401:8): [True: 0, False: 0]
  ------------------
  402|      0|				fstream->no_socket_cork = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  403|      0|			fstream->socket_cork_set = FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  404|      0|		}
  405|  84.0k|		if (!set && !fstream->no_socket_nodelay) {
  ------------------
  |  Branch (405:7): [True: 42.0k, False: 42.0k]
  |  Branch (405:15): [True: 0, False: 42.0k]
  ------------------
  406|       |			/* Uncorking - send all the pending data immediately.
  407|       |			   Remove nodelay immediately afterwards, so if any
  408|       |			   output is sent outside corking it may get delayed. */
  409|      0|			o_stream_tcp_flush_via_nodelay(fstream);
  410|      0|		}
  411|  84.0k|		if (!set && !fstream->no_socket_quickack) {
  ------------------
  |  Branch (411:7): [True: 42.0k, False: 42.0k]
  |  Branch (411:15): [True: 0, False: 42.0k]
  ------------------
  412|       |			/* Uncorking - disable delayed ACKs to reduce latency.
  413|       |			   Note that this needs to be set repeatedly. */
  414|      0|			if (net_set_tcp_quickack(fstream->fd, TRUE) < 0)
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  |  Branch (414:8): [True: 0, False: 0]
  ------------------
  415|      0|				fstream->no_socket_quickack = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  416|      0|		}
  417|  84.0k|		stream->corked = set;
  418|  84.0k|	}
  419|   157k|}
ostream-file.c:o_stream_file_flush_pending:
  431|   234k|{
  432|   234k|	struct file_ostream *fstream =
  433|   234k|		container_of(stream, struct file_ostream, ostream);
  ------------------
  |  |   30|   234k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|   234k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|   234k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|   234k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|   234k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|   234k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  434|   234k|	struct iostream_private *iostream = &fstream->ostream.iostream;
  435|       |
  436|   234k|	fstream->flush_pending = set;
  437|   234k|	if (set && !stream->corked && fstream->io == NULL) {
  ------------------
  |  Branch (437:6): [True: 234k, False: 0]
  |  Branch (437:13): [True: 118k, False: 116k]
  |  Branch (437:32): [True: 12.2k, False: 105k]
  ------------------
  438|  12.2k|		fstream->io = io_add_to(io_stream_get_ioloop(iostream),
  ------------------
  |  |   68|  12.2k|	io_add_to(ioloop, fd, condition, __FILE__, __LINE__ - \
  |  |   69|  12.2k|		CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
  |  |  ------------------
  |  |  |  |  171|  12.2k|	(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  12.2k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  12.2k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:2): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  172|  12.2k|		typeof(&callback), type)) ? 1 : 0)
  |  |  ------------------
  |  |   70|  12.2k|		(io_callback_t *)callback, context)
  ------------------
  439|  12.2k|					fstream->fd, IO_WRITE,
  440|  12.2k|					stream_send_io, fstream);
  441|  12.2k|	}
  442|   234k|}
ostream-file.c:o_stream_file_send_istream:
  983|  6.46k|{
  984|  6.46k|	struct file_ostream *foutstream =
  985|  6.46k|		container_of(outstream, struct file_ostream, ostream);
  ------------------
  |  |   30|  6.46k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  6.46k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  6.46k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  6.46k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  6.46k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  6.46k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  986|  6.46k|	bool same_stream;
  987|  6.46k|	int in_fd;
  988|  6.46k|	enum ostream_send_istream_result res;
  989|       |
  990|  6.46k|	in_fd = !instream->readable_fd ? -1 : i_stream_get_fd(instream);
  ------------------
  |  Branch (990:10): [True: 6.46k, False: 0]
  ------------------
  991|  6.46k|	if (!foutstream->no_sendfile && in_fd != -1 &&
  ------------------
  |  Branch (991:6): [True: 6.46k, False: 0]
  |  Branch (991:34): [True: 0, False: 6.46k]
  ------------------
  992|  6.46k|	    in_fd != foutstream->fd && instream->seekable) {
  ------------------
  |  Branch (992:6): [True: 0, False: 0]
  |  Branch (992:33): [True: 0, False: 0]
  ------------------
  993|      0|		if (io_stream_sendfile(outstream, instream, in_fd, &res))
  ------------------
  |  Branch (993:7): [True: 0, False: 0]
  ------------------
  994|      0|			return res;
  995|       |
  996|       |		/* sendfile() not supported (with this fd), fallback to
  997|       |		   regular sending. */
  998|      0|		foutstream->no_sendfile = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  999|      0|	}
 1000|       |
 1001|  6.46k|	same_stream = i_stream_get_fd(instream) == foutstream->fd &&
  ------------------
  |  Branch (1001:16): [True: 0, False: 6.46k]
  ------------------
 1002|  6.46k|		foutstream->fd != -1;
  ------------------
  |  Branch (1002:3): [True: 0, False: 0]
  ------------------
 1003|  6.46k|	if (!same_stream)
  ------------------
  |  Branch (1003:6): [True: 6.46k, False: 0]
  ------------------
 1004|  6.46k|		return io_stream_copy(&outstream->ostream, instream);
 1005|      0|	return io_stream_copy_same_stream(outstream, instream);
 1006|  6.46k|}
ostream-file.c:o_stream_file_switch_ioloop_to:
 1010|  6.21k|{
 1011|  6.21k|	struct file_ostream *fstream =
 1012|  6.21k|		container_of(stream, struct file_ostream, ostream);
  ------------------
  |  |   30|  6.21k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  6.21k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  6.21k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  6.21k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
 1013|       |
 1014|  6.21k|	if (fstream->io != NULL)
  ------------------
  |  Branch (1014:6): [True: 0, False: 6.21k]
  ------------------
 1015|      0|		fstream->io = io_loop_move_io_to(ioloop, &fstream->io);
 1016|  6.21k|}
ostream-file.c:o_stream_create_fd_common:
 1078|  12.4k|{
 1079|  12.4k|	struct file_ostream *fstream;
 1080|  12.4k|	struct ostream *ostream;
 1081|  12.4k|	off_t offset;
 1082|       |
 1083|  12.4k|	fstream = i_new(struct file_ostream, 1);
  ------------------
  |  |    8|  12.4k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  12.4k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  12.4k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  12.4k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  12.4k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  12.4k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1084|  12.4k|	ostream = o_stream_create_file_common
 1085|  12.4k|		(fstream, fd, max_buffer_size, autoclose_fd);
 1086|       |
 1087|  12.4k|	offset = lseek(fd, 0, SEEK_CUR);
 1088|  12.4k|	if (offset >= 0) {
  ------------------
  |  Branch (1088:6): [True: 0, False: 12.4k]
  ------------------
 1089|      0|		ostream->offset = offset;
 1090|      0|		fstream->real_offset = offset;
 1091|      0|		fstream->buffer_offset = offset;
 1092|      0|		fstream_init_file(fstream);
 1093|  12.4k|	} else {
 1094|  12.4k|		struct ip_addr local_ip;
 1095|       |
 1096|  12.4k|		if (net_getsockname(fd, &local_ip, NULL) < 0) {
  ------------------
  |  Branch (1096:7): [True: 0, False: 12.4k]
  ------------------
 1097|       |			/* not a socket */
 1098|      0|			fstream->no_sendfile = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1099|      0|			fstream->no_socket_cork = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1100|      0|			fstream->no_socket_nodelay = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1101|      0|			fstream->no_socket_quickack = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1102|  12.4k|		} else if (local_ip.family == 0) {
  ------------------
  |  Branch (1102:14): [True: 12.4k, False: 0]
  ------------------
 1103|       |			/* UNIX domain socket */
 1104|  12.4k|			fstream->no_socket_cork = TRUE;
  ------------------
  |  |   15|  12.4k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  12.4k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1105|  12.4k|			fstream->no_socket_nodelay = TRUE;
  ------------------
  |  |   15|  12.4k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  12.4k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1106|  12.4k|			fstream->no_socket_quickack = TRUE;
  ------------------
  |  |   15|  12.4k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  12.4k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
 1107|  12.4k|		}
 1108|  12.4k|	}
 1109|       |
 1110|  12.4k|	return ostream;
 1111|  12.4k|}

o_stream_set_name:
    8|  12.4k|{
    9|  12.4k|	i_free(stream->real_stream->iostream.name);
  ------------------
  |  |   19|  12.4k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  12.4k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  12.4k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  12.4k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  12.4k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  12.4k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  12.4k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  12.4k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   10|  12.4k|	stream->real_stream->iostream.name = i_strdup(name);
   11|  12.4k|}
o_stream_get_fd:
   24|  6.18k|{
   25|  6.18k|	return stream->real_stream->fd;
   26|  6.18k|}
o_stream_destroy:
   76|  6.21k|{
   77|  6.21k|	struct ostream *stream = *_stream;
   78|       |
   79|  6.21k|	if (stream == NULL)
  ------------------
  |  Branch (79:6): [True: 0, False: 6.21k]
  ------------------
   80|      0|		return;
   81|       |
   82|  6.21k|	*_stream = NULL;
   83|  6.21k|	o_stream_close_full(stream, FALSE);
  ------------------
  |  |   11|  6.21k|#  define FALSE (!1)
  ------------------
   84|  6.21k|	o_stream_unref(&stream);
   85|  6.21k|}
o_stream_ref:
   88|  40.5k|{
   89|  40.5k|	io_stream_ref(&stream->real_stream->iostream);
   90|  40.5k|}
o_stream_unref:
   93|  59.1k|{
   94|  59.1k|	struct ostream *stream;
   95|       |
   96|  59.1k|	if (*_stream == NULL)
  ------------------
  |  Branch (96:6): [True: 6.21k, False: 52.9k]
  ------------------
   97|  6.21k|		return;
   98|       |
   99|  52.9k|	stream = *_stream;
  100|       |
  101|  52.9k|	if (stream->real_stream->last_errors_not_checked &&
  ------------------
  |  Branch (101:6): [True: 360, False: 52.6k]
  ------------------
  102|  52.9k|	    !stream->real_stream->error_handling_disabled &&
  ------------------
  |  Branch (102:6): [True: 0, False: 360]
  ------------------
  103|  52.9k|	    stream->real_stream->iostream.refcount == 1) {
  ------------------
  |  Branch (103:6): [True: 0, False: 0]
  ------------------
  104|      0|		i_panic("output stream %s is missing error handling",
  105|      0|			o_stream_get_name(stream));
  106|      0|	}
  107|       |
  108|  52.9k|	if (!io_stream_unref(&stream->real_stream->iostream))
  ------------------
  |  Branch (108:6): [True: 12.4k, False: 40.5k]
  ------------------
  109|  12.4k|		io_stream_free(&stream->real_stream->iostream);
  110|  52.9k|	*_stream = NULL;
  111|  52.9k|}
o_stream_close:
  129|  6.21k|{
  130|  6.21k|	if (stream != NULL)
  ------------------
  |  Branch (130:6): [True: 6.21k, False: 0]
  ------------------
  131|  6.21k|		o_stream_close_full(stream, TRUE);
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  132|  6.21k|}
o_stream_set_flush_callback:
  138|  12.4k|{
  139|  12.4k|	struct ostream_private *_stream = stream->real_stream;
  140|       |
  141|  12.4k|	_stream->set_flush_callback(_stream, callback, context);
  142|  12.4k|}
o_stream_unset_flush_callback:
  145|  6.21k|{
  146|  6.21k|	struct ostream_private *_stream = stream->real_stream;
  147|       |
  148|  6.21k|	_stream->set_flush_callback(_stream, NULL, NULL);
  149|  6.21k|}
o_stream_set_max_buffer_size:
  160|  12.9k|{
  161|  12.9k|	io_stream_set_max_buffer_size(&stream->real_stream->iostream, max_size);
  162|  12.9k|}
o_stream_get_max_buffer_size:
  165|  19.3k|{
  166|  19.3k|	return stream->real_stream->max_buffer_size;
  167|  19.3k|}
o_stream_cork:
  170|  76.2k|{
  171|  76.2k|	struct ostream_private *_stream = stream->real_stream;
  172|       |
  173|  76.2k|	if (unlikely(stream->closed || stream->stream_errno != 0))
  ------------------
  |  |  202|   152k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 76.2k]
  |  |  |  Branch (202:45): [True: 0, False: 76.2k]
  |  |  |  Branch (202:45): [True: 0, False: 76.2k]
  |  |  ------------------
  ------------------
  174|      0|		return;
  175|       |
  176|  76.2k|	_stream->cork(_stream, TRUE);
  ------------------
  |  |   15|  76.2k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  76.2k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  177|  76.2k|}
o_stream_uncork:
  180|  81.9k|{
  181|  81.9k|	struct ostream_private *_stream = stream->real_stream;
  182|       |
  183|  81.9k|	if (unlikely(stream->closed || stream->stream_errno != 0))
  ------------------
  |  |  202|   163k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 542, False: 81.4k]
  |  |  |  Branch (202:45): [True: 542, False: 81.4k]
  |  |  |  Branch (202:45): [True: 0, False: 81.4k]
  |  |  ------------------
  ------------------
  184|    542|		return;
  185|       |
  186|  81.4k|	_stream->cork(_stream, FALSE);
  ------------------
  |  |   11|  81.4k|#  define FALSE (!1)
  ------------------
  187|  81.4k|}
o_stream_is_corked:
  190|  1.55k|{
  191|  1.55k|	struct ostream_private *_stream = stream->real_stream;
  192|       |
  193|  1.55k|	return _stream->corked;
  194|  1.55k|}
o_stream_flush:
  197|  80.1k|{
  198|  80.1k|	struct ostream_private *_stream = stream->real_stream;
  199|  80.1k|	int ret = 1;
  200|       |
  201|  80.1k|	o_stream_ignore_last_errors(stream);
  202|       |
  203|  80.1k|	if (unlikely(stream->closed || stream->stream_errno != 0)) {
  ------------------
  |  |  202|   154k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 6.21k, False: 73.9k]
  |  |  |  Branch (202:45): [True: 6.21k, False: 73.9k]
  |  |  |  Branch (202:45): [True: 0, False: 73.9k]
  |  |  ------------------
  ------------------
  204|  6.21k|		errno = stream->stream_errno;
  205|  6.21k|		return -1;
  206|  6.21k|	}
  207|       |
  208|  73.9k|	if (unlikely(_stream->noverflow)) {
  ------------------
  |  |  202|  73.9k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 73.9k]
  |  |  |  Branch (202:44): [True: 0, False: 73.9k]
  |  |  ------------------
  ------------------
  209|      0|		io_stream_set_error(&_stream->iostream,
  210|      0|			"Output stream buffer was full (%zu bytes)",
  211|      0|			o_stream_get_max_buffer_size(stream));
  212|      0|		errno = stream->stream_errno = ENOBUFS;
  213|      0|		return -1;
  214|      0|	}
  215|       |
  216|  73.9k|	if (unlikely((ret = _stream->flush(_stream)) < 0)) {
  ------------------
  |  |  202|  73.9k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 73.9k]
  |  |  |  Branch (202:44): [True: 0, False: 73.9k]
  |  |  ------------------
  ------------------
  217|      0|		i_assert(stream->stream_errno != 0);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  218|      0|		errno = stream->stream_errno;
  219|      0|	}
  220|  73.9k|	return ret;
  221|  73.9k|}
o_stream_set_flush_pending:
  224|   234k|{
  225|   234k|	struct ostream_private *_stream = stream->real_stream;
  226|       |
  227|   234k|	if (unlikely(stream->closed || stream->stream_errno != 0))
  ------------------
  |  |  202|   469k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 234k]
  |  |  |  Branch (202:45): [True: 0, False: 234k]
  |  |  |  Branch (202:45): [True: 0, False: 234k]
  |  |  ------------------
  ------------------
  228|      0|		return;
  229|       |
  230|   234k|	_stream->flush_pending(_stream, set);
  231|   234k|}
o_stream_send:
  265|   112k|{
  266|   112k|	struct const_iovec iov;
  267|       |
  268|   112k|	i_zero(&iov);
  ------------------
  |  |  249|   112k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|   112k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|   112k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  269|   112k|	iov.iov_base = data;
  270|   112k|	iov.iov_len = size;
  271|       |
  272|   112k| 	return o_stream_sendv(stream, &iov, 1);
  273|   112k|}
o_stream_sendv:
  310|   119k|{
  311|   119k|	bool overflow;
  312|       |
  313|   119k|	if (unlikely(stream->closed || stream->stream_errno != 0)) {
  ------------------
  |  |  202|   238k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 119k]
  |  |  |  Branch (202:45): [True: 0, False: 119k]
  |  |  |  Branch (202:45): [True: 0, False: 119k]
  |  |  ------------------
  ------------------
  314|      0|		errno = stream->stream_errno;
  315|      0|		return -1;
  316|      0|	}
  317|   119k|	return o_stream_sendv_int(stream, iov, iov_count, &overflow);
  318|   119k|}
o_stream_nsend:
  326|  7.99k|{
  327|  7.99k|	struct const_iovec iov;
  328|       |
  329|  7.99k|	i_zero(&iov);
  ------------------
  |  |  249|  7.99k|	memset(p, 0 + COMPILE_ERROR_IF_TRUE(sizeof(p) > sizeof(void *)), sizeof(*(p)))
  |  |  ------------------
  |  |  |  |  180|  7.99k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  7.99k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  330|  7.99k|	iov.iov_base = data;
  331|  7.99k|	iov.iov_len = size;
  332|       |
  333|  7.99k|	o_stream_nsendv(stream, &iov, 1);
  334|  7.99k|}
o_stream_nsendv:
  338|  7.99k|{
  339|  7.99k|	bool overflow;
  340|       |
  341|  7.99k|	if (unlikely(stream->closed || stream->stream_errno != 0 ||
  ------------------
  |  |  202|  31.9k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 7.99k]
  |  |  |  Branch (202:45): [True: 0, False: 7.99k]
  |  |  |  Branch (202:45): [True: 0, False: 7.99k]
  |  |  |  Branch (202:45): [True: 0, False: 7.99k]
  |  |  ------------------
  ------------------
  342|  7.99k|		     stream->real_stream->noverflow))
  343|      0|		return;
  344|  7.99k|	(void)o_stream_sendv_int(stream, iov, iov_count, &overflow);
  345|  7.99k|	if (overflow)
  ------------------
  |  Branch (345:6): [True: 0, False: 7.99k]
  ------------------
  346|      0|		stream->real_stream->noverflow = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  347|  7.99k|	stream->real_stream->last_errors_not_checked = TRUE;
  ------------------
  |  |   15|  7.99k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  7.99k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  348|  7.99k|}
o_stream_finish:
  356|  6.19k|{
  357|  6.19k|	stream->real_stream->finished = TRUE;
  ------------------
  |  |   15|  6.19k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.19k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  358|  6.19k|	return o_stream_flush(stream);
  359|  6.19k|}
o_stream_set_finish_via_child:
  367|  6.21k|{
  368|  6.21k|	stream->real_stream->finish_via_child = set;
  369|  6.21k|}
o_stream_ignore_last_errors:
  372|  80.1k|{
  373|   160k|	while (stream != NULL) {
  ------------------
  |  Branch (373:9): [True: 80.1k, False: 80.1k]
  ------------------
  374|  80.1k|		stream->real_stream->last_errors_not_checked = FALSE;
  ------------------
  |  |   11|  80.1k|#  define FALSE (!1)
  ------------------
  375|  80.1k|		stream = stream->real_stream->parent;
  376|  80.1k|	}
  377|  80.1k|}
o_stream_set_no_error_handling:
  389|  12.4k|{
  390|  12.4k|	stream->real_stream->error_handling_disabled = set;
  391|  12.4k|}
o_stream_send_istream:
  395|  6.46k|{
  396|  6.46k|	struct ostream_private *_outstream = outstream->real_stream;
  397|  6.46k|	uoff_t old_outstream_offset = outstream->offset;
  398|  6.46k|	uoff_t old_instream_offset = instream->v_offset;
  399|  6.46k|	enum ostream_send_istream_result res;
  400|       |
  401|  6.46k|	if (unlikely(instream->closed || instream->stream_errno != 0)) {
  ------------------
  |  |  202|  12.9k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 6.46k]
  |  |  |  Branch (202:45): [True: 0, False: 6.46k]
  |  |  |  Branch (202:45): [True: 0, False: 6.46k]
  |  |  ------------------
  ------------------
  402|      0|		errno = instream->stream_errno;
  403|      0|		return OSTREAM_SEND_ISTREAM_RESULT_ERROR_INPUT;
  404|      0|	}
  405|  6.46k|	if (unlikely(outstream->closed || outstream->stream_errno != 0)) {
  ------------------
  |  |  202|  12.9k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 6.46k]
  |  |  |  Branch (202:45): [True: 0, False: 6.46k]
  |  |  |  Branch (202:45): [True: 0, False: 6.46k]
  |  |  ------------------
  ------------------
  406|      0|		errno = outstream->stream_errno;
  407|      0|		return OSTREAM_SEND_ISTREAM_RESULT_ERROR_OUTPUT;
  408|      0|	}
  409|       |
  410|  6.46k|	i_assert(!_outstream->finished);
  ------------------
  |  |  219|  6.46k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.46k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.46k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.46k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.46k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.46k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.46k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.46k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.46k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  411|  6.46k|	res = _outstream->send_istream(_outstream, instream);
  412|  6.46k|	switch (res) {
  ------------------
  |  Branch (412:10): [True: 0, False: 6.46k]
  ------------------
  413|  6.19k|	case OSTREAM_SEND_ISTREAM_RESULT_FINISHED:
  ------------------
  |  Branch (413:2): [True: 6.19k, False: 273]
  ------------------
  414|  6.19k|		i_assert(instream->stream_errno == 0);
  ------------------
  |  |  219|  6.19k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.19k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.19k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.19k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.19k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.19k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.19k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.19k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  415|  6.19k|		i_assert(outstream->stream_errno == 0);
  ------------------
  |  |  219|  6.19k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.19k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.19k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.19k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.19k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.19k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.19k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.19k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  416|  6.19k|		i_assert(!i_stream_have_bytes_left(instream));
  ------------------
  |  |  219|  6.19k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.19k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.19k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.19k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.19k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.19k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.19k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.19k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  417|  6.19k|		break;
  418|  6.19k|	case OSTREAM_SEND_ISTREAM_RESULT_WAIT_INPUT:
  ------------------
  |  Branch (418:2): [True: 0, False: 6.46k]
  ------------------
  419|      0|		i_assert(!instream->blocking);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  420|      0|		break;
  421|    273|	case OSTREAM_SEND_ISTREAM_RESULT_WAIT_OUTPUT:
  ------------------
  |  Branch (421:2): [True: 273, False: 6.19k]
  ------------------
  422|    273|		i_assert(!outstream->blocking);
  ------------------
  |  |  219|    273|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    273|#  define STMT_START do
  |  |  ------------------
  |  |  220|    273|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    273|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 273]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 273]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    273|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    273|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    273|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  423|    273|		o_stream_set_flush_pending(outstream, TRUE);
  ------------------
  |  |   15|    273|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|    273|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  424|    273|		break;
  425|      0|	case OSTREAM_SEND_ISTREAM_RESULT_ERROR_INPUT:
  ------------------
  |  Branch (425:2): [True: 0, False: 6.46k]
  ------------------
  426|      0|		i_assert(instream->stream_errno != 0);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  427|      0|		return res;
  428|      0|	case OSTREAM_SEND_ISTREAM_RESULT_ERROR_OUTPUT:
  ------------------
  |  Branch (428:2): [True: 0, False: 6.46k]
  ------------------
  429|      0|		i_assert(outstream->stream_errno != 0);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  430|      0|		return res;
  431|  6.46k|	}
  432|       |	/* non-failure - make sure stream offsets match */
  433|  6.46k|	i_assert((outstream->offset - old_outstream_offset) ==
  ------------------
  |  |  219|  6.46k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  6.46k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  6.46k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  6.46k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 6.46k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 6.46k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  6.46k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  6.46k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  6.46k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  434|  6.46k|		 (instream->v_offset - old_instream_offset));
  435|       |
  436|  6.46k|	if (outstream->offset != old_outstream_offset)
  ------------------
  |  Branch (436:6): [True: 6.46k, False: 0]
  ------------------
  437|  6.46k|		outstream->real_stream->last_write_timeval = ioloop_timeval;
  438|  6.46k|	return res;
  439|  6.46k|}
io_stream_copy:
  496|  6.46k|{
  497|  6.46k|	struct const_iovec iov;
  498|  6.46k|	const unsigned char *data;
  499|  6.46k|	ssize_t ret;
  500|       |
  501|  12.9k|	while (i_stream_read_more(instream, &data, &iov.iov_len) > 0) {
  ------------------
  |  Branch (501:9): [True: 6.73k, False: 6.19k]
  ------------------
  502|  6.73k|		iov.iov_base = data;
  503|  6.73k|		if ((ret = o_stream_sendv(outstream, &iov, 1)) < 0)
  ------------------
  |  Branch (503:7): [True: 0, False: 6.73k]
  ------------------
  504|      0|			return OSTREAM_SEND_ISTREAM_RESULT_ERROR_OUTPUT;
  505|  6.73k|		else if (ret == 0)
  ------------------
  |  Branch (505:12): [True: 273, False: 6.46k]
  ------------------
  506|    273|			return OSTREAM_SEND_ISTREAM_RESULT_WAIT_OUTPUT;
  507|  6.46k|		i_stream_skip(instream, ret);
  508|  6.46k|	}
  509|       |
  510|  6.19k|	if (instream->stream_errno != 0)
  ------------------
  |  Branch (510:6): [True: 0, False: 6.19k]
  ------------------
  511|      0|		return OSTREAM_SEND_ISTREAM_RESULT_ERROR_INPUT;
  512|  6.19k|	if (i_stream_have_bytes_left(instream))
  ------------------
  |  Branch (512:6): [True: 0, False: 6.19k]
  ------------------
  513|      0|		return OSTREAM_SEND_ISTREAM_RESULT_WAIT_INPUT;
  514|  6.19k|	return OSTREAM_SEND_ISTREAM_RESULT_FINISHED;
  515|  6.19k|}
o_stream_switch_ioloop_to:
  518|  6.21k|{
  519|  6.21k|	struct ostream_private *_stream = stream->real_stream;
  520|       |
  521|  6.21k|	io_stream_switch_ioloop_to(&_stream->iostream, ioloop);
  522|       |
  523|  6.21k|	_stream->switch_ioloop_to(_stream, ioloop);
  524|  6.21k|}
o_stream_create:
  719|  12.4k|{
  720|  12.4k|	_stream->finish_also_parent = TRUE;
  ------------------
  |  |   15|  12.4k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  12.4k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  721|  12.4k|	_stream->finish_via_child = TRUE;
  ------------------
  |  |   15|  12.4k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  12.4k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  722|  12.4k|	_stream->fd = fd;
  723|  12.4k|	_stream->ostream.real_stream = _stream;
  724|  12.4k|	if (parent != NULL) {
  ------------------
  |  Branch (724:6): [True: 0, False: 12.4k]
  ------------------
  725|      0|		_stream->ostream.blocking = parent->blocking;
  726|      0|		_stream->parent = parent;
  727|      0|		o_stream_ref(parent);
  728|       |
  729|      0|		_stream->callback = parent->real_stream->callback;
  730|      0|		_stream->context = parent->real_stream->context;
  731|      0|		_stream->max_buffer_size = parent->real_stream->max_buffer_size;
  732|      0|		_stream->error_handling_disabled =
  733|      0|			parent->real_stream->error_handling_disabled;
  734|      0|	}
  735|       |
  736|  12.4k|	if (_stream->iostream.close == NULL)
  ------------------
  |  Branch (736:6): [True: 0, False: 12.4k]
  ------------------
  737|      0|		_stream->iostream.close = o_stream_default_close;
  738|  12.4k|	if (_stream->iostream.destroy == NULL)
  ------------------
  |  Branch (738:6): [True: 0, False: 12.4k]
  ------------------
  739|      0|		_stream->iostream.destroy = o_stream_default_destroy;
  740|  12.4k|	if (_stream->iostream.set_max_buffer_size == NULL) {
  ------------------
  |  Branch (740:6): [True: 12.4k, False: 0]
  ------------------
  741|  12.4k|		_stream->iostream.set_max_buffer_size =
  742|  12.4k|			o_stream_default_set_max_buffer_size;
  743|  12.4k|	}
  744|       |
  745|  12.4k|	if (_stream->cork == NULL)
  ------------------
  |  Branch (745:6): [True: 0, False: 12.4k]
  ------------------
  746|      0|		_stream->cork = o_stream_default_cork;
  747|  12.4k|	if (_stream->flush == NULL)
  ------------------
  |  Branch (747:6): [True: 0, False: 12.4k]
  ------------------
  748|      0|		_stream->flush = o_stream_default_flush;
  749|  12.4k|	if (_stream->set_flush_callback == NULL) {
  ------------------
  |  Branch (749:6): [True: 12.4k, False: 0]
  ------------------
  750|  12.4k|		_stream->set_flush_callback =
  751|  12.4k|			o_stream_default_set_flush_callback;
  752|  12.4k|	}
  753|  12.4k|	if (_stream->flush_pending == NULL)
  ------------------
  |  Branch (753:6): [True: 0, False: 12.4k]
  ------------------
  754|      0|		_stream->flush_pending = o_stream_default_set_flush_pending;
  755|  12.4k|	if (_stream->get_buffer_used_size == NULL)
  ------------------
  |  Branch (755:6): [True: 0, False: 12.4k]
  ------------------
  756|      0|		_stream->get_buffer_used_size =
  757|      0|			o_stream_default_get_buffer_used_size;
  758|  12.4k|	if (_stream->get_buffer_avail_size == NULL) {
  ------------------
  |  Branch (758:6): [True: 12.4k, False: 0]
  ------------------
  759|  12.4k|		_stream->get_buffer_avail_size =
  760|  12.4k|			o_stream_default_get_buffer_avail_size;
  761|  12.4k|	}
  762|  12.4k|	if (_stream->seek == NULL)
  ------------------
  |  Branch (762:6): [True: 0, False: 12.4k]
  ------------------
  763|      0|		_stream->seek = o_stream_default_seek;
  764|  12.4k|	if (_stream->sendv == NULL)
  ------------------
  |  Branch (764:6): [True: 0, False: 12.4k]
  ------------------
  765|      0|		_stream->sendv = o_stream_default_sendv;
  766|  12.4k|	if (_stream->write_at == NULL)
  ------------------
  |  Branch (766:6): [True: 0, False: 12.4k]
  ------------------
  767|      0|		_stream->write_at = o_stream_default_write_at;
  768|  12.4k|	if (_stream->send_istream == NULL)
  ------------------
  |  Branch (768:6): [True: 0, False: 12.4k]
  ------------------
  769|      0|		_stream->send_istream = o_stream_default_send_istream;
  770|  12.4k|	if (_stream->switch_ioloop_to == NULL)
  ------------------
  |  Branch (770:6): [True: 0, False: 12.4k]
  ------------------
  771|      0|		_stream->switch_ioloop_to = o_stream_default_switch_ioloop_to;
  772|       |
  773|  12.4k|	io_stream_init(&_stream->iostream);
  774|  12.4k|	return &_stream->ostream;
  775|  12.4k|}
ostream.c:o_stream_close_full:
   52|  12.4k|{
   53|       |	/* Ideally o_stream_finish() would be called for all non-failed
   54|       |	   ostreams, but strictly requiring it would cause unnecessary
   55|       |	   complexity for many callers. Just require that at this point
   56|       |	   after flushing there isn't anything in the output buffer or that
   57|       |	   we're ignoring all errors. */
   58|  12.4k|	if (o_stream_flush(stream) == 0)
  ------------------
  |  Branch (58:6): [True: 0, False: 12.4k]
  ------------------
   59|  12.4k|		i_assert(stream->real_stream->error_handling_disabled);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   60|       |
   61|  12.4k|	if (!stream->closed && !stream->real_stream->closing) {
  ------------------
  |  Branch (61:6): [True: 6.21k, False: 6.21k]
  |  Branch (61:25): [True: 6.21k, False: 0]
  ------------------
   62|       |		/* first mark the stream as being closed so the
   63|       |		   o_stream_copy_error_from_parent() won't recurse us back
   64|       |		   here. but don't immediately mark the stream closed, because
   65|       |		   we may still want to write something to it. */
   66|  6.21k|		stream->real_stream->closing = TRUE;
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   67|  6.21k|		io_stream_close(&stream->real_stream->iostream, close_parents);
   68|  6.21k|		stream->closed = TRUE;
  ------------------
  |  |   15|  6.21k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   69|  6.21k|	}
   70|       |
   71|  12.4k|	if (stream->stream_errno == 0)
  ------------------
  |  Branch (71:6): [True: 6.21k, False: 6.21k]
  ------------------
   72|  6.21k|		stream->stream_errno = EPIPE;
   73|  12.4k|}
ostream.c:o_stream_sendv_int:
  278|   127k|{
  279|   127k|	struct ostream_private *_stream = stream->real_stream;
  280|   127k|	unsigned int i;
  281|   127k|	size_t total_size;
  282|   127k|	ssize_t ret;
  283|       |
  284|   127k|	*overflow_r = FALSE;
  ------------------
  |  |   11|   127k|#  define FALSE (!1)
  ------------------
  285|       |
  286|   254k|	for (i = 0, total_size = 0; i < iov_count; i++)
  ------------------
  |  Branch (286:30): [True: 127k, False: 127k]
  ------------------
  287|   127k|		total_size += iov[i].iov_len;
  288|   127k|	if (total_size == 0)
  ------------------
  |  Branch (288:6): [True: 0, False: 127k]
  ------------------
  289|      0|		return 0;
  290|       |
  291|   127k|	i_assert(!_stream->finished);
  ------------------
  |  |  219|   127k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   127k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   127k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   127k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 127k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 127k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   127k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   127k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   127k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  292|   127k|	ret = _stream->sendv(_stream, iov, iov_count);
  293|   127k|	if (ret > 0)
  ------------------
  |  Branch (293:6): [True: 127k, False: 273]
  ------------------
  294|   127k|		stream->real_stream->last_write_timeval = ioloop_timeval;
  295|   127k|	if (unlikely(ret != (ssize_t)total_size)) {
  ------------------
  |  |  202|   127k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 546, False: 126k]
  |  |  |  Branch (202:44): [True: 546, False: 126k]
  |  |  ------------------
  ------------------
  296|    546|		if (ret < 0) {
  ------------------
  |  Branch (296:7): [True: 0, False: 546]
  ------------------
  297|      0|			i_assert(stream->stream_errno != 0);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  298|      0|			errno = stream->stream_errno;
  299|    546|		} else {
  300|    546|			i_assert(!stream->blocking);
  ------------------
  |  |  219|    546|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    546|#  define STMT_START do
  |  |  ------------------
  |  |  220|    546|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    546|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 546]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 546]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    546|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    546|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    546|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  301|    546|			stream->overflow = TRUE;
  ------------------
  |  |   15|    546|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|    546|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  302|    546|			*overflow_r = TRUE;
  ------------------
  |  |   15|    546|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|    546|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  303|    546|		}
  304|    546|	}
  305|   127k|	return ret;
  306|   127k|}
ostream.c:o_stream_default_set_max_buffer_size:
  553|  12.9k|{
  554|  12.9k|	struct ostream_private *_stream =
  555|  12.9k|		container_of(stream, struct ostream_private, iostream);
  ------------------
  |  |   30|  12.9k|	(type *)((char *)(ptr) - offsetof(type, name) + \
  |  |   31|  12.9k|		 COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(ptr, &((type *) 0)->name))
  |  |  ------------------
  |  |  |  |  187|  12.9k|	COMPILE_ERROR_IF_TRUE( \
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  12.9k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  12.9k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  188|  12.9k|		!__builtin_types_compatible_p(typeof(_a), typeof(_b)))
  |  |  ------------------
  ------------------
  556|       |
  557|  12.9k|	if (_stream->parent != NULL)
  ------------------
  |  Branch (557:6): [True: 0, False: 12.9k]
  ------------------
  558|      0|		o_stream_set_max_buffer_size(_stream->parent, max_size);
  559|  12.9k|	_stream->max_buffer_size = max_size;
  560|  12.9k|}
ostream.c:o_stream_default_set_flush_callback:
  635|  18.6k|{
  636|  18.6k|	if (_stream->parent != NULL)
  ------------------
  |  Branch (636:6): [True: 0, False: 18.6k]
  ------------------
  637|      0|		o_stream_set_flush_callback(_stream->parent, callback, context);
  638|       |
  639|  18.6k|	_stream->callback = callback;
  640|  18.6k|	_stream->context = context;
  641|  18.6k|}

smtp-server-connection.c:o_stream_uncork_flush:
  169|  27.2k|{
  170|  27.2k|	o_stream_uncork(stream);
  171|  27.2k|	return o_stream_flush(stream);
  172|  27.2k|}

printf_format_fix_get_len:
  171|   561k|{
  172|   561k|	const char *ret;
  173|       |
  174|   561k|	ret = printf_format_fix_noalloc(format, len_r);
  175|   561k|	if (ret != format)
  ------------------
  |  Branch (175:6): [True: 694, False: 561k]
  ------------------
  176|    694|		t_buffer_alloc(*len_r + 1);
  177|   561k|	return ret;
  178|   561k|}
printf_format_fix_unsafe:
  192|      1|{
  193|      1|	size_t len;
  194|       |
  195|      1|	return printf_format_fix_noalloc(format, &len);
  196|      1|}
printf-format-fix.c:printf_format_fix_noalloc:
   63|   561k|{
   64|       |	/* NOTE: This function is overly strict in what it accepts. Some
   65|       |	   format strings that are valid (and safe) in C99 will cause a panic
   66|       |	   here. This is because we don't really need to support the weirdest
   67|       |	   special cases, and we're also being extra careful not to pass
   68|       |	   anything to the underlying libc printf, which might treat the string
   69|       |	   differently than us and unexpectedly handling it as %n. For example
   70|       |	   "%**%n" with glibc. */
   71|       |
   72|       |	/* Allow only the standard C99 flags. There are also <'> and <I> flags,
   73|       |	   but we don't really need them. And at worst if they're not supported
   74|       |	   by the underlying printf, they could potentially be used to work
   75|       |	   around our restrictions. */
   76|   561k|	const char printf_flags[] = "#0- +";
   77|       |	/* As a tiny optimization keep the most commonly used conversion
   78|       |	   specifiers first, so strchr() stops early. */
   79|   561k|	static const char *printf_specifiers = "sudcixXpoeEfFgGaA";
   80|   561k|	const char *ret, *p, *p2;
   81|   561k|	char *flag;
   82|       |
   83|   561k|	p = ret = format;
   84|  1.16M|	while ((p2 = strchr(p, '%')) != NULL) {
  ------------------
  |  Branch (84:9): [True: 605k, False: 561k]
  ------------------
   85|   605k|		const unsigned int start_pos = p2 - format;
   86|       |
   87|   605k|		p = p2+1;
   88|   605k|		if (*p == '%') {
  ------------------
  |  Branch (88:7): [True: 0, False: 605k]
  ------------------
   89|       |			/* we'll be strict and allow %% only when there are no
   90|       |			   optional flags or modifiers. */
   91|      0|			p++;
   92|      0|			continue;
   93|      0|		}
   94|       |		/* 1) zero or more flags. We'll add a further restriction that
   95|       |		   each flag can be used only once, since there's no need to
   96|       |		   use them more than once, and some implementations might
   97|       |		   add their own limits. */
   98|   605k|		bool printf_flags_seen[N_ELEMENTS(printf_flags)] = { FALSE, };
  ------------------
  |  |   11|   605k|#  define FALSE (!1)
  ------------------
   99|   730k|		while (*p != '\0' &&
  ------------------
  |  Branch (99:10): [True: 730k, False: 0]
  ------------------
  100|   730k|		       (flag = strchr(printf_flags, *p)) != NULL) {
  ------------------
  |  Branch (100:10): [True: 124k, False: 605k]
  ------------------
  101|   124k|			unsigned int flag_idx = flag - printf_flags;
  102|       |
  103|   124k|			if (printf_flags_seen[flag_idx]) {
  ------------------
  |  Branch (103:8): [True: 0, False: 124k]
  ------------------
  104|      0|				i_panic("Duplicate %% flag '%c' starting at #%u in '%s'",
  105|      0|					*p, start_pos, format);
  106|      0|			}
  107|   124k|			printf_flags_seen[flag_idx] = TRUE;
  ------------------
  |  |   15|   124k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   124k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  108|   124k|			p++;
  109|   124k|		}
  110|       |
  111|       |		/* 2) Optional minimum field width */
  112|   605k|		if (!verify_length(&p)) {
  ------------------
  |  Branch (112:7): [True: 0, False: 605k]
  ------------------
  113|      0|			i_panic("Too large minimum field width starting at #%u in '%s'",
  114|      0|				start_pos, format);
  115|      0|		}
  116|       |
  117|       |		/* 3) Optional precision */
  118|   605k|		if (*p == '.') {
  ------------------
  |  Branch (118:7): [True: 0, False: 605k]
  ------------------
  119|      0|			p++;
  120|      0|			if (!verify_length(&p)) {
  ------------------
  |  Branch (120:8): [True: 0, False: 0]
  ------------------
  121|      0|				i_panic("Too large precision starting at #%u in '%s'",
  122|      0|					start_pos, format);
  123|      0|			}
  124|      0|		}
  125|       |
  126|       |		/* 4) Optional length modifier */
  127|   605k|		switch (*p) {
  ------------------
  |  Branch (127:11): [True: 578k, False: 26.8k]
  ------------------
  128|      0|		case 'h':
  ------------------
  |  Branch (128:3): [True: 0, False: 605k]
  ------------------
  129|      0|			if (*++p == 'h')
  ------------------
  |  Branch (129:8): [True: 0, False: 0]
  ------------------
  130|      0|				p++;
  131|      0|			break;
  132|  26.8k|		case 'l':
  ------------------
  |  Branch (132:3): [True: 26.8k, False: 578k]
  ------------------
  133|  26.8k|			if (*++p == 'l')
  ------------------
  |  Branch (133:8): [True: 1, False: 26.8k]
  ------------------
  134|      1|				p++;
  135|  26.8k|			break;
  136|      0|		case 'L':
  ------------------
  |  Branch (136:3): [True: 0, False: 605k]
  ------------------
  137|      0|		case 'j':
  ------------------
  |  Branch (137:3): [True: 0, False: 605k]
  ------------------
  138|      0|		case 'z':
  ------------------
  |  Branch (138:3): [True: 0, False: 605k]
  ------------------
  139|      0|		case 't':
  ------------------
  |  Branch (139:3): [True: 0, False: 605k]
  ------------------
  140|      0|			p++;
  141|      0|			break;
  142|   605k|		}
  143|       |
  144|       |		/* 5) conversion specifier */
  145|   605k|		if (*p == '\0' || strchr(printf_specifiers, *p) == NULL) {
  ------------------
  |  Branch (145:7): [True: 0, False: 605k]
  |  Branch (145:21): [True: 694, False: 605k]
  ------------------
  146|    694|			switch (*p) {
  147|      0|			case 'n':
  ------------------
  |  Branch (147:4): [True: 0, False: 694]
  ------------------
  148|      0|				i_panic("%%n modifier used");
  149|    694|			case 'm':
  ------------------
  |  Branch (149:4): [True: 694, False: 0]
  ------------------
  150|    694|				if (ret != format)
  ------------------
  |  Branch (150:9): [True: 0, False: 694]
  ------------------
  151|      0|					i_panic("%%m used twice");
  152|    694|				ret = fix_format_real(format, p-1, len_r);
  153|    694|				break;
  154|      0|			case '\0':
  ------------------
  |  Branch (154:4): [True: 0, False: 694]
  ------------------
  155|      0|				i_panic("Missing %% specifier starting at #%u in '%s'",
  156|      0|					start_pos, format);
  157|      0|			default:
  ------------------
  |  Branch (157:4): [True: 0, False: 694]
  ------------------
  158|      0|				i_panic("Unsupported 0x%02x specifier starting at #%u in '%s'",
  159|      0|					*p, start_pos, format);
  160|    694|			}
  161|    694|		}
  162|   605k|		p++;
  163|   605k|	}
  164|       |
  165|   561k|	if (ret == format)
  ------------------
  |  Branch (165:6): [True: 561k, False: 694]
  ------------------
  166|   561k|		*len_r = p - format + strlen(p);
  167|   561k|	return ret;
  168|   561k|}
printf-format-fix.c:verify_length:
   40|   605k|{
   41|   605k|	if (**p == '*') {
  ------------------
  |  Branch (41:6): [True: 0, False: 605k]
  ------------------
   42|       |		/* We don't bother supporting "*m$" - it's not used
   43|       |		   anywhere and seems a bit dangerous. */
   44|      0|		*p += 1;
   45|   605k|	} else if (**p >= '0' && **p <= '9') {
  ------------------
  |  Branch (45:13): [True: 605k, False: 0]
  |  Branch (45:27): [True: 124k, False: 481k]
  ------------------
   46|       |		/* Limit to 4 digits - we'll never want more than that.
   47|       |		   Some implementations might not handle long digits
   48|       |		   correctly, or maybe even could be used for DoS due
   49|       |		   to using too much CPU. If you want to express '99'
   50|       |		   as '00099', then you lose in this function. */
   51|   124k|		unsigned int i = 0;
   52|   124k|		do {
   53|   124k|			*p += 1;
   54|   124k|			if (++i > 4)
  ------------------
  |  Branch (54:8): [True: 0, False: 124k]
  ------------------
   55|      0|				return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
   56|   124k|		} while (**p >= '0' && **p <= '9');
  ------------------
  |  Branch (56:12): [True: 124k, False: 0]
  |  Branch (56:26): [True: 0, False: 124k]
  ------------------
   57|   124k|	}
   58|   605k|	return TRUE;
  ------------------
  |  |   15|   605k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|   605k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   59|   605k|}
printf-format-fix.c:fix_format_real:
   12|    694|{
   13|    694|	const char *errstr;
   14|    694|	char *buf;
   15|    694|	size_t len1, len2, len3;
   16|       |
   17|    694|	i_assert((size_t)(p - fmt) < INT_MAX);
  ------------------
  |  |  219|    694|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    694|#  define STMT_START do
  |  |  ------------------
  |  |  220|    694|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    694|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 694]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 694]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    694|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    694|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    694|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   18|    694|	i_assert(p[0] == '%' && p[1] == 'm');
  ------------------
  |  |  219|    694|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    694|#  define STMT_START do
  |  |  ------------------
  |  |  220|    694|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  1.38k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 694]
  |  |  |  |  |  Branch (202:45): [True: 694, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 694, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    694|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    694|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    694|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   19|       |
   20|    694|	errstr = strerror(errno);
   21|       |
   22|       |	/* we'll assume that there's only one %m in the format string.
   23|       |	   this simplifies the code and there's really no good reason to have
   24|       |	   it multiple times. Callers can trap this case themselves. */
   25|    694|	len1 = p - fmt;
   26|    694|	len2 = strlen(errstr);
   27|    694|	len3 = strlen(p + 2);
   28|       |
   29|       |	/* @UNSAFE */
   30|    694|	buf = t_buffer_get(len1 + len2 + len3 + 1);
   31|    694|	memcpy(buf, fmt, len1);
   32|    694|	memcpy(buf + len1, errstr, len2);
   33|    694|	memcpy(buf + len1 + len2, p + 2, len3 + 1);
   34|       |
   35|    694|	*len_r = len1 + len2 + len3;
   36|    694|	return buf;
   37|    694|}

priorityq_init:
   24|  6.21k|{
   25|  6.21k|	struct priorityq *pq;
   26|       |
   27|  6.21k|	pq = i_new(struct priorityq, 1);
  ------------------
  |  |    8|  6.21k|#define i_new(type, count) p_new(default_pool, type, count)
  |  |  ------------------
  |  |  |  |   97|  6.21k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  6.21k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  |  |  ------------------
  |  |  |  |   98|  6.21k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  6.21k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  6.21k|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   28|  6.21k|	pq->cmp_callback = cmp_callback;
   29|  6.21k|	i_array_init(&pq->items, init_size);
  ------------------
  |  |   46|  6.21k|	p_array_init(array, default_pool, init_count)
  |  |  ------------------
  |  |  |  |   44|  6.21k|	array_create(array, pool, sizeof(**(array)->v), init_count)
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  6.21k|	array_create_i(&(array)->arr, pool, element_size, init_count)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   30|  6.21k|	return pq;
   31|  6.21k|}
priorityq_deinit:
   34|  6.21k|{
   35|  6.21k|	struct priorityq *pq = *_pq;
   36|       |
   37|  6.21k|	*_pq = NULL;
   38|  6.21k|	array_free(&pq->items);
  ------------------
  |  |  160|  6.21k|	array_free_i(&(array)->arr)
  ------------------
   39|  6.21k|	i_free(pq);
  ------------------
  |  |   19|  6.21k|#  define i_free(mem) p_free_and_null(default_pool, mem)
  |  |  ------------------
  |  |  |  |  135|  6.21k|#define p_free_and_null(pool, mem) p_free(pool, mem)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.21k|	STMT_START { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  6.21k|#  define STMT_START do
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.21k|		p_free_internal(pool, mem);	\
  |  |  |  |  |  |  133|  6.21k|		(mem) = NULL;			\
  |  |  |  |  |  |  134|  6.21k|	} STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|  6.21k|#  define STMT_END while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   40|  6.21k|}
priorityq_add:
  110|  36.2k|{
  111|  36.2k|	item->idx = array_count(&pq->items);
  ------------------
  |  |  200|  36.2k|	array_count_i(&(array)->arr)
  ------------------
  112|  36.2k|	array_push_back(&pq->items, &item);
  ------------------
  |  |  282|  36.2k|#define array_push_back(array, item) array_append(array, (item), 1)
  |  |  ------------------
  |  |  |  |  214|  36.2k|	TYPE_CHECKS(void, ARRAY_TYPE_CHECK(array, data), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  36.2k|	(FALSE ? (return_type)(checks) : (func))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   11|  36.2k|#  define FALSE (!1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (11:17): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:25): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  215|  36.2k|	array_append_i(&(array)->arr, data, count))
  |  |  ------------------
  ------------------
  113|  36.2k|	(void)heap_item_bubble_up(pq, item->idx);
  114|  36.2k|}
priorityq_remove:
  137|  36.2k|{
  138|  36.2k|	priorityq_remove_idx(pq, item->idx);
  139|  36.2k|	item->idx = UINT_MAX;
  140|  36.2k|}
priorityq_peek:
  143|  85.6k|{
  144|  85.6k|	struct priorityq_item *const *items;
  145|       |
  146|  85.6k|	if (array_count(&pq->items) == 0)
  ------------------
  |  |  200|  85.6k|	array_count_i(&(array)->arr)
  ------------------
  |  Branch (146:6): [True: 6.21k, False: 79.3k]
  ------------------
  147|  6.21k|		return NULL;
  148|       |
  149|  79.3k|	items = array_front(&pq->items);
  ------------------
  |  |  277|  79.3k|#define array_front(array) array_idx(array, 0)
  |  |  ------------------
  |  |  |  |  287|  79.3k|	ARRAY_TYPE_CAST_CONST(array)array_idx_i(&(array)->arr, idx)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  79.3k|	(typeof(*(array)->v))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  150|  79.3k|	return items[0];
  151|  85.6k|}
priorityq_pop:
  154|  6.21k|{
  155|  6.21k|	struct priorityq_item *item;
  156|       |
  157|  6.21k|	item = priorityq_peek(pq);
  158|  6.21k|	if (item != NULL) {
  ------------------
  |  Branch (158:6): [True: 0, False: 6.21k]
  ------------------
  159|      0|		priorityq_remove_idx(pq, 0);
  160|      0|		item->idx = UINT_MAX;
  161|      0|	}
  162|  6.21k|	return item;
  163|  6.21k|}
priorityq.c:heap_item_bubble_up:
   67|  36.2k|{
   68|  36.2k|	struct priorityq_item **items;
   69|  36.2k|	unsigned int parent_idx, count;
   70|       |
   71|  36.2k|	items = array_get_modifiable(&pq->items, &count);
  ------------------
  |  |  306|  36.2k|	ARRAY_TYPE_CAST_MODIFIABLE(array) \
  |  |  ------------------
  |  |  |  |   54|  36.2k|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  |  |  307|  36.2k|		array_get_modifiable_i(&(array)->arr, count)
  ------------------
   72|  39.6k|	while (idx > 0) {
  ------------------
  |  Branch (72:9): [True: 29.6k, False: 9.99k]
  ------------------
   73|  29.6k|		parent_idx = PARENT_IDX(idx);
  ------------------
  |  |   10|  29.6k|	(((idx) - 1) / 2)
  ------------------
   74|       |
   75|  29.6k|		i_assert(idx < count);
  ------------------
  |  |  219|  29.6k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  29.6k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  29.6k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  29.6k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 29.6k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 29.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  29.6k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  29.6k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  29.6k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   76|  29.6k|		if (pq->cmp_callback(items[idx], items[parent_idx]) >= 0)
  ------------------
  |  Branch (76:7): [True: 26.2k, False: 3.47k]
  ------------------
   77|  26.2k|			break;
   78|       |
   79|       |		/* wrong order - swap */
   80|  3.47k|		heap_items_swap(items, idx, parent_idx);
   81|  3.47k|		idx = parent_idx;
   82|  3.47k|	}
   83|  36.2k|	return idx;
   84|  36.2k|}
priorityq.c:heap_items_swap:
   49|  39.6k|{
   50|  39.6k|	struct priorityq_item *tmp;
   51|       |
   52|       |	/* swap the item indexes */
   53|  39.6k|	i_assert(items[idx1]->idx == idx1);
  ------------------
  |  |  219|  39.6k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  39.6k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  39.6k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  39.6k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 39.6k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 39.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  39.6k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  39.6k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  39.6k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   54|  39.6k|	i_assert(items[idx2]->idx == idx2);
  ------------------
  |  |  219|  39.6k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  39.6k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  39.6k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  39.6k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 39.6k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 39.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  39.6k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  39.6k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  39.6k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   55|       |
   56|  39.6k|	items[idx1]->idx = idx2;
   57|  39.6k|	items[idx2]->idx = idx1;
   58|       |
   59|       |	/* swap the item pointers */
   60|  39.6k|	tmp = items[idx1];
   61|  39.6k|	items[idx1] = items[idx2];
   62|  39.6k|	items[idx2] = tmp;
   63|  39.6k|}
priorityq.c:priorityq_remove_idx:
  117|  36.2k|{
  118|  36.2k|	struct priorityq_item **items;
  119|  36.2k|	unsigned int count;
  120|       |
  121|  36.2k|	items = array_get_modifiable(&pq->items, &count);
  ------------------
  |  |  306|  36.2k|	ARRAY_TYPE_CAST_MODIFIABLE(array) \
  |  |  ------------------
  |  |  |  |   54|  36.2k|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  |  |  307|  36.2k|		array_get_modifiable_i(&(array)->arr, count)
  ------------------
  122|  36.2k|	i_assert(idx < count);
  ------------------
  |  |  219|  36.2k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  36.2k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  36.2k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  36.2k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 36.2k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 36.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  36.2k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  36.2k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  36.2k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  123|       |
  124|       |	/* move last item over the removed one and fix the heap */
  125|  36.2k|	count--;
  126|  36.2k|	heap_items_swap(items, idx, count);
  127|  36.2k|	array_delete(&pq->items, count, 1);
  ------------------
  |  |  246|  36.2k|	array_delete_i(&(array)->arr, idx, count)
  ------------------
  128|       |
  129|  36.2k|	if (count > 0 && idx != count) {
  ------------------
  |  Branch (129:6): [True: 29.6k, False: 6.52k]
  |  Branch (129:19): [True: 3.47k, False: 26.2k]
  ------------------
  130|  3.47k|		if (idx > 0)
  ------------------
  |  Branch (130:7): [True: 0, False: 3.47k]
  ------------------
  131|      0|			idx = heap_item_bubble_up(pq, idx);
  132|  3.47k|		heap_item_bubble_down(pq, idx);
  133|  3.47k|	}
  134|  36.2k|}
priorityq.c:heap_item_bubble_down:
   87|  3.47k|{
   88|  3.47k|	struct priorityq_item **items;
   89|  3.47k|	unsigned int left_idx, right_idx, min_child_idx, count;
   90|       |
   91|  3.47k|	items = array_get_modifiable(&pq->items, &count);
  ------------------
  |  |  306|  3.47k|	ARRAY_TYPE_CAST_MODIFIABLE(array) \
  |  |  ------------------
  |  |  |  |   54|  3.47k|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  |  |  307|  3.47k|		array_get_modifiable_i(&(array)->arr, count)
  ------------------
   92|  3.47k|	while ((left_idx = LEFT_CHILD_IDX(idx)) < count) {
  ------------------
  |  |   12|  3.47k|	((idx) * 2 + 1)
  ------------------
  |  Branch (92:9): [True: 0, False: 3.47k]
  ------------------
   93|      0|		right_idx = RIGHT_CHILD_IDX(idx);
  ------------------
  |  |   14|      0|	((idx) * 2 + 2)
  ------------------
   94|      0|		if (right_idx >= count ||
  ------------------
  |  Branch (94:7): [True: 0, False: 0]
  ------------------
   95|      0|		    pq->cmp_callback(items[left_idx], items[right_idx]) < 0)
  ------------------
  |  Branch (95:7): [True: 0, False: 0]
  ------------------
   96|      0|			min_child_idx = left_idx;
   97|      0|		else
   98|      0|			min_child_idx = right_idx;
   99|       |
  100|      0|		if (pq->cmp_callback(items[min_child_idx], items[idx]) >= 0)
  ------------------
  |  Branch (100:7): [True: 0, False: 0]
  ------------------
  101|      0|			break;
  102|       |
  103|       |		/* wrong order - swap */
  104|      0|		heap_items_swap(items, idx, min_child_idx);
  105|      0|		idx = min_child_idx;
  106|      0|	}
  107|  3.47k|}

random_fill:
  120|      1|{
  121|      1|	i_assert(init_refcount > 0);
  ------------------
  |  |  219|      1|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      1|#  define STMT_START do
  |  |  ------------------
  |  |  220|      1|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      1|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      1|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      1|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      1|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  122|      1|	i_assert(size < SSIZE_T_MAX);
  ------------------
  |  |  219|      1|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      1|#  define STMT_START do
  |  |  ------------------
  |  |  220|      1|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      1|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      1|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      1|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      1|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  123|       |
  124|       |#ifdef DEBUG
  125|       |	if (kiss_in_use) {
  126|       |		for (size_t pos = 0; pos < size; pos++)
  127|       |			((unsigned char*)buf)[pos] = kiss_rand();
  128|       |		return;
  129|       |	}
  130|       |#endif
  131|       |
  132|       |#if defined(USE_ARC4RANDOM)
  133|       |	arc4random_buf(buf, size);
  134|       |#else
  135|      1|	size_t pos;
  136|      1|	ssize_t ret;
  137|       |
  138|      2|	for (pos = 0; pos < size; ) {
  ------------------
  |  Branch (138:16): [True: 1, False: 1]
  ------------------
  139|      1|		if (size >= sizeof(random_next) && random_next_size == 0) {
  ------------------
  |  Branch (139:7): [True: 0, False: 1]
  |  Branch (139:38): [True: 0, False: 0]
  ------------------
  140|       |			/* Asking for lots of randomness. Read directly to the
  141|       |			   destination buffer. */
  142|      0|			ret = random_read(PTR_OFFSET(buf, pos), size - pos);
  ------------------
  |  |   25|      0|	((void *) (((uintptr_t) (ptr)) + ((size_t) (offset))))
  ------------------
  143|      0|			if (ret > -1)
  ------------------
  |  Branch (143:8): [True: 0, False: 0]
  ------------------
  144|      0|				pos += ret;
  145|      1|		} else {
  146|       |			/* Asking for a little randomness. Read via a larger
  147|       |			   buffer to reduce the number of syscalls. */
  148|      1|			if (random_next_size > random_next_pos)
  ------------------
  |  Branch (148:8): [True: 0, False: 1]
  ------------------
  149|      0|				ret = random_next_size - random_next_pos;
  150|      1|			else {
  151|      1|				random_next_pos = 0;
  152|      1|				ret = random_read(random_next,
  153|      1|						  sizeof(random_next));
  154|      1|				random_next_size = ret < 0 ? 0 : ret;
  ------------------
  |  Branch (154:24): [True: 0, False: 1]
  ------------------
  155|      1|			}
  156|      1|			if (ret > 0) {
  ------------------
  |  Branch (156:8): [True: 1, False: 0]
  ------------------
  157|      1|				size_t used = I_MIN(size - pos, (size_t)ret);
  ------------------
  |  |   35|      1|#define I_MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  158|      1|				memcpy(PTR_OFFSET(buf, pos),
  ------------------
  |  |   84|      1|#  define memcpy(dest, src, n) i_memcpy(dest, src, n)
  ------------------
  159|      1|				       random_next + random_next_pos, used);
  160|      1|				random_next_pos += used;
  161|      1|				pos += used;
  162|      1|			}
  163|      1|		}
  164|      1|	}
  165|      1|#endif /* defined(USE_ARC4RANDOM) */
  166|      1|}
random_init:
  169|      1|{
  170|       |	/* static analyzer seems to require this */
  171|      1|	unsigned int seed = 0;
  172|      1|	const char *env_seed;
  173|       |
  174|      1|	if (init_refcount++ > 0)
  ------------------
  |  Branch (174:6): [True: 0, False: 1]
  ------------------
  175|      0|		return;
  176|       |
  177|      1|	env_seed = getenv("DOVECOT_SRAND");
  178|       |#ifdef DEBUG
  179|       |	if (env_seed != NULL && str_to_uint(env_seed, &seed) >= 0) {
  180|       |		kiss_init(seed);
  181|       |		/* getrandom_present = FALSE; not needed, only used in random_read() */
  182|       |		goto normal_exit;
  183|       |	}
  184|       |#else
  185|      1|	if (env_seed != NULL && *env_seed != '\0')
  ------------------
  |  Branch (185:6): [True: 0, False: 1]
  |  Branch (185:26): [True: 0, False: 0]
  ------------------
  186|      0|		i_warning("DOVECOT_SRAND is not available in non-debug builds");
  187|      1|#endif /* DEBUG */
  188|       |
  189|       |#if defined(USE_RANDOM_DEV)
  190|       |	random_open_urandom();
  191|       |#endif
  192|       |	/* DO NOT REMOVE THIS - It is also
  193|       |	   needed to make sure getrandom really works.
  194|       |	*/
  195|      1|	random_fill(&seed, sizeof(seed));
  196|       |#ifdef DEBUG
  197|       |	if (env_seed != NULL) {
  198|       |		if (strcmp(env_seed, "kiss") != 0)
  199|       |			i_fatal("DOVECOT_SRAND not a number or 'kiss'");
  200|       |		kiss_init(seed);
  201|       |		i_close_fd(&urandom_fd);
  202|       |	}
  203|       |
  204|       |normal_exit:
  205|       |#endif
  206|      1|	srand(seed);
  207|      1|}
randgen.c:random_read:
   83|      1|{
   84|      1|	ssize_t ret = 0;
   85|      1|# if defined(USE_GETRANDOM)
   86|      1|	if (getrandom_present) {
  ------------------
  |  Branch (86:6): [True: 1, False: 0]
  ------------------
   87|      1|		ret = getrandom(buf, size, 0);
   88|      1|		if (ret < 0 && errno == ENOSYS) {
  ------------------
  |  Branch (88:7): [True: 0, False: 1]
  |  Branch (88:18): [True: 0, False: 0]
  ------------------
   89|      0|			getrandom_present = FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
   90|       |			/* It gets complicated here...  While the libc (and its
   91|       |			headers) indicated that getrandom() was available when
   92|       |			we were compiled, the kernel disagreed just now at
   93|       |			runtime. Fall back to reading /dev/urandom. */
   94|      0|			random_open_urandom();
   95|      0|		}
   96|      1|	}
   97|       |	/* this is here to avoid clang complain,
   98|       |	   because getrandom_present will be always FALSE
   99|       |	   if USE_GETRANDOM is not defined */
  100|      1|	if (!getrandom_present)
  ------------------
  |  Branch (100:6): [True: 0, False: 1]
  ------------------
  101|      0|# endif
  102|      0|		ret = read(urandom_fd, buf, size);
  103|      1|	if (unlikely(ret <= 0)) {
  ------------------
  |  |  202|      1|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  ------------------
  |  |  |  Branch (202:26): [True: 0, False: 1]
  |  |  |  Branch (202:44): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  104|      0|		if (ret == 0) {
  ------------------
  |  Branch (104:7): [True: 0, False: 0]
  ------------------
  105|      0|			i_fatal("read("DEV_URANDOM_PATH") failed: EOF");
  106|      0|		} else if (errno != EINTR) {
  ------------------
  |  Branch (106:14): [True: 0, False: 0]
  ------------------
  107|      0|			if (getrandom_present) {
  ------------------
  |  Branch (107:8): [True: 0, False: 0]
  ------------------
  108|      0|				i_fatal("getrandom() failed: %m");
  109|      0|			} else {
  110|      0|				i_fatal("read("DEV_URANDOM_PATH") failed: %m");
  111|      0|			}
  112|      0|		}
  113|      0|	}
  114|      1|	i_assert(ret > 0 || errno == EINTR);
  ------------------
  |  |  219|      1|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      1|#  define STMT_START do
  |  |  ------------------
  |  |  220|      1|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      1|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1]
  |  |  |  |  |  Branch (202:45): [True: 1, False: 0]
  |  |  |  |  |  Branch (202:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      1|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      1|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      1|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  115|      1|	return ret;
  116|      1|}

safe_memset:
    7|      1|{
    8|      1|	volatile unsigned int volatile_zero_idx = 0;
    9|      1|	volatile unsigned char *p = data;
   10|       |
   11|      1|	if (size == 0)
  ------------------
  |  Branch (11:6): [True: 0, False: 1]
  ------------------
   12|      0|		return;
   13|       |
   14|      1|	do {
   15|      1|		memset(data, c, size);
   16|      1|	} while (p[volatile_zero_idx] != c);
  ------------------
  |  Branch (16:11): [True: 0, False: 1]
  ------------------
   17|      1|}

sha1_init:
  162|      1|{
  163|      1|	memset(ctxt, 0, sizeof(struct sha1_ctxt));
  164|      1|	H(0) = 0x67452301;
  ------------------
  |  |   52|      1|#define	H(n)	(ctxt->h.b32[(n)])
  ------------------
  165|      1|	H(1) = 0xefcdab89;
  ------------------
  |  |   52|      1|#define	H(n)	(ctxt->h.b32[(n)])
  ------------------
  166|      1|	H(2) = 0x98badcfe;
  ------------------
  |  |   52|      1|#define	H(n)	(ctxt->h.b32[(n)])
  ------------------
  167|      1|	H(3) = 0x10325476;
  ------------------
  |  |   52|      1|#define	H(n)	(ctxt->h.b32[(n)])
  ------------------
  168|      1|	H(4) = 0xc3d2e1f0;
  ------------------
  |  |   52|      1|#define	H(n)	(ctxt->h.b32[(n)])
  ------------------
  169|      1|}
sha1_pad:
  173|      1|{
  174|      1|	size_t padlen;		/*pad length in bytes*/
  175|      1|	size_t padstart;
  176|       |
  177|      1|	PUTPAD(0x80);
  ------------------
  |  |   66|      1|#define	PUTPAD(x)	{ \
  |  |   67|      1|	ctxt->m.b8[(COUNT % 64)] = (x);		\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   68|      1|	COUNT++;				\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   69|      1|	COUNT %= 64;				\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   70|      1|	if (COUNT % 64 == 0)			\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |  |  Branch (70:6): [True: 0, False: 1]
  |  |  ------------------
  |  |   71|      1|		sha1_step(ctxt);		\
  |  |   72|      1|     }
  ------------------
  178|       |
  179|      1|	padstart = COUNT % 64;
  ------------------
  |  |   53|      1|#define	COUNT	(ctxt->count)
  ------------------
  180|      1|	padlen = 64 - padstart;
  181|      1|	if (padlen < 8) {
  ------------------
  |  Branch (181:6): [True: 0, False: 1]
  ------------------
  182|      0|		memset(&ctxt->m.b8[padstart], 0, padlen);
  183|      0|		COUNT += padlen;
  ------------------
  |  |   53|      0|#define	COUNT	(ctxt->count)
  ------------------
  184|      0|		COUNT %= 64;
  ------------------
  |  |   53|      0|#define	COUNT	(ctxt->count)
  ------------------
  185|      0|		sha1_step(ctxt);
  186|      0|		padstart = COUNT % 64;	/* should be 0 */
  ------------------
  |  |   53|      0|#define	COUNT	(ctxt->count)
  ------------------
  187|      0|		padlen = 64 - padstart;	/* should be 64 */
  188|      0|	}
  189|      1|	memset(&ctxt->m.b8[padstart], 0, padlen - 8);
  190|      1|	COUNT += (padlen - 8);
  ------------------
  |  |   53|      1|#define	COUNT	(ctxt->count)
  ------------------
  191|      1|	COUNT %= 64;
  ------------------
  |  |   53|      1|#define	COUNT	(ctxt->count)
  ------------------
  192|       |#ifdef WORDS_BIGENDIAN
  193|       |	PUTPAD(ctxt->c.b8[0]); PUTPAD(ctxt->c.b8[1]);
  194|       |	PUTPAD(ctxt->c.b8[2]); PUTPAD(ctxt->c.b8[3]);
  195|       |	PUTPAD(ctxt->c.b8[4]); PUTPAD(ctxt->c.b8[5]);
  196|       |	PUTPAD(ctxt->c.b8[6]); PUTPAD(ctxt->c.b8[7]);
  197|       |#else
  198|      1|	PUTPAD(ctxt->c.b8[7]); PUTPAD(ctxt->c.b8[6]);
  ------------------
  |  |   66|      1|#define	PUTPAD(x)	{ \
  |  |   67|      1|	ctxt->m.b8[(COUNT % 64)] = (x);		\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   68|      1|	COUNT++;				\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   69|      1|	COUNT %= 64;				\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   70|      1|	if (COUNT % 64 == 0)			\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |  |  Branch (70:6): [True: 0, False: 1]
  |  |  ------------------
  |  |   71|      1|		sha1_step(ctxt);		\
  |  |   72|      1|     }
  ------------------
              	PUTPAD(ctxt->c.b8[7]); PUTPAD(ctxt->c.b8[6]);
  ------------------
  |  |   66|      1|#define	PUTPAD(x)	{ \
  |  |   67|      1|	ctxt->m.b8[(COUNT % 64)] = (x);		\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   68|      1|	COUNT++;				\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   69|      1|	COUNT %= 64;				\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   70|      1|	if (COUNT % 64 == 0)			\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |  |  Branch (70:6): [True: 0, False: 1]
  |  |  ------------------
  |  |   71|      1|		sha1_step(ctxt);		\
  |  |   72|      1|     }
  ------------------
  199|      1|	PUTPAD(ctxt->c.b8[5]); PUTPAD(ctxt->c.b8[4]);
  ------------------
  |  |   66|      1|#define	PUTPAD(x)	{ \
  |  |   67|      1|	ctxt->m.b8[(COUNT % 64)] = (x);		\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   68|      1|	COUNT++;				\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   69|      1|	COUNT %= 64;				\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   70|      1|	if (COUNT % 64 == 0)			\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |  |  Branch (70:6): [True: 0, False: 1]
  |  |  ------------------
  |  |   71|      1|		sha1_step(ctxt);		\
  |  |   72|      1|     }
  ------------------
              	PUTPAD(ctxt->c.b8[5]); PUTPAD(ctxt->c.b8[4]);
  ------------------
  |  |   66|      1|#define	PUTPAD(x)	{ \
  |  |   67|      1|	ctxt->m.b8[(COUNT % 64)] = (x);		\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   68|      1|	COUNT++;				\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   69|      1|	COUNT %= 64;				\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   70|      1|	if (COUNT % 64 == 0)			\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |  |  Branch (70:6): [True: 0, False: 1]
  |  |  ------------------
  |  |   71|      1|		sha1_step(ctxt);		\
  |  |   72|      1|     }
  ------------------
  200|      1|	PUTPAD(ctxt->c.b8[3]); PUTPAD(ctxt->c.b8[2]);
  ------------------
  |  |   66|      1|#define	PUTPAD(x)	{ \
  |  |   67|      1|	ctxt->m.b8[(COUNT % 64)] = (x);		\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   68|      1|	COUNT++;				\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   69|      1|	COUNT %= 64;				\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   70|      1|	if (COUNT % 64 == 0)			\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |  |  Branch (70:6): [True: 0, False: 1]
  |  |  ------------------
  |  |   71|      1|		sha1_step(ctxt);		\
  |  |   72|      1|     }
  ------------------
              	PUTPAD(ctxt->c.b8[3]); PUTPAD(ctxt->c.b8[2]);
  ------------------
  |  |   66|      1|#define	PUTPAD(x)	{ \
  |  |   67|      1|	ctxt->m.b8[(COUNT % 64)] = (x);		\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   68|      1|	COUNT++;				\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   69|      1|	COUNT %= 64;				\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   70|      1|	if (COUNT % 64 == 0)			\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |  |  Branch (70:6): [True: 0, False: 1]
  |  |  ------------------
  |  |   71|      1|		sha1_step(ctxt);		\
  |  |   72|      1|     }
  ------------------
  201|      1|	PUTPAD(ctxt->c.b8[1]); PUTPAD(ctxt->c.b8[0]);
  ------------------
  |  |   66|      1|#define	PUTPAD(x)	{ \
  |  |   67|      1|	ctxt->m.b8[(COUNT % 64)] = (x);		\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   68|      1|	COUNT++;				\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   69|      1|	COUNT %= 64;				\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   70|      1|	if (COUNT % 64 == 0)			\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |  |  Branch (70:6): [True: 0, False: 1]
  |  |  ------------------
  |  |   71|      1|		sha1_step(ctxt);		\
  |  |   72|      1|     }
  ------------------
              	PUTPAD(ctxt->c.b8[1]); PUTPAD(ctxt->c.b8[0]);
  ------------------
  |  |   66|      1|#define	PUTPAD(x)	{ \
  |  |   67|      1|	ctxt->m.b8[(COUNT % 64)] = (x);		\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   68|      1|	COUNT++;				\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   69|      1|	COUNT %= 64;				\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |   70|      1|	if (COUNT % 64 == 0)			\
  |  |  ------------------
  |  |  |  |   53|      1|#define	COUNT	(ctxt->count)
  |  |  ------------------
  |  |  |  Branch (70:6): [True: 1, False: 0]
  |  |  ------------------
  |  |   71|      1|		sha1_step(ctxt);		\
  |  |   72|      1|     }
  ------------------
  202|      1|#endif
  203|      1|}
sha1_loop:
  207|      1|{
  208|      1|	const unsigned char *input_c = input;
  209|      1|	size_t gaplen;
  210|      1|	size_t gapstart;
  211|      1|	size_t off;
  212|      1|	size_t copysiz;
  213|       |
  214|      1|	off = 0;
  215|       |
  216|      2|	while (off < len) {
  ------------------
  |  Branch (216:9): [True: 1, False: 1]
  ------------------
  217|      1|		gapstart = COUNT % 64;
  ------------------
  |  |   53|      1|#define	COUNT	(ctxt->count)
  ------------------
  218|      1|		gaplen = 64 - gapstart;
  219|       |
  220|      1|		copysiz = (gaplen < len - off) ? gaplen : len - off;
  ------------------
  |  Branch (220:13): [True: 0, False: 1]
  ------------------
  221|      1|		memmove(&ctxt->m.b8[gapstart], &input_c[off], copysiz);
  222|      1|		COUNT += copysiz;
  ------------------
  |  |   53|      1|#define	COUNT	(ctxt->count)
  ------------------
  223|      1|		COUNT %= 64;
  ------------------
  |  |   53|      1|#define	COUNT	(ctxt->count)
  ------------------
  224|      1|		ctxt->c.b64[0] += copysiz * 8;
  225|      1|		if (COUNT % 64 == 0)
  ------------------
  |  |   53|      1|#define	COUNT	(ctxt->count)
  ------------------
  |  Branch (225:7): [True: 0, False: 1]
  ------------------
  226|      0|			sha1_step(ctxt);
  227|      1|		off += copysiz;
  228|      1|	}
  229|      1|}
sha1_result_libmysqlclient_craps_all_over:
  233|      1|{
  234|      1|	uint8_t *digest;
  235|       |
  236|      1|	digest = (uint8_t *)digest0;
  237|      1|	sha1_pad(ctxt);
  238|       |#ifdef WORDS_BIGENDIAN
  239|       |	memmove(digest, &ctxt->h.b8[0], 20);
  240|       |#else
  241|      1|	digest[0] = ctxt->h.b8[3]; digest[1] = ctxt->h.b8[2];
  242|      1|	digest[2] = ctxt->h.b8[1]; digest[3] = ctxt->h.b8[0];
  243|      1|	digest[4] = ctxt->h.b8[7]; digest[5] = ctxt->h.b8[6];
  244|      1|	digest[6] = ctxt->h.b8[5]; digest[7] = ctxt->h.b8[4];
  245|      1|	digest[8] = ctxt->h.b8[11]; digest[9] = ctxt->h.b8[10];
  246|      1|	digest[10] = ctxt->h.b8[9]; digest[11] = ctxt->h.b8[8];
  247|      1|	digest[12] = ctxt->h.b8[15]; digest[13] = ctxt->h.b8[14];
  248|      1|	digest[14] = ctxt->h.b8[13]; digest[15] = ctxt->h.b8[12];
  249|      1|	digest[16] = ctxt->h.b8[19]; digest[17] = ctxt->h.b8[18];
  250|      1|	digest[18] = ctxt->h.b8[17]; digest[19] = ctxt->h.b8[16];
  251|      1|#endif
  252|      1|	safe_memset(ctxt, 0, sizeof(struct sha1_ctxt));
  253|      1|}
sha1_get_digest:
  257|      1|{
  258|      1|	struct sha1_ctxt ctx;
  259|       |
  260|      1|	sha1_init(&ctx);
  261|      1|	sha1_loop(&ctx, data, size);
  262|      1|	sha1_result(&ctx, result);
  ------------------
  |  |   47|      1|#define sha1_result sha1_result_libmysqlclient_craps_all_over
  ------------------
  263|      1|}
sha1.c:sha1_step:
   78|      1|{
   79|      1|	uint32_t	a, b, c, d, e;
   80|      1|	size_t t, s;
   81|      1|	uint32_t	tmp;
   82|       |
   83|      1|#ifndef WORDS_BIGENDIAN
   84|      1|	struct sha1_ctxt tctxt;
   85|      1|	memmove(&tctxt.m.b8[0], &ctxt->m.b8[0], 64);
   86|      1|	ctxt->m.b8[0] = tctxt.m.b8[3]; ctxt->m.b8[1] = tctxt.m.b8[2];
   87|      1|	ctxt->m.b8[2] = tctxt.m.b8[1]; ctxt->m.b8[3] = tctxt.m.b8[0];
   88|      1|	ctxt->m.b8[4] = tctxt.m.b8[7]; ctxt->m.b8[5] = tctxt.m.b8[6];
   89|      1|	ctxt->m.b8[6] = tctxt.m.b8[5]; ctxt->m.b8[7] = tctxt.m.b8[4];
   90|      1|	ctxt->m.b8[8] = tctxt.m.b8[11]; ctxt->m.b8[9] = tctxt.m.b8[10];
   91|      1|	ctxt->m.b8[10] = tctxt.m.b8[9]; ctxt->m.b8[11] = tctxt.m.b8[8];
   92|      1|	ctxt->m.b8[12] = tctxt.m.b8[15]; ctxt->m.b8[13] = tctxt.m.b8[14];
   93|      1|	ctxt->m.b8[14] = tctxt.m.b8[13]; ctxt->m.b8[15] = tctxt.m.b8[12];
   94|      1|	ctxt->m.b8[16] = tctxt.m.b8[19]; ctxt->m.b8[17] = tctxt.m.b8[18];
   95|      1|	ctxt->m.b8[18] = tctxt.m.b8[17]; ctxt->m.b8[19] = tctxt.m.b8[16];
   96|      1|	ctxt->m.b8[20] = tctxt.m.b8[23]; ctxt->m.b8[21] = tctxt.m.b8[22];
   97|      1|	ctxt->m.b8[22] = tctxt.m.b8[21]; ctxt->m.b8[23] = tctxt.m.b8[20];
   98|      1|	ctxt->m.b8[24] = tctxt.m.b8[27]; ctxt->m.b8[25] = tctxt.m.b8[26];
   99|      1|	ctxt->m.b8[26] = tctxt.m.b8[25]; ctxt->m.b8[27] = tctxt.m.b8[24];
  100|      1|	ctxt->m.b8[28] = tctxt.m.b8[31]; ctxt->m.b8[29] = tctxt.m.b8[30];
  101|      1|	ctxt->m.b8[30] = tctxt.m.b8[29]; ctxt->m.b8[31] = tctxt.m.b8[28];
  102|      1|	ctxt->m.b8[32] = tctxt.m.b8[35]; ctxt->m.b8[33] = tctxt.m.b8[34];
  103|      1|	ctxt->m.b8[34] = tctxt.m.b8[33]; ctxt->m.b8[35] = tctxt.m.b8[32];
  104|      1|	ctxt->m.b8[36] = tctxt.m.b8[39]; ctxt->m.b8[37] = tctxt.m.b8[38];
  105|      1|	ctxt->m.b8[38] = tctxt.m.b8[37]; ctxt->m.b8[39] = tctxt.m.b8[36];
  106|      1|	ctxt->m.b8[40] = tctxt.m.b8[43]; ctxt->m.b8[41] = tctxt.m.b8[42];
  107|      1|	ctxt->m.b8[42] = tctxt.m.b8[41]; ctxt->m.b8[43] = tctxt.m.b8[40];
  108|      1|	ctxt->m.b8[44] = tctxt.m.b8[47]; ctxt->m.b8[45] = tctxt.m.b8[46];
  109|      1|	ctxt->m.b8[46] = tctxt.m.b8[45]; ctxt->m.b8[47] = tctxt.m.b8[44];
  110|      1|	ctxt->m.b8[48] = tctxt.m.b8[51]; ctxt->m.b8[49] = tctxt.m.b8[50];
  111|      1|	ctxt->m.b8[50] = tctxt.m.b8[49]; ctxt->m.b8[51] = tctxt.m.b8[48];
  112|      1|	ctxt->m.b8[52] = tctxt.m.b8[55]; ctxt->m.b8[53] = tctxt.m.b8[54];
  113|      1|	ctxt->m.b8[54] = tctxt.m.b8[53]; ctxt->m.b8[55] = tctxt.m.b8[52];
  114|      1|	ctxt->m.b8[56] = tctxt.m.b8[59]; ctxt->m.b8[57] = tctxt.m.b8[58];
  115|      1|	ctxt->m.b8[58] = tctxt.m.b8[57]; ctxt->m.b8[59] = tctxt.m.b8[56];
  116|      1|	ctxt->m.b8[60] = tctxt.m.b8[63]; ctxt->m.b8[61] = tctxt.m.b8[62];
  117|      1|	ctxt->m.b8[62] = tctxt.m.b8[61]; ctxt->m.b8[63] = tctxt.m.b8[60];
  118|      1|#endif
  119|       |
  120|      1|	a = H(0); b = H(1); c = H(2); d = H(3); e = H(4);
  ------------------
  |  |   52|      1|#define	H(n)	(ctxt->h.b32[(n)])
  ------------------
              	a = H(0); b = H(1); c = H(2); d = H(3); e = H(4);
  ------------------
  |  |   52|      1|#define	H(n)	(ctxt->h.b32[(n)])
  ------------------
              	a = H(0); b = H(1); c = H(2); d = H(3); e = H(4);
  ------------------
  |  |   52|      1|#define	H(n)	(ctxt->h.b32[(n)])
  ------------------
              	a = H(0); b = H(1); c = H(2); d = H(3); e = H(4);
  ------------------
  |  |   52|      1|#define	H(n)	(ctxt->h.b32[(n)])
  ------------------
              	a = H(0); b = H(1); c = H(2); d = H(3); e = H(4);
  ------------------
  |  |   52|      1|#define	H(n)	(ctxt->h.b32[(n)])
  ------------------
  121|       |
  122|     21|	for (t = 0; t < 20; t++) {
  ------------------
  |  Branch (122:14): [True: 20, False: 1]
  ------------------
  123|     20|		s = t & 0x0f;
  124|     20|		if (t >= 16) {
  ------------------
  |  Branch (124:7): [True: 4, False: 16]
  ------------------
  125|      4|			W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^ W((s+2) & 0x0f) ^ W(s));
  ------------------
  |  |   55|      4|#define	W(n)	(ctxt->m.b32[(n)])
  ------------------
              			W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^ W((s+2) & 0x0f) ^ W(s));
  ------------------
  |  |   50|      4|#define	S(n, x)		(((x) << (n)) | ((x) >> (32 - n)))
  ------------------
  126|      4|		}
  127|     20|		tmp = S(5, a) + F0(b, c, d) + e + W(s) + K(t);
  ------------------
  |  |   50|     20|#define	S(n, x)		(((x) << (n)) | ((x) >> (32 - n)))
  ------------------
              		tmp = S(5, a) + F0(b, c, d) + e + W(s) + K(t);
  ------------------
  |  |   45|     20|#define	F0(b, c, d)	(((b) & (c)) | ((~(b)) & (d)))
  ------------------
              		tmp = S(5, a) + F0(b, c, d) + e + W(s) + K(t);
  ------------------
  |  |   55|     20|#define	W(n)	(ctxt->m.b32[(n)])
  ------------------
              		tmp = S(5, a) + F0(b, c, d) + e + W(s) + K(t);
  ------------------
  |  |   43|     20|#define	K(t)	SHA1_K[(t) / 20]
  ------------------
  128|     20|		e = d; d = c; c = S(30, b); b = a; a = tmp;
  ------------------
  |  |   50|     20|#define	S(n, x)		(((x) << (n)) | ((x) >> (32 - n)))
  ------------------
  129|     20|	}
  130|     21|	for (t = 20; t < 40; t++) {
  ------------------
  |  Branch (130:15): [True: 20, False: 1]
  ------------------
  131|     20|		s = t & 0x0f;
  132|     20|		W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^ W((s+2) & 0x0f) ^ W(s));
  ------------------
  |  |   55|     20|#define	W(n)	(ctxt->m.b32[(n)])
  ------------------
              		W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^ W((s+2) & 0x0f) ^ W(s));
  ------------------
  |  |   50|     20|#define	S(n, x)		(((x) << (n)) | ((x) >> (32 - n)))
  ------------------
  133|     20|		tmp = S(5, a) + F1(b, c, d) + e + W(s) + K(t);
  ------------------
  |  |   50|     20|#define	S(n, x)		(((x) << (n)) | ((x) >> (32 - n)))
  ------------------
              		tmp = S(5, a) + F1(b, c, d) + e + W(s) + K(t);
  ------------------
  |  |   46|     20|#define	F1(b, c, d)	(((b) ^ (c)) ^ (d))
  ------------------
              		tmp = S(5, a) + F1(b, c, d) + e + W(s) + K(t);
  ------------------
  |  |   55|     20|#define	W(n)	(ctxt->m.b32[(n)])
  ------------------
              		tmp = S(5, a) + F1(b, c, d) + e + W(s) + K(t);
  ------------------
  |  |   43|     20|#define	K(t)	SHA1_K[(t) / 20]
  ------------------
  134|     20|		e = d; d = c; c = S(30, b); b = a; a = tmp;
  ------------------
  |  |   50|     20|#define	S(n, x)		(((x) << (n)) | ((x) >> (32 - n)))
  ------------------
  135|     20|	}
  136|     21|	for (t = 40; t < 60; t++) {
  ------------------
  |  Branch (136:15): [True: 20, False: 1]
  ------------------
  137|     20|		s = t & 0x0f;
  138|     20|		W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^ W((s+2) & 0x0f) ^ W(s));
  ------------------
  |  |   55|     20|#define	W(n)	(ctxt->m.b32[(n)])
  ------------------
              		W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^ W((s+2) & 0x0f) ^ W(s));
  ------------------
  |  |   50|     20|#define	S(n, x)		(((x) << (n)) | ((x) >> (32 - n)))
  ------------------
  139|     20|		tmp = S(5, a) + F2(b, c, d) + e + W(s) + K(t);
  ------------------
  |  |   50|     20|#define	S(n, x)		(((x) << (n)) | ((x) >> (32 - n)))
  ------------------
              		tmp = S(5, a) + F2(b, c, d) + e + W(s) + K(t);
  ------------------
  |  |   47|     20|#define	F2(b, c, d)	(((b) & (c)) | ((b) & (d)) | ((c) & (d)))
  ------------------
              		tmp = S(5, a) + F2(b, c, d) + e + W(s) + K(t);
  ------------------
  |  |   55|     20|#define	W(n)	(ctxt->m.b32[(n)])
  ------------------
              		tmp = S(5, a) + F2(b, c, d) + e + W(s) + K(t);
  ------------------
  |  |   43|     20|#define	K(t)	SHA1_K[(t) / 20]
  ------------------
  140|     20|		e = d; d = c; c = S(30, b); b = a; a = tmp;
  ------------------
  |  |   50|     20|#define	S(n, x)		(((x) << (n)) | ((x) >> (32 - n)))
  ------------------
  141|     20|	}
  142|     21|	for (t = 60; t < 80; t++) {
  ------------------
  |  Branch (142:15): [True: 20, False: 1]
  ------------------
  143|     20|		s = t & 0x0f;
  144|     20|		W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^ W((s+2) & 0x0f) ^ W(s));
  ------------------
  |  |   55|     20|#define	W(n)	(ctxt->m.b32[(n)])
  ------------------
              		W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^ W((s+2) & 0x0f) ^ W(s));
  ------------------
  |  |   50|     20|#define	S(n, x)		(((x) << (n)) | ((x) >> (32 - n)))
  ------------------
  145|     20|		tmp = S(5, a) + F3(b, c, d) + e + W(s) + K(t);
  ------------------
  |  |   50|     20|#define	S(n, x)		(((x) << (n)) | ((x) >> (32 - n)))
  ------------------
              		tmp = S(5, a) + F3(b, c, d) + e + W(s) + K(t);
  ------------------
  |  |   48|     20|#define	F3(b, c, d)	(((b) ^ (c)) ^ (d))
  ------------------
              		tmp = S(5, a) + F3(b, c, d) + e + W(s) + K(t);
  ------------------
  |  |   55|     20|#define	W(n)	(ctxt->m.b32[(n)])
  ------------------
              		tmp = S(5, a) + F3(b, c, d) + e + W(s) + K(t);
  ------------------
  |  |   43|     20|#define	K(t)	SHA1_K[(t) / 20]
  ------------------
  146|     20|		e = d; d = c; c = S(30, b); b = a; a = tmp;
  ------------------
  |  |   50|     20|#define	S(n, x)		(((x) << (n)) | ((x) >> (32 - n)))
  ------------------
  147|     20|	}
  148|       |
  149|      1|	H(0) = H(0) + a;
  ------------------
  |  |   52|      1|#define	H(n)	(ctxt->h.b32[(n)])
  ------------------
              	H(0) = H(0) + a;
  ------------------
  |  |   52|      1|#define	H(n)	(ctxt->h.b32[(n)])
  ------------------
  150|      1|	H(1) = H(1) + b;
  ------------------
  |  |   52|      1|#define	H(n)	(ctxt->h.b32[(n)])
  ------------------
              	H(1) = H(1) + b;
  ------------------
  |  |   52|      1|#define	H(n)	(ctxt->h.b32[(n)])
  ------------------
  151|      1|	H(2) = H(2) + c;
  ------------------
  |  |   52|      1|#define	H(n)	(ctxt->h.b32[(n)])
  ------------------
              	H(2) = H(2) + c;
  ------------------
  |  |   52|      1|#define	H(n)	(ctxt->h.b32[(n)])
  ------------------
  152|      1|	H(3) = H(3) + d;
  ------------------
  |  |   52|      1|#define	H(n)	(ctxt->h.b32[(n)])
  ------------------
              	H(3) = H(3) + d;
  ------------------
  |  |   52|      1|#define	H(n)	(ctxt->h.b32[(n)])
  ------------------
  153|      1|	H(4) = H(4) + e;
  ------------------
  |  |   52|      1|#define	H(n)	(ctxt->h.b32[(n)])
  ------------------
              	H(4) = H(4) + e;
  ------------------
  |  |   52|      1|#define	H(n)	(ctxt->h.b32[(n)])
  ------------------
  154|       |
  155|      1|	memset(&ctxt->m.b8[0], 0, 64);
  156|      1|}

i_sleep_intr_msecs:
   59|  3.72k|{
   60|  3.72k|	struct timespec ts_sleep;
   61|       |
   62|  3.72k|	ts_sleep.tv_sec = (time_t)(msecs / 1000);
   63|  3.72k|	ts_sleep.tv_nsec = (long)(msecs % 1000) * 1000000;
   64|  3.72k|	return sleep_timespec(&ts_sleep, TRUE);
  ------------------
  |  |   15|  3.72k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  3.72k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   65|  3.72k|}
sleep.c:sleep_timespec:
   10|  3.72k|{
   11|  3.72k|	struct timespec ts_remain = *ts_sleep;
   12|       |
   13|  3.72k|	while (nanosleep(&ts_remain, &ts_remain) < 0) {
  ------------------
  |  Branch (13:9): [True: 0, False: 3.72k]
  ------------------
   14|      0|		if (errno != EINTR)
  ------------------
  |  Branch (14:7): [True: 0, False: 0]
  ------------------
   15|      0|			i_fatal("nanosleep(): %m");
   16|      0|		if (interruptible)
  ------------------
  |  Branch (16:7): [True: 0, False: 0]
  ------------------
   17|      0|			return FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
   18|      0|	}
   19|  3.72k|	return TRUE;
  ------------------
  |  |   15|  3.72k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  3.72k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
   20|  3.72k|}

str_sanitize_append:
   63|  1.78k|{
   64|  1.78k|	size_t initial_pos = str_len(dest);
   65|  1.78k|	unichar_t chr;
   66|  1.78k|	size_t i;
   67|       |
   68|   230k|	for (i = 0; i < max_bytes && src[i] != '\0'; ) {
  ------------------
  |  Branch (68:14): [True: 228k, False: 1.78k]
  |  Branch (68:31): [True: 228k, False: 0]
  ------------------
   69|   228k|		int len = uni_utf8_get_char_n(src+i, max_bytes-i, &chr);
   70|   228k|		if (len == 0)
  ------------------
  |  Branch (70:7): [True: 0, False: 228k]
  ------------------
   71|      0|			break; /* input ended too early */
   72|       |
   73|   228k|		if (len < 0) {
  ------------------
  |  Branch (73:7): [True: 0, False: 228k]
  ------------------
   74|       |			/* invalid UTF-8 */
   75|      0|			str_append_c(dest, '?');
  ------------------
  |  |   54|      0|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|      0|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|      0|			(unsigned char)(chr), (chr)))
  ------------------
   76|      0|			i++;
   77|      0|			continue;
   78|      0|		}
   79|   228k|		if (i_iscntrl(src[i]))
  ------------------
  |  |  108|   228k|#define i_iscntrl(x) (iscntrl((int) (unsigned char) (x)) != 0)
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 228k]
  |  |  ------------------
  ------------------
   80|      0|			str_append_c(dest, '?');
  ------------------
  |  |   54|      0|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|      0|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|      0|			(unsigned char)(chr), (chr)))
  ------------------
   81|   228k|		else
   82|   228k|			str_append_data(dest, src+i, len);
   83|   228k|		i += len;
   84|   228k|	}
   85|       |
   86|  1.78k|	if (src[i] != '\0') {
  ------------------
  |  Branch (86:6): [True: 1.78k, False: 0]
  ------------------
   87|  1.78k|		if (max_bytes < 3)
  ------------------
  |  Branch (87:7): [True: 0, False: 1.78k]
  ------------------
   88|      0|			str_truncate(dest, initial_pos);
   89|  1.78k|		else {
   90|  7.14k|			while (str_len(dest) - initial_pos > max_bytes-3)
  ------------------
  |  Branch (90:11): [True: 5.36k, False: 1.78k]
  ------------------
   91|  5.36k|				str_sanitize_truncate_char(dest, initial_pos);
   92|  1.78k|		}
   93|  1.78k|		str_append(dest, "...");
   94|  1.78k|	}
   95|  1.78k|}
str_sanitize:
  134|  12.1k|{
  135|  12.1k|	string_t *str;
  136|  12.1k|	size_t i;
  137|       |
  138|  12.1k|	if (src == NULL)
  ------------------
  |  Branch (138:6): [True: 0, False: 12.1k]
  ------------------
  139|      0|		return NULL;
  140|       |
  141|  12.1k|	i = str_sanitize_skip_start(src, max_bytes);
  142|  12.1k|	if (src[i] == '\0')
  ------------------
  |  Branch (142:6): [True: 10.4k, False: 1.78k]
  ------------------
  143|  10.4k|		return src;
  144|       |
  145|  1.78k|	str = t_str_new(I_MIN(max_bytes, 256));
  ------------------
  |  |   35|  1.78k|#define I_MIN(a, b)  (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 1.78k, False: 0]
  |  |  ------------------
  ------------------
  146|  1.78k|	str_sanitize_append(str, src, max_bytes);
  147|  1.78k|	return str_c(str);
  148|  12.1k|}
str-sanitize.c:str_sanitize_truncate_char:
   48|  5.36k|{
   49|  5.36k|	const unsigned char *data = str_data(dest);
   50|  5.36k|	size_t len = str_len(dest);
   51|       |
   52|  5.36k|	i_assert(len >= initial_pos);
  ------------------
  |  |  219|  5.36k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  5.36k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  5.36k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  5.36k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 5.36k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 5.36k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  5.36k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  5.36k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  5.36k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   53|  5.36k|	if (len == initial_pos)
  ------------------
  |  Branch (53:6): [True: 0, False: 5.36k]
  ------------------
   54|      0|		return;
   55|       |
   56|  5.36k|	data += initial_pos;
   57|  5.36k|	len -= initial_pos;
   58|  5.36k|	str_truncate(dest, initial_pos +
   59|  5.36k|		uni_utf8_data_truncate(data, len, len-1));
   60|  5.36k|}
str-sanitize.c:str_sanitize_skip_start:
   10|  12.1k|{
   11|  12.1k|	unichar_t chr;
   12|  12.1k|	size_t i;
   13|       |
   14|   297k|	for (i = 0; i < max_bytes && src[i] != '\0'; ) {
  ------------------
  |  Branch (14:14): [True: 295k, False: 1.85k]
  |  Branch (14:31): [True: 285k, False: 10.3k]
  ------------------
   15|   285k|		int len = uni_utf8_get_char_n(src+i, max_bytes-i, &chr);
   16|   285k|		if (len <= 0)
  ------------------
  |  Branch (16:7): [True: 0, False: 285k]
  ------------------
   17|      0|			break;
   18|   285k|		if (i_iscntrl(src[i]))
  ------------------
  |  |  108|   285k|#define i_iscntrl(x) (iscntrl((int) (unsigned char) (x)) != 0)
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 285k]
  |  |  ------------------
  ------------------
   19|      0|			break;
   20|   285k|		i += len;
   21|   285k|	}
   22|  12.1k|	i_assert(i <= max_bytes);
  ------------------
  |  |  219|  12.1k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  12.1k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  12.1k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  12.1k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 12.1k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 12.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  12.1k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  12.1k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  12.1k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   23|  12.1k|	return i;
   24|  12.1k|}

str_new:
   12|   306k|{
   13|       |	/* never allocate a 0 byte size buffer. this is especially important
   14|       |	   when str_c() is called on an empty string from a different stack
   15|       |	   frame (see the comment in buffer.c about this). */
   16|   306k|	return buffer_create_dynamic(pool, I_MAX(initial_size, 1));
  ------------------
  |  |   36|   306k|#define I_MAX(a, b)  (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (36:23): [True: 306k, False: 0]
  |  |  ------------------
  ------------------
   17|   306k|}
t_str_new:
   32|   189k|{
   33|   189k|	return str_new(pool_datastack_create(), initial_size);
   34|   189k|}
str_free:
   42|   165k|{
   43|   165k|	if (str == NULL || *str == NULL)
  ------------------
  |  Branch (43:6): [True: 0, False: 165k]
  |  Branch (43:21): [True: 48.3k, False: 116k]
  ------------------
   44|  48.3k|		return;
   45|       |
   46|   116k|	buffer_free(str);
   47|   116k|}
str_c:
   69|   252k|{
   70|   252k|	str_add_nul(str);
   71|   252k|	return str->data;
   72|   252k|}
str_c_modifiable:
   75|   112k|{
   76|   112k|	str_add_nul(str);
   77|   112k|	return buffer_get_modifiable_data(str, NULL);
   78|   112k|}
str_printfa:
  102|  20.2k|{
  103|  20.2k|	va_list args;
  104|       |
  105|  20.2k|	va_start(args, fmt);
  106|  20.2k|	str_vprintfa(str, fmt, args);
  107|  20.2k|	va_end(args);
  108|  20.2k|}
str_vprintfa:
  111|  27.9k|{
  112|  27.9k|#define SNPRINTF_INITIAL_EXTRA_SIZE 128
  113|  27.9k|	va_list args2;
  114|  27.9k|	char *tmp;
  115|  27.9k|	size_t init_size;
  116|  27.9k|	size_t pos = str->used;
  117|  27.9k|	int ret, ret2;
  118|       |
  119|  27.9k|	VA_COPY(args2, args);
  ------------------
  |  |  864|  27.9k|#define VA_COPY va_copy
  ------------------
  120|       |
  121|       |	/* the format string is modified only if %m exists in it. it happens
  122|       |	   only in error conditions, so don't try to t_push() here since it'll
  123|       |	   just slow down the normal code path. */
  124|  27.9k|	fmt = printf_format_fix_get_len(fmt, &init_size);
  125|  27.9k|	init_size += SNPRINTF_INITIAL_EXTRA_SIZE;
  ------------------
  |  |  112|  27.9k|#define SNPRINTF_INITIAL_EXTRA_SIZE 128
  ------------------
  126|       |
  127|       |	/* @UNSAFE */
  128|  27.9k|	if (pos+init_size > buffer_get_writable_size(str) &&
  ------------------
  |  Branch (128:6): [True: 18.6k, False: 9.32k]
  ------------------
  129|  27.9k|	    pos < buffer_get_writable_size(str)) {
  ------------------
  |  Branch (129:6): [True: 18.6k, False: 0]
  ------------------
  130|       |		/* avoid growing buffer larger if possible. this is also
  131|       |		   required if buffer isn't dynamically growing. */
  132|  18.6k|		init_size = buffer_get_writable_size(str)-pos;
  133|  18.6k|	}
  134|  27.9k|	tmp = buffer_get_space_unsafe(str, pos, init_size);
  135|  27.9k|	ret = vsnprintf(tmp, init_size, fmt, args);
  136|  27.9k|	i_assert(ret >= 0);
  ------------------
  |  |  219|  27.9k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  27.9k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  27.9k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  27.9k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 27.9k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 27.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  27.9k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  27.9k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  27.9k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  137|       |
  138|  27.9k|	if ((unsigned int)ret >= init_size) {
  ------------------
  |  Branch (138:6): [True: 0, False: 27.9k]
  ------------------
  139|       |		/* didn't fit with the first guess. now we know the size,
  140|       |		   so try again. */
  141|      0|		tmp = buffer_get_space_unsafe(str, pos, ret + 1);
  142|      0|		ret2 = vsnprintf(tmp, ret + 1, fmt, args2);
  143|      0|		i_assert(ret2 == ret);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  144|      0|	}
  145|  27.9k|	va_end(args2);
  146|       |
  147|       |	/* drop the unused data, including terminating NUL */
  148|  27.9k|	buffer_set_used_size(str, pos + ret);
  149|  27.9k|}
str.c:str_add_nul:
   50|   365k|{
   51|   365k|	const unsigned char *data = str_data(str);
   52|   365k|	size_t len = str_len(str);
   53|   365k|	size_t alloc = buffer_get_size(str);
   54|       |
   55|   365k|	if (len == alloc || data[len] != '\0') {
  ------------------
  |  Branch (55:6): [True: 0, False: 365k]
  |  Branch (55:22): [True: 6.21k, False: 359k]
  ------------------
   56|  6.21k|		buffer_write(str, len, "", 1);
   57|       |		/* remove the \0 - we don't want to keep it */
   58|  6.21k|		buffer_set_used_size(str, len);
   59|  6.21k|	}
   60|   365k|}

smtp-server-reply.c:str_len:
   25|   624k|{
   26|   624k|	return str->used;
   27|   624k|}
smtp-server-reply.c:str_append:
   34|   447k|{
   35|   447k|	buffer_append(str, cstr, strlen(cstr));
   36|   447k|}
smtp-server-reply.c:str_append_data:
   38|  70.1k|{
   39|  70.1k|	buffer_append(str, data, len);
   40|  70.1k|}
smtp-server-reply.c:str_data:
   21|   112k|{
   22|   112k|	return (const unsigned char*)str->data;
   23|   112k|}
smtp-server-connection.c:str_truncate:
   89|  6.21k|{
   90|  6.21k|	if (str_len(str) > len)
  ------------------
  |  Branch (90:6): [True: 6.21k, False: 0]
  ------------------
   91|  6.21k|		buffer_set_used_size(str, len);
   92|  6.21k|}
smtp-server-connection.c:str_append:
   34|  7.77k|{
   35|  7.77k|	buffer_append(str, cstr, strlen(cstr));
   36|  7.77k|}
smtp-server-connection.c:str_data:
   21|  7.99k|{
   22|  7.99k|	return (const unsigned char*)str->data;
   23|  7.99k|}
smtp-server-connection.c:str_len:
   25|  26.6k|{
   26|  26.6k|	return str->used;
   27|  26.6k|}
smtp-address.c:str_len:
   25|  27.3k|{
   26|  27.3k|	return str->used;
   27|  27.3k|}
smtp-address.c:str_insert:
   71|  13.3k|{
   72|  13.3k|	buffer_insert(str, pos, cstr, strlen(cstr));
   73|  13.3k|}
smtp-address.c:str_append_data:
   38|  82.3k|{
   39|  82.3k|	buffer_append(str, data, len);
   40|  82.3k|}
smtp-address.c:str_append_c:
   43|   110k|{
   44|   110k|	buffer_append_c(str, chr);
   45|   110k|}
smtp-address.c:str_append:
   34|  26.6k|{
   35|  26.6k|	buffer_append(str, cstr, strlen(cstr));
   36|  26.6k|}
smtp-reply.c:str_append:
   34|    908|{
   35|    908|	buffer_append(str, cstr, strlen(cstr));
   36|    908|}
smtp-reply.c:str_append_c:
   43|    454|{
   44|    454|	buffer_append_c(str, chr);
   45|    454|}
smtp-parser.c:str_append_c:
   43|   173k|{
   44|   173k|	buffer_append_c(str, chr);
   45|   173k|}
smtp-parser.c:str_append_data:
   38|  19.8k|{
   39|  19.8k|	buffer_append(str, data, len);
   40|  19.8k|}
connection.c:str_append:
   34|  62.1k|{
   35|  62.1k|	buffer_append(str, cstr, strlen(cstr));
   36|  62.1k|}
connection.c:str_append_c:
   43|  49.7k|{
   44|  49.7k|	buffer_append_c(str, chr);
   45|  49.7k|}
connection.c:str_len:
   25|  37.2k|{
   26|  37.2k|	return str->used;
   27|  37.2k|}
connection.c:str_insert:
   71|  6.21k|{
   72|  6.21k|	buffer_insert(str, pos, cstr, strlen(cstr));
   73|  6.21k|}
str.c:str_len:
   25|   365k|{
   26|   365k|	return str->used;
   27|   365k|}
str.c:str_data:
   21|   365k|{
   22|   365k|	return (const unsigned char*)str->data;
   23|   365k|}
str-sanitize.c:str_len:
   25|  19.6k|{
   26|  19.6k|	return str->used;
   27|  19.6k|}
str-sanitize.c:str_append_data:
   38|   228k|{
   39|   228k|	buffer_append(str, data, len);
   40|   228k|}
str-sanitize.c:str_truncate:
   89|  5.36k|{
   90|  5.36k|	if (str_len(str) > len)
  ------------------
  |  Branch (90:6): [True: 5.36k, False: 0]
  ------------------
   91|  5.36k|		buffer_set_used_size(str, len);
   92|  5.36k|}
str-sanitize.c:str_data:
   21|  5.36k|{
   22|  5.36k|	return (const unsigned char*)str->data;
   23|  5.36k|}
str-sanitize.c:str_append:
   34|  1.78k|{
   35|  1.78k|	buffer_append(str, cstr, strlen(cstr));
   36|  1.78k|}

i_snprintf:
   33|      1|{
   34|      1|	va_list args;
   35|      1|	int ret;
   36|       |
   37|      1|	i_assert(max_chars < INT_MAX);
  ------------------
  |  |  219|      1|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      1|#  define STMT_START do
  |  |  ------------------
  |  |  220|      1|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      1|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      1|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      1|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      1|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   38|       |
   39|      1|	va_start(args, format);
   40|      1|	ret = vsnprintf(dest, max_chars, printf_format_fix_unsafe(format),
   41|      1|			args);
   42|      1|	va_end(args);
   43|       |
   44|      1|	i_assert(ret >= 0);
  ------------------
  |  |  219|      1|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      1|#  define STMT_START do
  |  |  ------------------
  |  |  220|      1|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      1|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      1|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      1|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      1|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   45|      1|	return (unsigned int)ret < max_chars ? 0 : -1;
  ------------------
  |  Branch (45:9): [True: 1, False: 0]
  ------------------
   46|      1|}
p_strdup:
   49|  3.23M|{
   50|  3.23M|	void *mem;
   51|  3.23M|	size_t len;
   52|       |
   53|  3.23M|	if (str == NULL)
  ------------------
  |  Branch (53:6): [True: 58.6k, False: 3.17M]
  ------------------
   54|  58.6k|                return NULL;
   55|       |
   56|  3.17M|	len = strlen(str) + 1;
   57|  3.17M|	mem = p_malloc(pool, len);
   58|  3.17M|	memcpy(mem, str, len);
   59|  3.17M|	return mem;
   60|  3.23M|}
p_strdup_empty:
   72|  6.21k|{
   73|  6.21k|	if (str == NULL || *str == '\0')
  ------------------
  |  Branch (73:6): [True: 6.21k, False: 0]
  |  Branch (73:21): [True: 0, False: 0]
  ------------------
   74|  6.21k|                return NULL;
   75|       |
   76|      0|	return p_strdup(pool, str);
   77|  6.21k|}
p_strdup_until:
   80|   184k|{
   81|   184k|	size_t size;
   82|   184k|	char *mem;
   83|       |
   84|   184k|	i_assert((const char *) start <= (const char *) end);
  ------------------
  |  |  219|   184k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   184k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   184k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   184k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 184k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 184k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   184k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   184k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   184k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   85|       |
   86|   184k|	size = (size_t) ((const char *) end - (const char *) start);
   87|       |
   88|   184k|	mem = p_malloc(pool, size + 1);
   89|   184k|	memcpy(mem, start, size);
   90|   184k|	return mem;
   91|   184k|}
p_strndup:
   94|  27.8k|{
   95|  27.8k|	const char *p;
   96|  27.8k|	char *mem;
   97|  27.8k|	size_t len;
   98|       |
   99|  27.8k|	i_assert(str != NULL);
  ------------------
  |  |  219|  27.8k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  27.8k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  27.8k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  27.8k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 27.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  27.8k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  27.8k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  27.8k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  100|  27.8k|	i_assert(max_chars != SIZE_MAX);
  ------------------
  |  |  219|  27.8k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  27.8k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  27.8k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  27.8k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 27.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  27.8k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  27.8k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  27.8k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  101|       |
  102|  27.8k|	p = memchr(str, '\0', max_chars);
  103|  27.8k|	if (p == NULL)
  ------------------
  |  Branch (103:6): [True: 27.8k, False: 0]
  ------------------
  104|  27.8k|		len = max_chars;
  105|      0|	else
  106|      0|		len = p - (const char *)str;
  107|       |
  108|  27.8k|	mem = p_malloc(pool, len+1);
  109|  27.8k|	memcpy(mem, str, len);
  110|  27.8k|	return mem;
  111|  27.8k|}
p_strdup_printf:
  114|   119k|{
  115|   119k|	va_list args;
  116|   119k|        char *ret;
  117|       |
  118|   119k|	va_start(args, format);
  119|   119k|        ret = p_strdup_vprintf(pool, format, args);
  120|   119k|	va_end(args);
  121|       |
  122|   119k|	return ret;
  123|   119k|}
t_noalloc_strdup_vprintf:
  127|   533k|{
  128|   533k|#define SNPRINTF_INITIAL_EXTRA_SIZE 256
  129|   533k|	va_list args2;
  130|   533k|	char *tmp;
  131|   533k|	size_t init_size;
  132|   533k|	int ret;
  133|       |#ifdef DEBUG
  134|       |	int old_errno = errno;
  135|       |#endif
  136|       |
  137|   533k|	VA_COPY(args2, args);
  ------------------
  |  |  864|   533k|#define VA_COPY va_copy
  ------------------
  138|       |
  139|       |	/* the format string is modified only if %m exists in it. it happens
  140|       |	   only in error conditions, so don't try to t_push() here since it'll
  141|       |	   just slow down the normal code path. */
  142|   533k|	format = printf_format_fix_get_len(format, &init_size);
  143|   533k|	init_size += SNPRINTF_INITIAL_EXTRA_SIZE;
  ------------------
  |  |  128|   533k|#define SNPRINTF_INITIAL_EXTRA_SIZE 256
  ------------------
  144|       |
  145|   533k|	tmp = t_buffer_get(init_size);
  146|   533k|	ret = vsnprintf(tmp, init_size, format, args);
  147|   533k|	i_assert(ret >= 0);
  ------------------
  |  |  219|   533k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   533k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   533k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   533k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 533k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 533k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   533k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   533k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   533k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  148|       |
  149|   533k|	*size_r = ret + 1;
  150|   533k|	if ((unsigned int)ret >= init_size) {
  ------------------
  |  Branch (150:6): [True: 0, False: 533k]
  ------------------
  151|       |		/* didn't fit with the first guess. now we know the size,
  152|       |		   so try again. */
  153|      0|		tmp = t_buffer_get(*size_r);
  154|      0|		ret = vsnprintf(tmp, *size_r, format, args2);
  155|      0|		i_assert((unsigned int)ret == *size_r-1);
  ------------------
  |  |  219|      0|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|      0|#  define STMT_START do
  |  |  ------------------
  |  |  220|      0|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|      0|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|      0|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|      0|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  156|      0|	}
  157|       |#ifdef DEBUG
  158|       |	/* we rely on errno not changing. it shouldn't. */
  159|       |	i_assert(errno == old_errno);
  160|       |#endif
  161|   533k|	va_end(args2);
  162|   533k|	return tmp;
  163|   533k|}
p_strdup_vprintf:
  166|   533k|{
  167|   533k|	char *tmp, *buf;
  168|   533k|	unsigned int size;
  169|       |
  170|   533k|	tmp = t_noalloc_strdup_vprintf(format, args, &size);
  171|   533k|	if (pool->datastack_pool) {
  ------------------
  |  Branch (171:6): [True: 393k, False: 140k]
  ------------------
  172|   393k|		t_buffer_alloc(size);
  173|   393k|		return tmp;
  174|   393k|	} else {
  175|   140k|		buf = p_malloc(pool, size);
  176|   140k|		memcpy(buf, tmp, size - 1);
  177|   140k|		return buf;
  178|   140k|	}
  179|   533k|}
vstrconcat:
  182|    227|{
  183|    227|	const char *str;
  184|    227|        char *temp;
  185|    227|	size_t bufsize, i, len;
  186|       |
  187|    227|	i_assert(str1 != NULL);
  ------------------
  |  |  219|    227|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    227|#  define STMT_START do
  |  |  ------------------
  |  |  220|    227|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    227|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 227]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 227]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    227|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    227|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    227|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  188|       |
  189|    227|	str = str1;
  190|    227|	bufsize = STRCONCAT_BUFSIZE;
  ------------------
  |  |   19|    227|#define STRCONCAT_BUFSIZE 512
  ------------------
  191|    227|	temp = t_buffer_get(bufsize);
  192|       |
  193|    227|	i = 0;
  194|    681|	do {
  195|    681|		len = strlen(str);
  196|       |
  197|    681|		if (i + len >= bufsize) {
  ------------------
  |  Branch (197:7): [True: 0, False: 681]
  ------------------
  198|       |			/* need more memory */
  199|      0|			bufsize = nearest_power(i + len + 1);
  200|      0|			temp = t_buffer_reget(temp, bufsize);
  201|      0|		}
  202|       |
  203|    681|		memcpy(temp + i, str, len); i += len;
  204|       |
  205|       |		/* next string */
  206|    681|		str = va_arg(args, const char *);
  207|    681|	} while (str != NULL);
  ------------------
  |  Branch (207:11): [True: 454, False: 227]
  ------------------
  208|       |
  209|    227|	i_assert(i < bufsize);
  ------------------
  |  |  219|    227|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    227|#  define STMT_START do
  |  |  ------------------
  |  |  220|    227|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    227|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 227]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 227]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    227|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    227|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    227|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|       |
  211|    227|	temp[i++] = '\0';
  212|    227|        *ret_len = i;
  213|    227|        return temp;
  214|    227|}
t_strdup_noconst:
  252|   111k|{
  253|   111k|	if (str == NULL)
  ------------------
  |  Branch (253:6): [True: 0, False: 111k]
  ------------------
  254|      0|		return NULL;
  255|   111k|	return t_memdup(str, strlen(str) + 1);
  256|   111k|}
t_strdup_until:
  267|  4.14k|{
  268|  4.14k|	char *mem;
  269|  4.14k|	size_t size;
  270|       |
  271|  4.14k|	i_assert((const char *) start <= (const char *) end);
  ------------------
  |  |  219|  4.14k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  4.14k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  4.14k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  4.14k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 4.14k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 4.14k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  4.14k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  4.14k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  4.14k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  272|       |
  273|  4.14k|	size = (size_t)((const char *)end - (const char *)start);
  274|       |
  275|  4.14k|	mem = t_malloc_no0(size + 1);
  276|  4.14k|	memcpy(mem, start, size);
  277|  4.14k|	mem[size] = '\0';
  278|  4.14k|	return mem;
  279|  4.14k|}
t_strndup:
  282|  27.8k|{
  283|  27.8k|	i_assert(str != NULL);
  ------------------
  |  |  219|  27.8k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  27.8k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  27.8k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  27.8k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 27.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  27.8k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  27.8k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  27.8k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  284|  27.8k|	return p_strndup(unsafe_data_stack_pool, str, max_chars);
  285|  27.8k|}
t_strdup_printf:
  288|   283k|{
  289|   283k|	va_list args;
  290|   283k|	const char *ret;
  291|       |
  292|   283k|	va_start(args, format);
  293|   283k|	ret = p_strdup_vprintf(unsafe_data_stack_pool, format, args);
  294|   283k|	va_end(args);
  295|       |
  296|   283k|	return ret;
  297|   283k|}
t_strdup_vprintf:
  300|   109k|{
  301|   109k|	return p_strdup_vprintf(unsafe_data_stack_pool, format, args);
  302|   109k|}
t_strconcat:
  305|    227|{
  306|    227|	va_list args;
  307|    227|	const char *ret;
  308|    227|        size_t len;
  309|       |
  310|    227|	i_assert(str1 != NULL);
  ------------------
  |  |  219|    227|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    227|#  define STMT_START do
  |  |  ------------------
  |  |  220|    227|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    227|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 227]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 227]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    227|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    227|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    227|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  311|       |
  312|    227|	va_start(args, str1);
  313|       |
  314|    227|	ret = vstrconcat(str1, args, &len);
  315|    227|	t_buffer_alloc(len);
  316|       |
  317|    227|	va_end(args);
  318|    227|        return ret;
  319|    227|}
t_str_oneline:
  354|  2.45k|{
  355|  2.45k|	string_t *out;
  356|  2.45k|	size_t len;
  357|  2.45k|	const char *p, *pend, *poff;
  358|  2.45k|	bool new_line;
  359|       |
  360|  2.45k|	if (strpbrk(str, "\r\n") == NULL)
  ------------------
  |  Branch (360:6): [True: 2.45k, False: 0]
  ------------------
  361|  2.45k|		return str;
  362|       |
  363|      0|	len = strlen(str);
  364|      0|	out = t_str_new(len + 1);
  365|      0|	new_line = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  366|      0|	p = poff = str;
  367|      0|	pend = str + len;
  368|      0|	while (p < pend) {
  ------------------
  |  Branch (368:9): [True: 0, False: 0]
  ------------------
  369|      0|		switch (*p) {
  370|      0|		case '\r':
  ------------------
  |  Branch (370:3): [True: 0, False: 0]
  ------------------
  371|      0|			if (p > poff)
  ------------------
  |  Branch (371:8): [True: 0, False: 0]
  ------------------
  372|      0|				str_append_data(out,  poff, p - poff);
  373|       |			/* just drop \r */
  374|      0|			poff = p + 1;
  375|      0|			break;
  376|      0|		case '\n':
  ------------------
  |  Branch (376:3): [True: 0, False: 0]
  ------------------
  377|      0|			if (p > poff)
  ------------------
  |  Branch (377:8): [True: 0, False: 0]
  ------------------
  378|      0|				str_append_data(out,  poff, p - poff);
  379|      0|			if (new_line) {
  ------------------
  |  Branch (379:8): [True: 0, False: 0]
  ------------------
  380|       |				/* coalesce multiple \n into a single space */
  381|      0|			} else {
  382|       |				/* first \n after text */
  383|      0|				str_append_c(out, ' ');
  ------------------
  |  |   54|      0|	str_append_c((str), __builtin_choose_expr( \
  |  |   55|      0|		__builtin_types_compatible_p(typeof((chr)), char), \
  |  |   56|      0|			(unsigned char)(chr), (chr)))
  ------------------
  384|      0|				new_line = TRUE;
  ------------------
  |  |   15|      0|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  385|      0|			}
  386|      0|			poff = p + 1;
  387|      0|			break;
  388|      0|		default:
  ------------------
  |  Branch (388:3): [True: 0, False: 0]
  ------------------
  389|      0|			new_line = FALSE;
  ------------------
  |  |   11|      0|#  define FALSE (!1)
  ------------------
  390|      0|			break;
  391|      0|		}
  392|      0|		p++;
  393|      0|	}
  394|       |
  395|      0|	if (new_line && str_len(out) > 0)
  ------------------
  |  Branch (395:6): [True: 0, False: 0]
  |  Branch (395:18): [True: 0, False: 0]
  ------------------
  396|      0|		str_truncate(out, str_len(out) - 1);
  397|      0|	else if (p > poff)
  ------------------
  |  Branch (397:11): [True: 0, False: 0]
  ------------------
  398|      0|		str_append_data(out,  poff, p - poff);
  399|      0|	return str_c(out);
  400|      0|}
str_ucase:
  417|   111k|{
  418|   111k|	char *p;
  419|       |
  420|   481k|	for (p = str; *p != '\0'; p++)
  ------------------
  |  Branch (420:16): [True: 369k, False: 111k]
  ------------------
  421|   369k|		*p = i_toupper(*p);
  ------------------
  |  |  102|   369k|#define i_toupper(x) ((char) toupper((int) (unsigned char) (x)))
  ------------------
  422|   111k|        return str;
  423|   111k|}
t_str_ucase:
  442|   111k|{
  443|   111k|	i_assert(str != NULL);
  ------------------
  |  |  219|   111k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|   111k|#  define STMT_START do
  |  |  ------------------
  |  |  220|   111k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|   111k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 111k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 111k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|   111k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|   111k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|   111k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  444|       |
  445|   111k|	return str_ucase(t_strdup_noconst(str));
  446|   111k|}
null_strcmp:
  554|  71.1k|{
  555|  71.1k|	if (s1 == NULL)
  ------------------
  |  Branch (555:6): [True: 44.9k, False: 26.1k]
  ------------------
  556|  44.9k|		return s2 == NULL ? 0 : -1;
  ------------------
  |  Branch (556:10): [True: 41.1k, False: 3.81k]
  ------------------
  557|  26.1k|	if (s2 == NULL)
  ------------------
  |  Branch (557:6): [True: 5.36k, False: 20.7k]
  ------------------
  558|  5.36k|		return 1;
  559|       |
  560|  20.7k|	return strcmp(s1, s2);
  561|  26.1k|}
t_strsplit:
  827|  43.1k|{
  828|  43.1k|	return (const char **)split_str(unsafe_data_stack_pool, data,
  829|  43.1k|					separators, FALSE);
  ------------------
  |  |   11|  43.1k|#  define FALSE (!1)
  ------------------
  830|  43.1k|}
t_strsplit_spaces:
  833|    227|{
  834|    227|	return (const char **)split_str(unsafe_data_stack_pool, data,
  835|    227|					separators, TRUE);
  ------------------
  |  |   15|    227|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|    227|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  836|    227|}
strfuncs.c:t_memdup:
  240|   111k|{
  241|   111k|	void *mem = t_malloc_no0(size);
  242|   111k|	memcpy(mem, data, size);
  243|   111k|	return mem;
  244|   111k|}
strfuncs.c:split_str:
  817|  43.3k|{
  818|  43.3k|	i_assert(*separators != '\0');
  ------------------
  |  |  219|  43.3k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  43.3k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  43.3k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  43.3k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 43.3k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 43.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  43.3k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  43.3k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  43.3k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  819|       |
  820|  43.3k|	if (separators[1] == '\0' && !spaces)
  ------------------
  |  Branch (820:6): [True: 43.1k, False: 227]
  |  Branch (820:31): [True: 43.1k, False: 0]
  ------------------
  821|  43.1k|		return split_str_fast(pool, data, separators[0]);
  822|    227|	else
  823|    227|		return split_str_slow(pool, data, separators, spaces);
  824|  43.3k|}
strfuncs.c:split_str_fast:
  783|  43.1k|{
  784|  43.1k|	char **array, *str;
  785|  43.1k|	unsigned int count, alloc_count, new_alloc_count;
  786|       |
  787|  43.1k|	if (*data == '\0')
  ------------------
  |  Branch (787:6): [True: 18.8k, False: 24.2k]
  ------------------
  788|  18.8k|		return p_new(pool, char *, 1);
  ------------------
  |  |   97|  18.8k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|  18.8k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|  18.8k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|  18.8k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  18.8k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  789|       |
  790|  24.2k|	str = p_strdup(pool, data);
  791|       |
  792|  24.2k|	alloc_count = 32;
  793|  24.2k|	array = p_new(pool, char *, alloc_count);
  ------------------
  |  |   97|  24.2k|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|  24.2k|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|  24.2k|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|  24.2k|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|  24.2k|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  794|       |
  795|  24.2k|	array[0] = str; count = 1;
  796|   831k|	while ((str = strchr(str, sep)) != NULL) {
  ------------------
  |  Branch (796:9): [True: 806k, False: 24.2k]
  ------------------
  797|       |		/* separator found */
  798|   806k|		if (count+1 >= alloc_count) {
  ------------------
  |  Branch (798:7): [True: 5.22k, False: 801k]
  ------------------
  799|  5.22k|			new_alloc_count = nearest_power(alloc_count+1);
  800|  5.22k|			array = p_realloc(pool, array,
  801|  5.22k|					  sizeof(char *) * alloc_count,
  802|  5.22k|					  sizeof(char *) *
  803|  5.22k|					  new_alloc_count);
  804|  5.22k|			alloc_count = new_alloc_count;
  805|  5.22k|		}
  806|   806k|		*str++ = '\0';
  807|   806k|		array[count++] = str;
  808|   806k|	}
  809|  24.2k|	i_assert(count < alloc_count);
  ------------------
  |  |  219|  24.2k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  24.2k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  24.2k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  24.2k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 24.2k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 24.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  24.2k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  24.2k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  24.2k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  810|  24.2k|	i_assert(array[count] == NULL);
  ------------------
  |  |  219|  24.2k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  24.2k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  24.2k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  24.2k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 24.2k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 24.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  24.2k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  24.2k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  24.2k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  811|       |
  812|  24.2k|	return array;
  813|  24.2k|}
strfuncs.c:split_str_slow:
  727|    227|{
  728|    227|        char **array;
  729|    227|	char *str;
  730|    227|        unsigned int count, alloc_count, new_alloc_count;
  731|       |
  732|    227|	if (spaces) {
  ------------------
  |  Branch (732:6): [True: 227, False: 0]
  ------------------
  733|       |		/* skip leading separators */
  734|    227|		while (*data != '\0' && strchr(separators, *data) != NULL)
  ------------------
  |  Branch (734:10): [True: 227, False: 0]
  |  Branch (734:27): [True: 0, False: 227]
  ------------------
  735|      0|			data++;
  736|    227|	}
  737|    227|	if (*data == '\0')
  ------------------
  |  Branch (737:6): [True: 0, False: 227]
  ------------------
  738|      0|		return p_new(pool, char *, 1);
  ------------------
  |  |   97|      0|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|      0|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|      0|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|      0|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  739|       |
  740|    227|	str = p_strdup(pool, data);
  741|       |
  742|    227|	alloc_count = 32;
  743|    227|	array = p_new(pool, char *, alloc_count);
  ------------------
  |  |   97|    227|	((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
  |  |  ------------------
  |  |  |  |   25|    227|	malloc_multiply_check(a, b, sizeof(a), sizeof(b), __FILE__, __LINE__)
  |  |  ------------------
  |  |   98|    227|	 COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
  |  |  ------------------
  |  |  |  |  180|    227|	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|    227|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |               	(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   11|      0|#  define FALSE (!1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:3): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  744|       |
  745|    227|	array[0] = str; count = 1;
  746|  6.12k|	while (*str != '\0') {
  ------------------
  |  Branch (746:9): [True: 5.90k, False: 227]
  ------------------
  747|  5.90k|		if (strchr(separators, *str) != NULL) {
  ------------------
  |  Branch (747:7): [True: 0, False: 5.90k]
  ------------------
  748|       |			/* separator found */
  749|      0|			if (count+1 >= alloc_count) {
  ------------------
  |  Branch (749:8): [True: 0, False: 0]
  ------------------
  750|      0|                                new_alloc_count = nearest_power(alloc_count+1);
  751|      0|				array = p_realloc(pool, array,
  752|      0|						  sizeof(char *) * alloc_count,
  753|      0|						  sizeof(char *) *
  754|      0|						  new_alloc_count);
  755|      0|				alloc_count = new_alloc_count;
  756|      0|			}
  757|       |
  758|      0|			*str = '\0';
  759|      0|			if (spaces) {
  ------------------
  |  Branch (759:8): [True: 0, False: 0]
  ------------------
  760|      0|				while (str[1] != '\0' &&
  ------------------
  |  Branch (760:12): [True: 0, False: 0]
  ------------------
  761|      0|				       strchr(separators, str[1]) != NULL)
  ------------------
  |  Branch (761:12): [True: 0, False: 0]
  ------------------
  762|      0|					str++;
  763|       |
  764|       |				/* ignore trailing separators */
  765|      0|				if (str[1] == '\0')
  ------------------
  |  Branch (765:9): [True: 0, False: 0]
  ------------------
  766|      0|					break;
  767|      0|			}
  768|       |
  769|      0|			array[count++] = str+1;
  770|      0|		}
  771|       |
  772|  5.90k|                str++;
  773|  5.90k|	}
  774|       |
  775|    227|	i_assert(count < alloc_count);
  ------------------
  |  |  219|    227|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|    227|#  define STMT_START do
  |  |  ------------------
  |  |  220|    227|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|    227|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 227]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 227]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|    227|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|    227|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|    227|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  776|    227|        array[count] = NULL;
  777|       |
  778|    227|        return array;
  779|    227|}

smtp-server-cmd-mail.c:str_begins_builtin_success:
  112|  17.3k|{
  113|  17.3k|	*suffix_r = haystack + needle_len;
  114|  17.3k|	return TRUE;
  ------------------
  |  |   15|  17.3k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  17.3k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  115|  17.3k|}
smtp-server-cmd-rcpt.c:str_begins_builtin_success:
  112|  19.5k|{
  113|  19.5k|	*suffix_r = haystack + needle_len;
  114|  19.5k|	return TRUE;
  ------------------
  |  |   15|  19.5k|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  19.5k|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  115|  19.5k|}

str_parse_uint:
   51|  3.25k|int name(const char *str, type *num_r, const char **endp_r)   \
   52|  3.25k|{                                                             \
   53|  3.25k|	uintmax_t l;                                                \
   54|  3.25k|	if (str_parse_uintmax(str, &l, endp_r) < 0 || l > (type)-1) \
  ------------------
  |  Branch (54:6): [True: 907, False: 2.35k]
  |  Branch (54:48): [True: 279, False: 2.07k]
  ------------------
   55|  3.25k|		return -1;                                                \
   56|  3.25k|	*num_r = (type)l;                                           \
   57|  2.07k|	return 0;                                                   \
   58|  3.25k|}
str_parse_uintmax:
   84|  21.1k|{
   85|  21.1k|	uintmax_t n = 0;
   86|       |
   87|  21.1k|	if (*str < '0' || *str > '9')
  ------------------
  |  Branch (87:6): [True: 1.10k, False: 20.0k]
  |  Branch (87:20): [True: 397, False: 19.6k]
  ------------------
   88|  1.49k|		return -1;
   89|       |
   90|   100k|	do {
   91|   100k|		if (n >= ((uintmax_t)-1 / 10)) {
  ------------------
  |  Branch (91:7): [True: 1.45k, False: 99.3k]
  ------------------
   92|  1.45k|			if (n > (uintmax_t)-1 / 10)
  ------------------
  |  Branch (92:8): [True: 596, False: 854]
  ------------------
   93|    596|				return -1;
   94|    854|			if ((uintmax_t)(*str - '0') > ((uintmax_t)-1 % 10))
  ------------------
  |  Branch (94:8): [True: 480, False: 374]
  ------------------
   95|    480|				return -1;
   96|    854|		}
   97|  99.7k|		n = n * 10 + (*str - '0');
   98|  99.7k|		str++;
   99|  99.7k|	} while (*str >= '0' && *str <= '9');
  ------------------
  |  Branch (99:11): [True: 81.5k, False: 18.1k]
  |  Branch (99:26): [True: 81.1k, False: 406]
  ------------------
  100|       |
  101|  18.5k|	if (endp_r != NULL)
  ------------------
  |  Branch (101:6): [True: 18.5k, False: 0]
  ------------------
  102|  18.5k|		*endp_r = str;
  103|  18.5k|	*num_r = n;
  104|  18.5k|	return 0;
  105|  19.6k|}
str_to_uintmax:
  107|  17.8k|{
  108|  17.8k|	const char *endp;
  109|  17.8k|	uintmax_t n;
  110|  17.8k|	int ret = str_parse_uintmax(str, &n, &endp);
  111|  17.8k|	if ((ret != 0) || (*endp != '\0'))
  ------------------
  |  Branch (111:6): [True: 1.66k, False: 16.1k]
  |  Branch (111:20): [True: 259, False: 15.9k]
  ------------------
  112|  1.92k|		return -1;
  113|  15.9k|	*num_r = n;
  114|  15.9k|	return 0;
  115|  17.8k|}
str_to_uoff:
  424|  17.8k|{
  425|  17.8k|	uintmax_t l;
  426|       |
  427|  17.8k|	if (str_to_uintmax(str, &l) < 0)
  ------------------
  |  Branch (427:6): [True: 1.92k, False: 15.9k]
  ------------------
  428|  1.92k|		return -1;
  429|       |
  430|  15.9k|	if (l > UOFF_T_MAX)
  ------------------
  |  |  846|  15.9k|#define UOFF_T_MAX ULONG_MAX
  ------------------
  |  Branch (430:6): [True: 0, False: 15.9k]
  ------------------
  431|      0|		return -1;
  432|  15.9k|	*num_r = (uoff_t)l;
  433|  15.9k|	return 0;
  434|  15.9k|}

i_gettimeofday:
   11|   630k|{
   12|   630k|	if (gettimeofday(tv_r, NULL) < 0)
  ------------------
  |  Branch (12:6): [True: 0, False: 630k]
  ------------------
   13|      0|		i_fatal("gettimeofday() failed: %m");
   14|   630k|}
timeval_cmp:
   26|  33.4k|{
   27|  33.4k|	if (tv1->tv_sec < tv2->tv_sec)
  ------------------
  |  Branch (27:6): [True: 1.64k, False: 31.8k]
  ------------------
   28|  1.64k|		return -1;
   29|  31.8k|	if (tv1->tv_sec > tv2->tv_sec)
  ------------------
  |  Branch (29:6): [True: 12.7k, False: 19.1k]
  ------------------
   30|  12.7k|		return 1;
   31|  19.1k|	if (tv1->tv_usec < tv2->tv_usec)
  ------------------
  |  Branch (31:6): [True: 1.82k, False: 17.2k]
  ------------------
   32|  1.82k|		return -1;
   33|  17.2k|	if (tv1->tv_usec > tv2->tv_usec)
  ------------------
  |  Branch (33:6): [True: 17.2k, False: 0]
  ------------------
   34|  17.2k|		return 1;
   35|      0|	return 0;
   36|  17.2k|}
timeval_diff_usecs:
   73|   113k|{
   74|   113k|	time_t secs;
   75|   113k|	int usecs;
   76|       |
   77|   113k|	secs = tv1->tv_sec - tv2->tv_sec;
   78|   113k|	usecs = tv1->tv_usec - tv2->tv_usec;
   79|   113k|	if (usecs < 0) {
  ------------------
  |  Branch (79:6): [True: 10.2k, False: 103k]
  ------------------
   80|  10.2k|		secs--;
   81|  10.2k|		usecs += 1000000;
   82|  10.2k|	}
   83|   113k|	return ((long long)secs * 1000000LL) + usecs;
   84|   113k|}

ioloop.c:timeval_add_msecs:
   63|  37.8k|{
   64|  37.8k|	tv->tv_sec += msecs / 1000;
   65|  37.8k|	tv->tv_usec += (msecs % 1000) * 1000;
   66|  37.8k|	if (tv->tv_usec >= 1000000) {
  ------------------
  |  Branch (66:6): [True: 246, False: 37.5k]
  ------------------
   67|    246|		tv->tv_sec++;
   68|    246|		tv->tv_usec -= 1000000;
   69|    246|	}
   70|  37.8k|}

uni_utf8_get_char_n:
  115|  8.03M|{
  116|  8.03M|	return uni_utf8_parse_char(input, max_len, TRUE, chr_r);
  ------------------
  |  |   15|  8.03M|#  define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  |   11|  8.03M|#  define FALSE (!1)
  |  |  ------------------
  ------------------
  117|  8.03M|}
uni_utf8_data_truncate:
  446|  5.36k|{
  447|  5.36k|	if (max_new_size >= old_size)
  ------------------
  |  Branch (447:6): [True: 0, False: 5.36k]
  ------------------
  448|      0|		return old_size;
  449|  5.36k|	if (max_new_size == 0)
  ------------------
  |  Branch (449:6): [True: 0, False: 5.36k]
  ------------------
  450|      0|		return 0;
  451|       |
  452|  5.36k|	if ((data[max_new_size] & 0x80) == 0)
  ------------------
  |  Branch (452:6): [True: 5.36k, False: 0]
  ------------------
  453|  5.36k|		return max_new_size;
  454|      0|	while (max_new_size > 0 && (data[max_new_size-1] & 0xc0) == 0x80)
  ------------------
  |  Branch (454:9): [True: 0, False: 0]
  |  Branch (454:29): [True: 0, False: 0]
  ------------------
  455|      0|		max_new_size--;
  456|      0|	if (max_new_size > 0 && (data[max_new_size-1] & 0xc0) == 0xc0)
  ------------------
  |  Branch (456:6): [True: 0, False: 0]
  |  Branch (456:26): [True: 0, False: 0]
  ------------------
  457|      0|		max_new_size--;
  458|      0|	return max_new_size;
  459|  5.36k|}
unichar.c:uni_utf8_parse_char:
   35|  8.03M|{
   36|  8.03M|	static unichar_t lowest_valid_chr_table[] =
   37|  8.03M|		{ 0, 0, 0x80, 0x800, 0x10000, 0x200000, 0x4000000 };
   38|  8.03M|	const unsigned char *input = _buffer;
   39|  8.03M|	unichar_t chr, lowest_valid_chr;
   40|  8.03M|	unsigned int i, len;
   41|  8.03M|	int ret;
   42|       |
   43|  8.03M|	i_assert(size > 0);
  ------------------
  |  |  219|  8.03M|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  8.03M|#  define STMT_START do
  |  |  ------------------
  |  |  220|  8.03M|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  8.03M|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 8.03M]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 8.03M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  8.03M|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  8.03M|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  8.03M|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   44|       |
   45|  8.03M|	if (*input < 0x80) {
  ------------------
  |  Branch (45:6): [True: 8.02M, False: 6.61k]
  ------------------
   46|  8.02M|		*chr_r = *input;
   47|  8.02M|		return 1;
   48|  8.02M|	}
   49|       |
   50|       |	/* first byte has len highest bits set, followed by zero bit.
   51|       |	   the rest of the bits are used as the highest bits of the value. */
   52|  6.61k|	chr = *input;
   53|  6.61k|	len = uni_utf8_char_bytes(*input);
   54|  6.61k|	switch (len) {
   55|  1.71k|	case 2:
  ------------------
  |  Branch (55:2): [True: 1.71k, False: 4.89k]
  ------------------
   56|  1.71k|		chr &= 0x1f;
   57|  1.71k|		break;
   58|  2.21k|	case 3:
  ------------------
  |  Branch (58:2): [True: 2.21k, False: 4.40k]
  ------------------
   59|  2.21k|		chr &= 0x0f;
   60|  2.21k|		break;
   61|  1.60k|	case 4:
  ------------------
  |  Branch (61:2): [True: 1.60k, False: 5.01k]
  ------------------
   62|  1.60k|		chr &= 0x07;
   63|  1.60k|		break;
   64|     28|	case 5:
  ------------------
  |  Branch (64:2): [True: 28, False: 6.58k]
  ------------------
   65|     28|		chr &= 0x03;
   66|     28|		break;
   67|     50|	case 6:
  ------------------
  |  Branch (67:2): [True: 50, False: 6.56k]
  ------------------
   68|     50|		chr &= 0x01;
   69|     50|		break;
   70|  1.00k|	default:
  ------------------
  |  Branch (70:2): [True: 1.00k, False: 5.60k]
  ------------------
   71|       |		/* only 7bit chars should have len==1 */
   72|  1.00k|		i_assert(len == 1);
  ------------------
  |  |  219|  1.00k|#  define i_assert(expr)			STMT_START{			\
  |  |  ------------------
  |  |  |  |   63|  1.00k|#  define STMT_START do
  |  |  ------------------
  |  |  220|  1.00k|     if (unlikely(!(expr)))						\
  |  |  ------------------
  |  |  |  |  202|  1.00k|#  define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (202:26): [True: 0, False: 1.00k]
  |  |  |  |  |  Branch (202:44): [True: 0, False: 1.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  1.00k|       i_panic("file %s: line %d (%s): assertion failed: (%s)",		\
  |  |  222|      0|		__FILE__,						\
  |  |  223|      0|		__LINE__,						\
  |  |  224|      0|		__func__,					\
  |  |  225|  1.00k|		#expr);			}STMT_END
  |  |  ------------------
  |  |  |  |   64|  1.00k|#  define STMT_END while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (64:27): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   73|  1.00k|		return -1;
   74|  6.61k|	}
   75|       |
   76|  5.60k|	if (len <= size) {
  ------------------
  |  Branch (76:6): [True: 5.45k, False: 153]
  ------------------
   77|  5.45k|		lowest_valid_chr = lowest_valid_chr_table[len];
   78|  5.45k|		ret = len;
   79|  5.45k|	} else {
   80|       |		/* check first if the input is invalid before returning 0 */
   81|    153|		lowest_valid_chr = 0;
   82|    153|		ret = 0;
   83|    153|		len = size;
   84|    153|	}
   85|       |
   86|       |	/* the following bytes must all be 10xxxxxx */
   87|  15.6k|	for (i = 1; i < len; i++) {
  ------------------
  |  Branch (87:14): [True: 10.7k, False: 4.90k]
  ------------------
   88|  10.7k|		if ((input[i] & 0xc0) != 0x80) {
  ------------------
  |  Branch (88:7): [True: 701, False: 10.0k]
  ------------------
   89|    701|			return (cstr && size == SIZE_MAX && input[i] == '\0' ?
  ------------------
  |  Branch (89:12): [True: 701, False: 0]
  |  Branch (89:20): [True: 0, False: 701]
  |  Branch (89:40): [True: 0, False: 0]
  ------------------
   90|    701|				0 : -1);
   91|    701|		}
   92|       |
   93|  10.0k|		chr <<= 6;
   94|  10.0k|		chr |= input[i] & 0x3f;
   95|  10.0k|	}
   96|       |	/* these are specified as invalid encodings by standards
   97|       |	   see RFC3629 */
   98|  4.90k|	if (!uni_is_valid_ucs4(chr))
  ------------------
  |  Branch (98:6): [True: 410, False: 4.49k]
  ------------------
   99|    410|		return -1;
  100|  4.49k|	if (chr < lowest_valid_chr) {
  ------------------
  |  Branch (100:6): [True: 227, False: 4.26k]
  ------------------
  101|       |		/* overlong encoding */
  102|    227|		return -1;
  103|    227|	}
  104|       |
  105|  4.26k|	*chr_r = chr;
  106|  4.26k|	return ret;
  107|  4.49k|}

smtp-command-parser.c:uni_utf8_char_bytes:
  109|    145|{
  110|       |	/* 0x00 .. 0x7f are ASCII. 0x80 .. 0xC1 are invalid. */
  111|    145|	if (chr < (192 + 2))
  ------------------
  |  Branch (111:6): [True: 0, False: 145]
  ------------------
  112|      0|		return 1;
  113|    145|	return uni_utf8_non1_bytes[chr - (192 + 2)];
  114|    145|}
unichar.c:uni_is_valid_ucs4:
   58|  4.90k|{
   59|  4.90k|	return (!UTF16_VALID_HIGH_SURROGATE(chr) &&
  ------------------
  |  |   42|  9.80k|#define UTF16_VALID_HIGH_SURROGATE(chr) (((chr) & 0xfffc00) == UTF16_SURROGATE_HIGH_FIRST)
  |  |  ------------------
  |  |  |  |   20|  4.90k|#define UTF16_SURROGATE_HIGH_FIRST 0xd800
  |  |  ------------------
  ------------------
  |  Branch (59:10): [True: 4.70k, False: 194]
  ------------------
   60|  4.90k|		!UTF16_VALID_LOW_SURROGATE(chr) &&
  ------------------
  |  |   43|  9.61k|#define UTF16_VALID_LOW_SURROGATE(chr) (((chr) & 0xfffc00) == UTF16_SURROGATE_LOW_FIRST)
  |  |  ------------------
  |  |  |  |   23|  4.70k|#define UTF16_SURROGATE_LOW_FIRST 0xdc00
  |  |  ------------------
  ------------------
  |  Branch (60:3): [True: 4.51k, False: 197]
  ------------------
   61|  4.90k|		chr <= UNICHAR_T_MAX);
  ------------------
  |  |   40|  4.51k|#define UNICHAR_T_MAX 0x10ffff
  ------------------
  |  Branch (61:3): [True: 4.49k, False: 19]
  ------------------
   62|  4.90k|};
unichar.c:uni_utf8_char_bytes:
  109|  6.61k|{
  110|       |	/* 0x00 .. 0x7f are ASCII. 0x80 .. 0xC1 are invalid. */
  111|  6.61k|	if (chr < (192 + 2))
  ------------------
  |  Branch (111:6): [True: 775, False: 5.83k]
  ------------------
  112|    775|		return 1;
  113|  5.83k|	return uni_utf8_non1_bytes[chr - (192 + 2)];
  114|  6.61k|}

var_expand_extensions_init:
  815|      1|{
  816|      1|	i_array_init(&var_expand_extensions, 32);
  ------------------
  |  |   46|      1|	p_array_init(array, default_pool, init_count)
  |  |  ------------------
  |  |  |  |   44|      1|	array_create(array, pool, sizeof(**(array)->v), init_count)
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      1|	array_create_i(&(array)->arr, pool, element_size, init_count)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  817|       |
  818|       |	/* put all hash methods there */
  819|      1|	for(const struct hash_method **meth = hash_methods;
  820|     10|	    *meth != NULL;
  ------------------
  |  Branch (820:6): [True: 9, False: 1]
  ------------------
  821|      9|	    meth++) {
  822|      9|		struct var_expand_extension_func_table *func =
  823|      9|			array_append_space(&var_expand_extensions);
  ------------------
  |  |  339|      9|	ARRAY_TYPE_CAST_MODIFIABLE(array)array_append_space_i(&(array)->arr)
  |  |  ------------------
  |  |  |  |   54|      9|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  ------------------
  824|      9|		func->key = (*meth)->name;
  825|      9|		func->func = var_expand_hash;
  826|      9|	}
  827|       |
  828|       |	/* pkcs5 */
  829|      1|	struct var_expand_extension_func_table *func =
  830|      1|		array_append_space(&var_expand_extensions);
  ------------------
  |  |  339|      1|	ARRAY_TYPE_CAST_MODIFIABLE(array)array_append_space_i(&(array)->arr)
  |  |  ------------------
  |  |  |  |   54|      1|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  ------------------
  831|      1|	func->key = "pkcs5";
  832|      1|	func->func = var_expand_hash;
  833|       |
  834|       |	/* if */
  835|      1|	func = array_append_space(&var_expand_extensions);
  ------------------
  |  |  339|      1|	ARRAY_TYPE_CAST_MODIFIABLE(array)array_append_space_i(&(array)->arr)
  |  |  ------------------
  |  |  |  |   54|      1|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  ------------------
  836|      1|	func->key = "if";
  837|      1|	func->func = var_expand_if;
  838|       |
  839|       |	/* system */
  840|      1|	func = array_append_space(&var_expand_extensions);
  ------------------
  |  |  339|      1|	ARRAY_TYPE_CAST_MODIFIABLE(array)array_append_space_i(&(array)->arr)
  |  |  ------------------
  |  |  |  |   54|      1|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  ------------------
  841|      1|	func->key = "system";
  842|      1|	func->func = var_expand_system;
  843|       |
  844|       |	/* process */
  845|      1|	func = array_append_space(&var_expand_extensions);
  ------------------
  |  |  339|      1|	ARRAY_TYPE_CAST_MODIFIABLE(array)array_append_space_i(&(array)->arr)
  |  |  ------------------
  |  |  |  |   54|      1|	(typeof(*(array)->v_modifiable))
  |  |  ------------------
  ------------------
  846|      1|	func->key = "process";
  847|      1|	func->func = var_expand_process;
  848|      1|}

