#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 */

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ eh_snprintf(char *, int, char *, int);
scalar_t__ ehpf_check_str_m(char *, int, char *, char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int main(int argc, char **argv) {
  char expect[80];
  char actual[80];
  int failures, verbose;
  failures = 0;
  verbose = (argc > 1) ? atoi(argv[1]) : 0;
  eh_snprintf(actual, 80, "%X", 23);
  sprintf(expect, "%X", 23);
  failures +=
      ehpf_check_str_m("/scratch/repos/new/home/jordi_armengol_estape/"
                       "c-scraper/outputs/2022-01-22/02-19-57/repos/ericherman/"
                       "libeh-printf/refs/heads/master/tests/test-hex-int.c",
                       29, actual, expect, "%X");
  if (verbose) {
    printf(" format: '%s'\n actual: '%s'\n expect: '%s'\n", "%X", actual,
           expect);
  };
  eh_snprintf(actual, 80, "%#010x", 23);
  sprintf(expect, "%#010x", 23);
  failures +=
      ehpf_check_str_m("/scratch/repos/new/home/jordi_armengol_estape/"
                       "c-scraper/outputs/2022-01-22/02-19-57/repos/ericherman/"
                       "libeh-printf/refs/heads/master/tests/test-hex-int.c",
                       30, actual, expect, "%#010x");
  if (verbose) {
    printf(" format: '%s'\n actual: '%s'\n expect: '%s'\n", "%#010x", actual,
           expect);
  };
  eh_snprintf(actual, 80, "%#010x", 1);
  sprintf(expect, "%#010x", 1);
  failures +=
      ehpf_check_str_m("/scratch/repos/new/home/jordi_armengol_estape/"
                       "c-scraper/outputs/2022-01-22/02-19-57/repos/ericherman/"
                       "libeh-printf/refs/heads/master/tests/test-hex-int.c",
                       31, actual, expect, "%#010x");
  if (verbose) {
    printf(" format: '%s'\n actual: '%s'\n expect: '%s'\n", "%#010x", actual,
           expect);
  };
  eh_snprintf(actual, 80, "0x%08x", 2);
  sprintf(expect, "0x%08x", 2);
  failures +=
      ehpf_check_str_m("/scratch/repos/new/home/jordi_armengol_estape/"
                       "c-scraper/outputs/2022-01-22/02-19-57/repos/ericherman/"
                       "libeh-printf/refs/heads/master/tests/test-hex-int.c",
                       32, actual, expect, "0x%08x");
  if (verbose) {
    printf(" format: '%s'\n actual: '%s'\n expect: '%s'\n", "0x%08x", actual,
           expect);
  };
  eh_snprintf(actual, 80, "%#08x", 5);
  sprintf(expect, "%#08x", 5);
  failures +=
      ehpf_check_str_m("/scratch/repos/new/home/jordi_armengol_estape/"
                       "c-scraper/outputs/2022-01-22/02-19-57/repos/ericherman/"
                       "libeh-printf/refs/heads/master/tests/test-hex-int.c",
                       33, actual, expect, "%#08x");
  if (verbose) {
    printf(" format: '%s'\n actual: '%s'\n expect: '%s'\n", "%#08x", actual,
           expect);
  };
  eh_snprintf(actual, 80, "%04x", 1234);
  sprintf(expect, "%04x", 1234);
  failures +=
      ehpf_check_str_m("/scratch/repos/new/home/jordi_armengol_estape/"
                       "c-scraper/outputs/2022-01-22/02-19-57/repos/ericherman/"
                       "libeh-printf/refs/heads/master/tests/test-hex-int.c",
                       34, actual, expect, "%04x");
  if (verbose) {
    printf(" format: '%s'\n actual: '%s'\n expect: '%s'\n", "%04x", actual,
           expect);
  };
  eh_snprintf(actual, 80, "%04X", 1234);
  sprintf(expect, "%04X", 1234);
  failures +=
      ehpf_check_str_m("/scratch/repos/new/home/jordi_armengol_estape/"
                       "c-scraper/outputs/2022-01-22/02-19-57/repos/ericherman/"
                       "libeh-printf/refs/heads/master/tests/test-hex-int.c",
                       35, actual, expect, "%04X");
  if (verbose) {
    printf(" format: '%s'\n actual: '%s'\n expect: '%s'\n", "%04X", actual,
           expect);
  };
  return failures ? 1 : 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0xb4(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1195 <main+0x45>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0xbc(%rbp)
jmp    11a2 <main+0x52>
xor    %eax,%eax
mov    %eax,-0xbc(%rbp)
jmp    11a2 <main+0x52>
mov    -0xbc(%rbp),%eax
mov    %eax,-0xb8(%rbp)
lea    -0xb0(%rbp),%rdi
mov    $0x50,%esi
lea    0xe3f(%rip),%rdx
mov    $0x17,%ecx
call   1050 <eh_snprintf@plt>
lea    -0x60(%rbp),%rdi
lea    0xe2a(%rip),%rsi
mov    $0x17,%edx
call   1070 <sprintf@plt>
lea    -0xb0(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    0xe11(%rip),%rdi
mov    $0x1d,%esi
lea    0xe02(%rip),%r8
call   1040 <ehpf_check_str_m@plt>
mov    %rax,%rcx
movslq -0xb4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xb4(%rbp)
cmpl   $0x0,-0xb8(%rbp)
je     1241 <main+0xf1>
lea    -0xb0(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    0xe67(%rip),%rdi
lea    0xdc4(%rip),%rsi
call   1030 <printf@plt>
lea    -0xb0(%rbp),%rdi
mov    $0x50,%esi
lea    0xe73(%rip),%rdx
mov    $0x17,%ecx
call   1050 <eh_snprintf@plt>
lea    -0x60(%rbp),%rdi
lea    0xe5e(%rip),%rsi
mov    $0x17,%edx
call   1070 <sprintf@plt>
lea    -0xb0(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    0xd7e(%rip),%rdi
mov    $0x1e,%esi
lea    0xe36(%rip),%r8
call   1040 <ehpf_check_str_m@plt>
mov    %rax,%rcx
movslq -0xb4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xb4(%rbp)
cmpl   $0x0,-0xb8(%rbp)
je     12d4 <main+0x184>
lea    -0xb0(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    0xdd4(%rip),%rdi
lea    0xdf8(%rip),%rsi
call   1030 <printf@plt>
lea    -0xb0(%rbp),%rdi
mov    $0x50,%esi
lea    0xde0(%rip),%rdx
mov    $0x1,%ecx
call   1050 <eh_snprintf@plt>
lea    -0x60(%rbp),%rdi
lea    0xdcb(%rip),%rsi
mov    $0x1,%edx
call   1070 <sprintf@plt>
lea    -0xb0(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    0xceb(%rip),%rdi
mov    $0x1f,%esi
lea    0xda3(%rip),%r8
call   1040 <ehpf_check_str_m@plt>
mov    %rax,%rcx
movslq -0xb4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xb4(%rbp)
cmpl   $0x0,-0xb8(%rbp)
je     1367 <main+0x217>
lea    -0xb0(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    0xd41(%rip),%rdi
lea    0xd65(%rip),%rsi
call   1030 <printf@plt>
lea    -0xb0(%rbp),%rdi
mov    $0x50,%esi
lea    0xd54(%rip),%rdx
mov    $0x2,%ecx
call   1050 <eh_snprintf@plt>
lea    -0x60(%rbp),%rdi
lea    0xd3f(%rip),%rsi
mov    $0x2,%edx
call   1070 <sprintf@plt>
lea    -0xb0(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    0xc58(%rip),%rdi
mov    $0x20,%esi
lea    0xd17(%rip),%r8
call   1040 <ehpf_check_str_m@plt>
mov    %rax,%rcx
movslq -0xb4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xb4(%rbp)
cmpl   $0x0,-0xb8(%rbp)
je     13fa <main+0x2aa>
lea    -0xb0(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    0xcae(%rip),%rdi
lea    0xcd9(%rip),%rsi
call   1030 <printf@plt>
lea    -0xb0(%rbp),%rdi
mov    $0x50,%esi
lea    0xcc8(%rip),%rdx
mov    $0x5,%ecx
call   1050 <eh_snprintf@plt>
lea    -0x60(%rbp),%rdi
lea    0xcb3(%rip),%rsi
mov    $0x5,%edx
call   1070 <sprintf@plt>
lea    -0xb0(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    0xbc5(%rip),%rdi
mov    $0x21,%esi
lea    0xc8b(%rip),%r8
call   1040 <ehpf_check_str_m@plt>
mov    %rax,%rcx
movslq -0xb4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xb4(%rbp)
cmpl   $0x0,-0xb8(%rbp)
je     148d <main+0x33d>
lea    -0xb0(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    0xc1b(%rip),%rdi
lea    0xc4d(%rip),%rsi
call   1030 <printf@plt>
lea    -0xb0(%rbp),%rdi
mov    $0x50,%esi
lea    0xc3b(%rip),%rdx
mov    $0x4d2,%ecx
call   1050 <eh_snprintf@plt>
lea    -0x60(%rbp),%rdi
lea    0xc26(%rip),%rsi
mov    $0x4d2,%edx
call   1070 <sprintf@plt>
lea    -0xb0(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    0xb32(%rip),%rdi
mov    $0x22,%esi
lea    0xbfe(%rip),%r8
call   1040 <ehpf_check_str_m@plt>
mov    %rax,%rcx
movslq -0xb4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xb4(%rbp)
cmpl   $0x0,-0xb8(%rbp)
je     1520 <main+0x3d0>
lea    -0xb0(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    0xb88(%rip),%rdi
lea    0xbc0(%rip),%rsi
call   1030 <printf@plt>
lea    -0xb0(%rbp),%rdi
mov    $0x50,%esi
lea    0xbad(%rip),%rdx
mov    $0x4d2,%ecx
call   1050 <eh_snprintf@plt>
lea    -0x60(%rbp),%rdi
lea    0xb98(%rip),%rsi
mov    $0x4d2,%edx
call   1070 <sprintf@plt>
lea    -0xb0(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    0xa9f(%rip),%rdi
mov    $0x23,%esi
lea    0xb70(%rip),%r8
call   1040 <ehpf_check_str_m@plt>
mov    %rax,%rcx
movslq -0xb4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xb4(%rbp)
cmpl   $0x0,-0xb8(%rbp)
je     15b3 <main+0x463>
lea    -0xb0(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    0xaf5(%rip),%rdi
lea    0xb32(%rip),%rsi
call   1030 <printf@plt>
mov    -0xb4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    $0x1,%r13b
cmp    $0x2,%edi
jl     1178 <main+0x28>
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
test   %eax,%eax
sete   %r13b
lea    0xe81(%rip),%rbx
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    $0x50,%esi
mov    %rbx,%rdx
mov    $0x17,%ecx
call   1050 <eh_snprintf@plt>
lea    0x70(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x17,%edx
call   1070 <sprintf@plt>
lea    0xe4e(%rip),%rdi
mov    $0x1d,%esi
mov    %r14,%rdx
mov    %rbp,%rcx
mov    %rbx,%r8
call   1040 <ehpf_check_str_m@plt>
mov    %rax,0x18(%rsp)
test   %r13b,%r13b
jne    11ef <main+0x9f>
lea    0xec3(%rip),%rdi
lea    0xe20(%rip),%rsi
lea    0x20(%rsp),%rdx
lea    0x70(%rsp),%rcx
call   1030 <printf@plt>
lea    0xed1(%rip),%rbx
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    $0x50,%esi
mov    %rbx,%rdx
mov    $0x17,%ecx
call   1050 <eh_snprintf@plt>
lea    0x70(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x17,%edx
call   1070 <sprintf@plt>
lea    0xdd7(%rip),%rdi
mov    $0x1e,%esi
mov    %r14,%rdx
mov    %rbp,%rcx
mov    %rbx,%r8
call   1040 <ehpf_check_str_m@plt>
mov    %rax,0x10(%rsp)
test   %r13b,%r13b
jne    1266 <main+0x116>
lea    0xe4c(%rip),%rdi
lea    0xe70(%rip),%rsi
lea    0x20(%rsp),%rdx
lea    0x70(%rsp),%rcx
call   1030 <printf@plt>
lea    0xe5a(%rip),%rbx
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    $0x50,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
call   1050 <eh_snprintf@plt>
lea    0x70(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1070 <sprintf@plt>
lea    0xd60(%rip),%rdi
mov    $0x1f,%esi
mov    %r14,%rdx
mov    %rbp,%rcx
mov    %rbx,%r8
call   1040 <ehpf_check_str_m@plt>
mov    %rax,0x8(%rsp)
test   %r13b,%r13b
jne    12dd <main+0x18d>
lea    0xdd5(%rip),%rdi
lea    0xdf9(%rip),%rsi
lea    0x20(%rsp),%rdx
lea    0x70(%rsp),%rcx
call   1030 <printf@plt>
lea    0xdea(%rip),%rbx
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    $0x50,%esi
mov    %rbx,%rdx
mov    $0x2,%ecx
call   1050 <eh_snprintf@plt>
lea    0x70(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1070 <sprintf@plt>
lea    0xce9(%rip),%rdi
mov    $0x20,%esi
mov    %r14,%rdx
mov    %rbp,%rcx
mov    %rbx,%r8
call   1040 <ehpf_check_str_m@plt>
mov    %rax,(%rsp)
test   %r13b,%r13b
jne    1353 <main+0x203>
lea    0xd5f(%rip),%rdi
lea    0xd8a(%rip),%rsi
lea    0x20(%rsp),%rdx
lea    0x70(%rsp),%rcx
call   1030 <printf@plt>
lea    0xd7b(%rip),%rbx
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    $0x50,%esi
mov    %rbx,%rdx
mov    $0x5,%ecx
call   1050 <eh_snprintf@plt>
lea    0x70(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1070 <sprintf@plt>
lea    0xc73(%rip),%rdi
mov    $0x21,%esi
mov    %r14,%rdx
mov    %rbp,%rcx
mov    %rbx,%r8
call   1040 <ehpf_check_str_m@plt>
mov    %rax,%r15
test   %r13b,%r13b
jne    13c8 <main+0x278>
lea    0xcea(%rip),%rdi
lea    0xd1c(%rip),%rsi
lea    0x20(%rsp),%rdx
lea    0x70(%rsp),%rcx
call   1030 <printf@plt>
lea    0xd0c(%rip),%rbp
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    $0x50,%esi
mov    %rbp,%rdx
mov    $0x4d2,%ecx
call   1050 <eh_snprintf@plt>
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x4d2,%edx
call   1070 <sprintf@plt>
lea    0xbfe(%rip),%rdi
mov    $0x22,%esi
mov    %r14,%rdx
mov    %rbx,%rcx
mov    %rbp,%r8
call   1040 <ehpf_check_str_m@plt>
mov    %rax,%rbp
test   %r13b,%r13b
jne    143d <main+0x2ed>
lea    0xc75(%rip),%rdi
lea    0xcad(%rip),%rsi
lea    0x20(%rsp),%rdx
lea    0x70(%rsp),%rcx
call   1030 <printf@plt>
lea    0xc9c(%rip),%rbx
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    $0x50,%esi
mov    %rbx,%rdx
mov    $0x4d2,%ecx
call   1050 <eh_snprintf@plt>
lea    0x70(%rsp),%r12
mov    %r12,%rdi
mov    %rbx,%rsi
mov    $0x4d2,%edx
call   1070 <sprintf@plt>
lea    0xb89(%rip),%rdi
mov    $0x23,%esi
mov    %r14,%rdx
mov    %r12,%rcx
mov    %rbx,%r8
call   1040 <ehpf_check_str_m@plt>
mov    %rax,%r14
test   %r13b,%r13b
jne    14b2 <main+0x362>
lea    0xc00(%rip),%rdi
lea    0xc3d(%rip),%rsi
lea    0x20(%rsp),%rdx
lea    0x70(%rsp),%rcx
call   1030 <printf@plt>
mov    0x10(%rsp),%rax
add    0x18(%rsp),%eax
mov    0x8(%rsp),%rcx
add    %eax,%ecx
mov    (%rsp),%rax
add    %ecx,%eax
add    %eax,%r15d
add    %r15d,%ebp
xor    %eax,%eax
add    %ebp,%r14d
setne  %al
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%X\00"
@.str.1 = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ericherman/libeh-printf/refs/heads/master/tests/test-hex-int.c\00"
@.str.2 = [43 x i8] c" format: '%s'\0A actual: '%s'\0A expect: '%s'\0A\00"
@.str.3 = [7 x i8] c"%x\00"
@.str.4 = [7 x i8] c"0x%08x\00"
@.str.5 = [6 x i8] c"%x\00"
@.str.6 = [5 x i8] c"%04x\00"
@.str.7 = [5 x i8] c"%04X\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [80 x i8]
%7 = alloca [80 x i8]
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @atoi(i8* %15)
br label %18
17: ; preds = %2
br label %18
18: ; preds = %17, %12
%19 = phi i32 [ %16, %12 ], [ 0, %17 ]
store i32 %19, i32* %9
%20 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%21 = call i32 @eh_snprintf(i8* %20, i32 80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 23)
%22 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%23 = call i32 @sprintf(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 23)
%24 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%25 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%26 = call i64 @ehpf_check_str_m(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 29, i8* %24, i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%27 = load i32, i32* %8
%28 = sext i32 %27 to i64
%29 = add nsw i64 %28, %26
%30 = trunc i64 %29 to i32
store i32 %30, i32* %8
%31 = load i32, i32* %9
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %37
33: ; preds = %18
%34 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%35 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%36 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %34, i8* %35)
br label %37
37: ; preds = %33, %18
%38 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%39 = call i32 @eh_snprintf(i8* %38, i32 80, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 23)
%40 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%41 = call i32 @sprintf(i8* %40, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 23)
%42 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%43 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%44 = call i64 @ehpf_check_str_m(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 30, i8* %42, i8* %43, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%45 = load i32, i32* %8
%46 = sext i32 %45 to i64
%47 = add nsw i64 %46, %44
%48 = trunc i64 %47 to i32
store i32 %48, i32* %8
%49 = load i32, i32* %9
%50 = icmp ne i32 %49, 0
br i1 %50, label %51, label %55
51: ; preds = %37
%52 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%53 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%54 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %52, i8* %53)
br label %55
55: ; preds = %51, %37
%56 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%57 = call i32 @eh_snprintf(i8* %56, i32 80, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 1)
%58 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%59 = call i32 @sprintf(i8* %58, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 1)
%60 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%61 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%62 = call i64 @ehpf_check_str_m(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 31, i8* %60, i8* %61, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%63 = load i32, i32* %8
%64 = sext i32 %63 to i64
%65 = add nsw i64 %64, %62
%66 = trunc i64 %65 to i32
store i32 %66, i32* %8
%67 = load i32, i32* %9
%68 = icmp ne i32 %67, 0
br i1 %68, label %69, label %73
69: ; preds = %55
%70 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%71 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%72 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %70, i8* %71)
br label %73
73: ; preds = %69, %55
%74 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%75 = call i32 @eh_snprintf(i8* %74, i32 80, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 2)
%76 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%77 = call i32 @sprintf(i8* %76, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 2)
%78 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%79 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%80 = call i64 @ehpf_check_str_m(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 32, i8* %78, i8* %79, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%81 = load i32, i32* %8
%82 = sext i32 %81 to i64
%83 = add nsw i64 %82, %80
%84 = trunc i64 %83 to i32
store i32 %84, i32* %8
%85 = load i32, i32* %9
%86 = icmp ne i32 %85, 0
br i1 %86, label %87, label %91
87: ; preds = %73
%88 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%89 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%90 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %88, i8* %89)
br label %91
91: ; preds = %87, %73
%92 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%93 = call i32 @eh_snprintf(i8* %92, i32 80, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 5)
%94 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%95 = call i32 @sprintf(i8* %94, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 5)
%96 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%97 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%98 = call i64 @ehpf_check_str_m(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 33, i8* %96, i8* %97, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%99 = load i32, i32* %8
%100 = sext i32 %99 to i64
%101 = add nsw i64 %100, %98
%102 = trunc i64 %101 to i32
store i32 %102, i32* %8
%103 = load i32, i32* %9
%104 = icmp ne i32 %103, 0
br i1 %104, label %105, label %109
105: ; preds = %91
%106 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%107 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%108 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %106, i8* %107)
br label %109
109: ; preds = %105, %91
%110 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%111 = call i32 @eh_snprintf(i8* %110, i32 80, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 1234)
%112 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%113 = call i32 @sprintf(i8* %112, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 1234)
%114 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%115 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%116 = call i64 @ehpf_check_str_m(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 34, i8* %114, i8* %115, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%117 = load i32, i32* %8
%118 = sext i32 %117 to i64
%119 = add nsw i64 %118, %116
%120 = trunc i64 %119 to i32
store i32 %120, i32* %8
%121 = load i32, i32* %9
%122 = icmp ne i32 %121, 0
br i1 %122, label %123, label %127
123: ; preds = %109
%124 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%125 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%126 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* %124, i8* %125)
br label %127
127: ; preds = %123, %109
%128 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%129 = call i32 @eh_snprintf(i8* %128, i32 80, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 1234)
%130 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%131 = call i32 @sprintf(i8* %130, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 1234)
%132 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%133 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%134 = call i64 @ehpf_check_str_m(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 35, i8* %132, i8* %133, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%135 = load i32, i32* %8
%136 = sext i32 %135 to i64
%137 = add nsw i64 %136, %134
%138 = trunc i64 %137 to i32
store i32 %138, i32* %8
%139 = load i32, i32* %9
%140 = icmp ne i32 %139, 0
br i1 %140, label %141, label %145
141: ; preds = %127
%142 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%143 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%144 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %142, i8* %143)
br label %145
145: ; preds = %141, %127
%146 = load i32, i32* %8
%147 = icmp ne i32 %146, 0
%148 = zext i1 %147 to i64
%149 = select i1 %147, i32 1, i32 0
ret i32 %149
}

LLVM IR (-O2):
@.str = [3 x i8] c"%X\00"
@.str.1 = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ericherman/libeh-printf/refs/heads/master/tests/test-hex-int.c\00"
@.str.2 = [43 x i8] c" format: '%s'\0A actual: '%s'\0A expect: '%s'\0A\00"
@.str.3 = [7 x i8] c"%x\00"
@.str.4 = [7 x i8] c"0x%08x\00"
@.str.5 = [6 x i8] c"%x\00"
@.str.6 = [5 x i8] c"%04x\00"
@.str.7 = [5 x i8] c"%04X\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [80 x i8]
%4 = alloca [80 x i8]
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = icmp eq i32 %11, 0
br label %13
13: ; preds = %2, %8
%14 = phi i1 [ %12, %8 ], [ true, %2 ]
%15 = call i32 @eh_snprintf(i8* %6, i32 80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 23)
%16 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 23)
%17 = call i64 @ehpf_check_str_m(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 29, i8* %6, i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br i1 %14, label %20, label %18
18: ; preds = %13
%19 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %5)
br label %20
20: ; preds = %18, %13
%21 = call i32 @eh_snprintf(i8* %6, i32 80, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 23)
%22 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 23)
%23 = call i64 @ehpf_check_str_m(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 30, i8* %6, i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br i1 %14, label %26, label %24
24: ; preds = %20
%25 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %6, i8* %5)
br label %26
26: ; preds = %24, %20
%27 = call i32 @eh_snprintf(i8* %6, i32 80, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 1)
%28 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 1)
%29 = call i64 @ehpf_check_str_m(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 31, i8* %6, i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br i1 %14, label %32, label %30
30: ; preds = %26
%31 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %6, i8* %5)
br label %32
32: ; preds = %30, %26
%33 = call i32 @eh_snprintf(i8* %6, i32 80, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 2)
%34 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 2)
%35 = call i64 @ehpf_check_str_m(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 32, i8* %6, i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br i1 %14, label %38, label %36
36: ; preds = %32
%37 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %6, i8* %5)
br label %38
38: ; preds = %36, %32
%39 = call i32 @eh_snprintf(i8* %6, i32 80, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 5)
%40 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 5)
%41 = call i64 @ehpf_check_str_m(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 33, i8* %6, i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br i1 %14, label %44, label %42
42: ; preds = %38
%43 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %6, i8* %5)
br label %44
44: ; preds = %42, %38
%45 = call i32 @eh_snprintf(i8* %6, i32 80, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 1234)
%46 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 1234)
%47 = call i64 @ehpf_check_str_m(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 34, i8* %6, i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br i1 %14, label %50, label %48
48: ; preds = %44
%49 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* %6, i8* %5)
br label %50
50: ; preds = %48, %44
%51 = call i32 @eh_snprintf(i8* %6, i32 80, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 1234)
%52 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 1234)
%53 = call i64 @ehpf_check_str_m(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 35, i8* %6, i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br i1 %14, label %56, label %54
54: ; preds = %50
%55 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %6, i8* %5)
br label %56
56: ; preds = %54, %50
%57 = add i64 %23, %17
%58 = add i64 %57, %29
%59 = add i64 %58, %35
%60 = add i64 %59, %41
%61 = add i64 %60, %47
%62 = add i64 %61, %53
%63 = trunc i64 %62 to i32
%64 = icmp ne i32 %63, 0
%65 = zext i1 %64 to i32
ret i32 %65
}