#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ expected_buf;

/* Variables and functions */
int EXIT_SUCCESS;
scalar_t__ expect(char *, char *, int /*<<< orphan*/, char *,
                  int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int /*<<< orphan*/ validate_json_string(int /*<<< orphan*/ *, char *);
int test_validate_json_string(void) {
  do {
    char expected_buf[16] = {0};
    snprintf(expected_buf, sizeof(expected_buf), "%d", 1);
    do {
      if (expect(expected_buf,
                 "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/apache/incubator-htrace/"
                 "refs/heads/master/htrace-c/src/test/string-unit.c"
                 " at line "
                 "60",
                 0, "%d", validate_json_string(NULL, "")))
        return 1;
    } while (0);
    ;
  } while (0);
  ;
  do {
    char expected_buf[16] = {0};
    snprintf(expected_buf, sizeof(expected_buf), "%d", 1);
    do {
      if (expect(expected_buf,
                 "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/apache/incubator-htrace/"
                 "refs/heads/master/htrace-c/src/test/string-unit.c"
                 " at line "
                 "61",
                 0, "%d", validate_json_string(NULL, "abc")))
        return 1;
    } while (0);
    ;
  } while (0);
  ;
  do {
    char expected_buf[16] = {0};
    snprintf(expected_buf, sizeof(expected_buf), "%d", 0);
    do {
      if (expect(expected_buf,
                 "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/apache/incubator-htrace/"
                 "refs/heads/master/htrace-c/src/test/string-unit.c"
                 " at line "
                 "62",
                 0, "%d", validate_json_string(NULL, "\\")))
        return 1;
    } while (0);
    ;
  } while (0);
  ;
  do {
    char expected_buf[16] = {0};
    snprintf(expected_buf, sizeof(expected_buf), "%d", 0);
    do {
      if (expect(expected_buf,
                 "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/apache/incubator-htrace/"
                 "refs/heads/master/htrace-c/src/test/string-unit.c"
                 " at line "
                 "63",
                 0, "%d", validate_json_string(NULL, "\"FooBar\"")))
        return 1;
    } while (0);
    ;
  } while (0);
  ;
  do {
    char expected_buf[16] = {0};
    snprintf(expected_buf, sizeof(expected_buf), "%d", 1);
    do {
      if (expect(expected_buf,
                 "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/apache/incubator-htrace/"
                 "refs/heads/master/htrace-c/src/test/string-unit.c"
                 " at line "
                 "64",
                 0, "%d", validate_json_string(NULL, "Foo:bar:baz-whatever")))
        return 1;
    } while (0);
    ;
  } while (0);
  ;
  do {
    char expected_buf[16] = {0};
    snprintf(expected_buf, sizeof(expected_buf), "%d", 0);
    do {
      if (expect(expected_buf,
                 "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/apache/incubator-htrace/"
                 "refs/heads/master/htrace-c/src/test/string-unit.c"
                 " at line "
                 "65",
                 0, "%d", validate_json_string(NULL, "\x01")))
        return 1;
    } while (0);
    ;
  } while (0);
  ;
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<test_validate_json_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
lea    -0x20(%rbp),%rdi
mov    $0x10,%esi
lea    0xe95(%rip),%rdx
mov    $0x1,%ecx
call   1040 <snprintf@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x78(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0x12ba(%rip),%rsi
call   1060 <validate_json_string@plt>
mov    -0x78(%rbp),%rdi
mov    %eax,%r8d
lea    0xe68(%rip),%rsi
xor    %edx,%edx
lea    0xe5c(%rip),%rcx
call   1030 <expect@plt>
cmp    $0x0,%rax
je     11bf <test_validate_json_string+0x7f>
movl   $0x1,-0x4(%rbp)
jmp    1473 <test_validate_json_string+0x333>
jmp    11c4 <test_validate_json_string+0x84>
jmp    11c9 <test_validate_json_string+0x89>
jmp    11ce <test_validate_json_string+0x8e>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    $0x10,%esi
lea    0xe12(%rip),%rdx
mov    $0x1,%ecx
call   1040 <snprintf@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x80(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xf56(%rip),%rsi
call   1060 <validate_json_string@plt>
mov    -0x80(%rbp),%rdi
mov    %eax,%r8d
lea    0xe94(%rip),%rsi
xor    %edx,%edx
lea    0xdd9(%rip),%rcx
call   1030 <expect@plt>
cmp    $0x0,%rax
je     1242 <test_validate_json_string+0x102>
movl   $0x1,-0x4(%rbp)
jmp    1473 <test_validate_json_string+0x333>
jmp    1247 <test_validate_json_string+0x107>
jmp    124c <test_validate_json_string+0x10c>
jmp    1251 <test_validate_json_string+0x111>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
lea    -0x40(%rbp),%rdi
mov    $0x10,%esi
lea    0xd8f(%rip),%rdx
xor    %ecx,%ecx
call   1040 <snprintf@plt>
lea    -0x40(%rbp),%rax
mov    %rax,-0x88(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xf86(%rip),%rsi
call   1060 <validate_json_string@plt>
mov    -0x88(%rbp),%rdi
mov    %eax,%r8d
lea    0xec1(%rip),%rsi
xor    %edx,%edx
lea    0xd53(%rip),%rcx
call   1030 <expect@plt>
cmp    $0x0,%rax
je     12c8 <test_validate_json_string+0x188>
movl   $0x1,-0x4(%rbp)
jmp    1473 <test_validate_json_string+0x333>
jmp    12cd <test_validate_json_string+0x18d>
jmp    12d2 <test_validate_json_string+0x192>
jmp    12d7 <test_validate_json_string+0x197>
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
lea    -0x50(%rbp),%rdi
mov    $0x10,%esi
lea    0xd09(%rip),%rdx
xor    %ecx,%ecx
call   1040 <snprintf@plt>
lea    -0x50(%rbp),%rax
mov    %rax,-0x90(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xfb1(%rip),%rsi
call   1060 <validate_json_string@plt>
mov    -0x90(%rbp),%rdi
mov    %eax,%r8d
lea    0xeec(%rip),%rsi
xor    %edx,%edx
lea    0xccd(%rip),%rcx
call   1030 <expect@plt>
cmp    $0x0,%rax
je     134e <test_validate_json_string+0x20e>
movl   $0x1,-0x4(%rbp)
jmp    1473 <test_validate_json_string+0x333>
jmp    1353 <test_validate_json_string+0x213>
jmp    1358 <test_validate_json_string+0x218>
jmp    135d <test_validate_json_string+0x21d>
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
lea    -0x60(%rbp),%rdi
mov    $0x10,%esi
lea    0xc83(%rip),%rdx
mov    $0x1,%ecx
call   1040 <snprintf@plt>
lea    -0x60(%rbp),%rax
mov    %rax,-0x98(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xfe0(%rip),%rsi
call   1060 <validate_json_string@plt>
mov    -0x98(%rbp),%rdi
mov    %eax,%r8d
lea    0xf1b(%rip),%rsi
xor    %edx,%edx
lea    0xc44(%rip),%rcx
call   1030 <expect@plt>
cmp    $0x0,%rax
je     13d7 <test_validate_json_string+0x297>
movl   $0x1,-0x4(%rbp)
jmp    1473 <test_validate_json_string+0x333>
jmp    13dc <test_validate_json_string+0x29c>
jmp    13e1 <test_validate_json_string+0x2a1>
jmp    13e6 <test_validate_json_string+0x2a6>
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
lea    -0x70(%rbp),%rdi
mov    $0x10,%esi
lea    0xbfa(%rip),%rdx
xor    %ecx,%ecx
call   1040 <snprintf@plt>
lea    -0x70(%rbp),%rax
mov    %rax,-0xa0(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0x101e(%rip),%rsi
call   1060 <validate_json_string@plt>
mov    -0xa0(%rbp),%rdi
mov    %eax,%r8d
lea    0xf59(%rip),%rsi
xor    %edx,%edx
lea    0xbbe(%rip),%rcx
call   1030 <expect@plt>
cmp    $0x0,%rax
je     145d <test_validate_json_string+0x31d>
movl   $0x1,-0x4(%rbp)
jmp    1473 <test_validate_json_string+0x333>
jmp    1462 <test_validate_json_string+0x322>
jmp    1467 <test_validate_json_string+0x327>
mov    0x2b72(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_validate_json_string>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
lea    0xeca(%rip),%rbx
mov    %rsp,%rbp
mov    $0x1,%r14d
mov    %rbp,%rdi
mov    $0x10,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
call   1040 <snprintf@plt>
lea    0x12e7(%rip),%rsi
xor    %edi,%edi
call   1050 <validate_json_string@plt>
lea    0xe9a(%rip),%rsi
mov    %rbp,%rdi
xor    %edx,%edx
mov    %rbx,%rcx
mov    %eax,%r8d
call   1030 <expect@plt>
test   %rax,%rax
jne    1341 <test_validate_json_string+0x211>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
lea    0xe70(%rip),%rbx
mov    %rsp,%rbp
mov    $0x1,%r14d
mov    %rbp,%rdi
mov    $0x10,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
call   1040 <snprintf@plt>
lea    0xfac(%rip),%rsi
xor    %edi,%edi
call   1050 <validate_json_string@plt>
lea    0xeef(%rip),%rsi
mov    %rbp,%rdi
xor    %edx,%edx
mov    %rbx,%rcx
mov    %eax,%r8d
call   1030 <expect@plt>
test   %rax,%rax
jne    1341 <test_validate_json_string+0x211>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
lea    0xe16(%rip),%rbx
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    $0x10,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
call   1040 <snprintf@plt>
lea    0x100e(%rip),%rsi
xor    %edi,%edi
call   1050 <validate_json_string@plt>
lea    0xf51(%rip),%rsi
mov    %rbp,%rdi
xor    %edx,%edx
mov    %rbx,%rcx
mov    %eax,%r8d
call   1030 <expect@plt>
test   %rax,%rax
jne    1341 <test_validate_json_string+0x211>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
lea    0xdc5(%rip),%rbx
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    $0x10,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
call   1040 <snprintf@plt>
lea    0x106e(%rip),%rsi
xor    %edi,%edi
call   1050 <validate_json_string@plt>
lea    0xfb1(%rip),%rsi
mov    %rbp,%rdi
xor    %edx,%edx
mov    %rbx,%rcx
mov    %eax,%r8d
call   1030 <expect@plt>
test   %rax,%rax
jne    1341 <test_validate_json_string+0x211>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
lea    0xd74(%rip),%rbx
mov    %rsp,%rbp
mov    $0x1,%r14d
mov    %rbp,%rdi
mov    $0x10,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
call   1040 <snprintf@plt>
lea    0x10cc(%rip),%rsi
xor    %edi,%edi
call   1050 <validate_json_string@plt>
lea    0x100f(%rip),%rsi
mov    %rbp,%rdi
xor    %edx,%edx
mov    %rbx,%rcx
mov    %eax,%r8d
call   1030 <expect@plt>
test   %rax,%rax
jne    1341 <test_validate_json_string+0x211>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
lea    0xd1e(%rip),%rbx
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    $0x10,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
call   1040 <snprintf@plt>
lea    0x1143(%rip),%rsi
xor    %edi,%edi
call   1050 <validate_json_string@plt>
lea    0x1086(%rip),%rsi
mov    %rbp,%rdi
xor    %edx,%edx
mov    %rbx,%rcx
mov    %eax,%r8d
call   1030 <expect@plt>
mov    $0x1,%r14d
test   %rax,%rax
jne    1341 <test_validate_json_string+0x211>
mov    0x2ca2(%rip),%rax
mov    (%rax),%r14d
mov    %r14d,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/apache/incubator-htrace/refs/heads/master/htrace-c/src/test/string-unit.c at line 60\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/apache/incubator-htrace/refs/heads/master/htrace-c/src/test/string-unit.c at line 61\00"
@.str.4 = [4 x i8] c"abc\00"
@.str.5 = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/apache/incubator-htrace/refs/heads/master/htrace-c/src/test/string-unit.c at line 62\00"
@.str.6 = [2 x i8] c"\\\00"
@.str.7 = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/apache/incubator-htrace/refs/heads/master/htrace-c/src/test/string-unit.c at line 63\00"
@.str.8 = [9 x i8] c"\22FooBar\22\00"
@.str.9 = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/apache/incubator-htrace/refs/heads/master/htrace-c/src/test/string-unit.c at line 64\00"
@.str.10 = [21 x i8] c"Foo:bar:baz-whatever\00"
@.str.11 = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/apache/incubator-htrace/refs/heads/master/htrace-c/src/test/string-unit.c at line 65\00"
@.str.12 = [2 x i8] c"\01\00"
@EXIT_SUCCESS = global i32 0
define i32 @test_validate_json_string() {
%1 = alloca i32
%2 = alloca [16 x i8]
%3 = alloca [16 x i8]
%4 = alloca [16 x i8]
%5 = alloca [16 x i8]
%6 = alloca [16 x i8]
%7 = alloca [16 x i8]
br label %8
8: ; preds = %0
%9 = bitcast [16 x i8]* %2 to i8*
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%11 = call i32 @snprintf(i8* %10, i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
br label %12
12: ; preds = %8
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%14 = call i32 @validate_json_string(i32* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%15 = call i64 @expect(i8* %13, i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.1, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12
store i32 1, i32* %1
br label %87
18: ; preds = %12
br label %19
19: ; preds = %18
br label %20
20: ; preds = %19
br label %21
21: ; preds = %20
%22 = bitcast [16 x i8]* %3 to i8*
%23 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%24 = call i32 @snprintf(i8* %23, i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
br label %25
25: ; preds = %21
%26 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%27 = call i32 @validate_json_string(i32* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%28 = call i64 @expect(i8* %26, i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.3, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %27)
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %25
store i32 1, i32* %1
br label %87
31: ; preds = %25
br label %32
32: ; preds = %31
br label %33
33: ; preds = %32
br label %34
34: ; preds = %33
%35 = bitcast [16 x i8]* %4 to i8*
%36 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%37 = call i32 @snprintf(i8* %36, i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
br label %38
38: ; preds = %34
%39 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%40 = call i32 @validate_json_string(i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%41 = call i64 @expect(i8* %39, i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.5, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %40)
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %44
43: ; preds = %38
store i32 1, i32* %1
br label %87
44: ; preds = %38
br label %45
45: ; preds = %44
br label %46
46: ; preds = %45
br label %47
47: ; preds = %46
%48 = bitcast [16 x i8]* %5 to i8*
%49 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%50 = call i32 @snprintf(i8* %49, i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
br label %51
51: ; preds = %47
%52 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%53 = call i32 @validate_json_string(i32* null, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%54 = call i64 @expect(i8* %52, i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.7, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %53)
%55 = icmp ne i64 %54, 0
br i1 %55, label %56, label %57
56: ; preds = %51
store i32 1, i32* %1
br label %87
57: ; preds = %51
br label %58
58: ; preds = %57
br label %59
59: ; preds = %58
br label %60
60: ; preds = %59
%61 = bitcast [16 x i8]* %6 to i8*
%62 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%63 = call i32 @snprintf(i8* %62, i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
br label %64
64: ; preds = %60
%65 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%66 = call i32 @validate_json_string(i32* null, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0))
%67 = call i64 @expect(i8* %65, i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.9, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %66)
%68 = icmp ne i64 %67, 0
br i1 %68, label %69, label %70
69: ; preds = %64
store i32 1, i32* %1
br label %87
70: ; preds = %64
br label %71
71: ; preds = %70
br label %72
72: ; preds = %71
br label %73
73: ; preds = %72
%74 = bitcast [16 x i8]* %7 to i8*
%75 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%76 = call i32 @snprintf(i8* %75, i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
br label %77
77: ; preds = %73
%78 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%79 = call i32 @validate_json_string(i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%80 = call i64 @expect(i8* %78, i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.11, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %79)
%81 = icmp ne i64 %80, 0
br i1 %81, label %82, label %83
82: ; preds = %77
store i32 1, i32* %1
br label %87
83: ; preds = %77
br label %84
84: ; preds = %83
br label %85
85: ; preds = %84
%86 = load i32, i32* @EXIT_SUCCESS
store i32 %86, i32* %1
br label %87
87: ; preds = %85, %82, %69, %56, %43, %30, %17
%88 = load i32, i32* %1
ret i32 %88
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/apache/incubator-htrace/refs/heads/master/htrace-c/src/test/string-unit.c at line 60\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/apache/incubator-htrace/refs/heads/master/htrace-c/src/test/string-unit.c at line 61\00"
@.str.4 = [4 x i8] c"abc\00"
@.str.5 = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/apache/incubator-htrace/refs/heads/master/htrace-c/src/test/string-unit.c at line 62\00"
@.str.6 = [2 x i8] c"\\\00"
@.str.7 = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/apache/incubator-htrace/refs/heads/master/htrace-c/src/test/string-unit.c at line 63\00"
@.str.8 = [9 x i8] c"\22FooBar\22\00"
@.str.9 = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/apache/incubator-htrace/refs/heads/master/htrace-c/src/test/string-unit.c at line 64\00"
@.str.10 = [21 x i8] c"Foo:bar:baz-whatever\00"
@.str.11 = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/apache/incubator-htrace/refs/heads/master/htrace-c/src/test/string-unit.c at line 65\00"
@.str.12 = [2 x i8] c"\01\00"
@EXIT_SUCCESS = global i32 0
define i32 @test_validate_json_string() {
%1 = alloca [16 x i8]
%2 = alloca [16 x i8]
%3 = alloca [16 x i8]
%4 = alloca [16 x i8]
%5 = alloca [16 x i8]
%6 = alloca [16 x i8]
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%8 = call i32 @snprintf(i8* %7, i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
%9 = call i32 @validate_json_string(i32* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%10 = call i64 @expect(i8* %7, i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.1, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %44
12: ; preds = %0
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%14 = call i32 @snprintf(i8* %13, i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
%15 = call i32 @validate_json_string(i32* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%16 = call i64 @expect(i8* %13, i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.3, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %44
18: ; preds = %12
%19 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%20 = call i32 @snprintf(i8* %19, i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
%21 = call i32 @validate_json_string(i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%22 = call i64 @expect(i8* %19, i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.5, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %44
24: ; preds = %18
%25 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%26 = call i32 @snprintf(i8* %25, i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
%27 = call i32 @validate_json_string(i32* null, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%28 = call i64 @expect(i8* %25, i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.7, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %27)
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %44
30: ; preds = %24
%31 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%32 = call i32 @snprintf(i8* %31, i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
%33 = call i32 @validate_json_string(i32* null, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0))
%34 = call i64 @expect(i8* %31, i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.9, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %33)
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %44
36: ; preds = %30
%37 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%38 = call i32 @snprintf(i8* %37, i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
%39 = call i32 @validate_json_string(i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%40 = call i64 @expect(i8* %37, i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.11, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %39)
%41 = icmp eq i64 %40, 0
%42 = load i32, i32* @EXIT_SUCCESS
%43 = select i1 %41, i32 %42, i32 1
br label %44
44: ; preds = %36, %30, %24, %18, %12, %0
%45 = phi i32 [ 1, %0 ], [ 1, %12 ], [ 1, %18 ], [ 1, %24 ], [ 1, %30 ], [ %43, %36 ]
ret i32 %45
}