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

/* Variables and functions */
scalar_t__ Verify(char *, int, char *, char *, char *);
int trio_snprintf(char *, int, char *, ...);
int trio_strerror(int);
int VerifyErrors(void) {
  char buffer[512];
  int rc;
  int nerrors = 0;
  rc = trio_snprintf(buffer, sizeof(buffer), "%d %r", 42, "text");
  trio_snprintf(buffer, sizeof(buffer), "Err = %d (%s), Pos = %d",
                ((-(rc)) & 0x00FF), trio_strerror(rc), ((-(rc)) >> 8));
  nerrors += Verify("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/hypermail-project/"
                    "hypermail/refs/heads/master/src/trio/regression.c",
                    997, "Err = 2 (Invalid argument), Pos = 5", "%s", buffer);
  rc = trio_snprintf(buffer, sizeof(buffer), "%#");
  trio_snprintf(buffer, sizeof(buffer), "Err = %d (%s), Pos = %d",
                ((-(rc)) & 0x00FF), trio_strerror(rc), ((-(rc)) >> 8));
  nerrors += Verify("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/hypermail-project/"
                    "hypermail/refs/heads/master/src/trio/regression.c",
                    1018, "Err = 2 (Invalid argument), Pos = 3", "%s", buffer);
  rc = trio_snprintf(buffer, sizeof(buffer), "%hhhd", 42);
  trio_snprintf(buffer, sizeof(buffer), "Err = %d (%s), Pos = %d",
                ((-(rc)) & 0x00FF), trio_strerror(rc), ((-(rc)) >> 8));
  nerrors += Verify("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/hypermail-project/"
                    "hypermail/refs/heads/master/src/trio/regression.c",
                    1039, "Err = 2 (Invalid argument), Pos = 4", "%s", buffer);
  rc = trio_snprintf(buffer, sizeof(buffer), "hello %1$d %1$d", 31, 32);
  trio_snprintf(buffer, sizeof(buffer), "Err = %d (%s), Pos = %d",
                ((-(rc)) & 0x00FF), trio_strerror(rc), ((-(rc)) >> 8));
  nerrors += Verify("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/hypermail-project/"
                    "hypermail/refs/heads/master/src/trio/regression.c",
                    1061, "Err = 4 (Double reference), Pos = 0", "%s", buffer);
  rc = trio_snprintf(buffer, sizeof(buffer), "%3$d %1$d", 31, 32, 33);
  trio_snprintf(buffer, sizeof(buffer), "Err = %d (%s), Pos = %d",
                ((-(rc)) & 0x00FF), trio_strerror(rc), ((-(rc)) >> 8));
  nerrors += Verify("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/hypermail-project/"
                    "hypermail/refs/heads/master/src/trio/regression.c",
                    1092, "Err = 5 (Reference gap), Pos = 1", "%s", buffer);
  return nerrors;
}


x86 assembly (clang, -O0):
<VerifyErrors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x260,%rsp
movl   $0x0,-0x208(%rbp)
lea    -0x200(%rbp),%rdi
mov    $0x200,%esi
lea    0xea8(%rip),%rdx
mov    $0x2a,%ecx
lea    0xea2(%rip),%r8
mov    $0x0,%al
call   1040 <trio_snprintf@plt>
mov    %eax,-0x204(%rbp)
lea    -0x200(%rbp),%rax
mov    %rax,-0x258(%rbp)
xor    %eax,%eax
sub    -0x204(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x24c(%rbp)
mov    -0x204(%rbp),%edi
call   1030 <trio_strerror@plt>
mov    -0x258(%rbp),%rdi
mov    -0x24c(%rbp),%ecx
mov    %eax,%r8d
xor    %r9d,%r9d
sub    -0x204(%rbp),%r9d
sar    $0x8,%r9d
mov    $0x200,%esi
lea    0xe44(%rip),%rdx
mov    $0x0,%al
call   1040 <trio_snprintf@plt>
lea    -0x200(%rbp),%r8
lea    0xe47(%rip),%rdi
mov    $0x3e5,%esi
lea    0xed9(%rip),%rdx
lea    0xef6(%rip),%rcx
call   1050 <Verify@plt>
mov    %rax,%rcx
movslq -0x208(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x208(%rbp)
lea    -0x200(%rbp),%rdi
mov    $0x200,%esi
lea    0xece(%rip),%rdx
mov    $0x0,%al
call   1040 <trio_snprintf@plt>
mov    %eax,-0x204(%rbp)
lea    -0x200(%rbp),%rax
mov    %rax,-0x248(%rbp)
xor    %eax,%eax
sub    -0x204(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x23c(%rbp)
mov    -0x204(%rbp),%edi
call   1030 <trio_strerror@plt>
mov    -0x248(%rbp),%rdi
mov    -0x23c(%rbp),%ecx
mov    %eax,%r8d
xor    %r9d,%r9d
sub    -0x204(%rbp),%r9d
sar    $0x8,%r9d
mov    $0x200,%esi
lea    0xd8e(%rip),%rdx
mov    $0x0,%al
call   1040 <trio_snprintf@plt>
lea    -0x200(%rbp),%r8
lea    0xd91(%rip),%rdi
mov    $0x3fa,%esi
lea    0xe4d(%rip),%rdx
lea    0xe40(%rip),%rcx
call   1050 <Verify@plt>
mov    %rax,%rcx
movslq -0x208(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x208(%rbp)
lea    -0x200(%rbp),%rdi
mov    $0x200,%esi
lea    0xe3f(%rip),%rdx
mov    $0x2a,%ecx
mov    $0x0,%al
call   1040 <trio_snprintf@plt>
mov    %eax,-0x204(%rbp)
lea    -0x200(%rbp),%rax
mov    %rax,-0x238(%rbp)
xor    %eax,%eax
sub    -0x204(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x22c(%rbp)
mov    -0x204(%rbp),%edi
call   1030 <trio_strerror@plt>
mov    -0x238(%rbp),%rdi
mov    -0x22c(%rbp),%ecx
mov    %eax,%r8d
xor    %r9d,%r9d
sub    -0x204(%rbp),%r9d
sar    $0x8,%r9d
mov    $0x200,%esi
lea    0xcd3(%rip),%rdx
mov    $0x0,%al
call   1040 <trio_snprintf@plt>
lea    -0x200(%rbp),%r8
lea    0xcd6(%rip),%rdi
mov    $0x40f,%esi
lea    0xdbc(%rip),%rdx
lea    0xd85(%rip),%rcx
call   1050 <Verify@plt>
mov    %rax,%rcx
movslq -0x208(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x208(%rbp)
lea    -0x200(%rbp),%rdi
mov    $0x200,%esi
lea    0xdae(%rip),%rdx
mov    $0x1f,%ecx
mov    $0x20,%r8d
mov    $0x0,%al
call   1040 <trio_snprintf@plt>
mov    %eax,-0x204(%rbp)
lea    -0x200(%rbp),%rax
mov    %rax,-0x228(%rbp)
xor    %eax,%eax
sub    -0x204(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x21c(%rbp)
mov    -0x204(%rbp),%edi
call   1030 <trio_strerror@plt>
mov    -0x228(%rbp),%rdi
mov    -0x21c(%rbp),%ecx
mov    %eax,%r8d
xor    %r9d,%r9d
sub    -0x204(%rbp),%r9d
sar    $0x8,%r9d
mov    $0x200,%esi
lea    0xc12(%rip),%rdx
mov    $0x0,%al
call   1040 <trio_snprintf@plt>
lea    -0x200(%rbp),%r8
lea    0xc15(%rip),%rdi
mov    $0x425,%esi
lea    0xd2f(%rip),%rdx
lea    0xcc4(%rip),%rcx
call   1050 <Verify@plt>
mov    %rax,%rcx
movslq -0x208(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x208(%rbp)
lea    -0x200(%rbp),%rdi
mov    $0x200,%esi
lea    0xd21(%rip),%rdx
mov    $0x1f,%ecx
mov    $0x20,%r8d
mov    $0x21,%r9d
mov    $0x0,%al
call   1040 <trio_snprintf@plt>
mov    %eax,-0x204(%rbp)
lea    -0x200(%rbp),%rax
mov    %rax,-0x218(%rbp)
xor    %eax,%eax
sub    -0x204(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x20c(%rbp)
mov    -0x204(%rbp),%edi
call   1030 <trio_strerror@plt>
mov    -0x218(%rbp),%rdi
mov    -0x20c(%rbp),%ecx
mov    %eax,%r8d
xor    %r9d,%r9d
sub    -0x204(%rbp),%r9d
sar    $0x8,%r9d
mov    $0x200,%esi
lea    0xb4b(%rip),%rdx
mov    $0x0,%al
call   1040 <trio_snprintf@plt>
lea    -0x200(%rbp),%r8
lea    0xb4e(%rip),%rdi
mov    $0x444,%esi
lea    0xc96(%rip),%rdx
lea    0xbfd(%rip),%rcx
call   1050 <Verify@plt>
mov    %rax,%rcx
movslq -0x208(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x208(%rbp)
mov    -0x208(%rbp),%eax
add    $0x260,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VerifyErrors>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x208,%rsp
lea    0xeb8(%rip),%rdx
lea    0xeb7(%rip),%r8
mov    %rsp,%r13
mov    %r13,%rdi
mov    $0x200,%esi
mov    $0x2a,%ecx
xor    %eax,%eax
call   1040 <trio_snprintf@plt>
mov    %eax,%ebx
neg    %ebx
movzbl %bl,%ebp
mov    %eax,%edi
call   1030 <trio_strerror@plt>
sar    $0x8,%ebx
lea    0xe8d(%rip),%rdx
mov    %r13,%rdi
mov    $0x200,%esi
mov    %ebp,%ecx
mov    %eax,%r8d
mov    %ebx,%r9d
xor    %eax,%eax
call   1040 <trio_snprintf@plt>
lea    0xe87(%rip),%r15
lea    0xf1e(%rip),%rdx
lea    0xf3b(%rip),%r12
mov    %r15,%rdi
mov    $0x3e5,%esi
mov    %r12,%rcx
mov    %r13,%r8
call   1050 <Verify@plt>
mov    %rax,%rbx
lea    0xf21(%rip),%rdx
mov    %r13,%rdi
mov    $0x200,%esi
xor    %eax,%eax
call   1040 <trio_snprintf@plt>
mov    %eax,%ebp
neg    %ebp
movzbl %bpl,%r14d
mov    %eax,%edi
call   1030 <trio_strerror@plt>
sar    $0x8,%ebp
mov    %r13,%rdi
mov    $0x200,%esi
lea    0xe14(%rip),%rdx
mov    %r14d,%ecx
mov    %eax,%r8d
mov    %ebp,%r9d
xor    %eax,%eax
call   1040 <trio_snprintf@plt>
lea    0xedd(%rip),%rdx
mov    %r15,%rdi
mov    $0x3fa,%esi
mov    %r12,%rcx
mov    %r12,%r15
mov    %r13,%r8
call   1050 <Verify@plt>
mov    %rax,%rbp
add    %ebx,%ebp
lea    0xedf(%rip),%rdx
mov    %r13,%rdi
mov    $0x200,%esi
mov    $0x2a,%ecx
xor    %eax,%eax
call   1040 <trio_snprintf@plt>
mov    %eax,%ebx
neg    %ebx
movzbl %bl,%r14d
mov    %eax,%edi
call   1030 <trio_strerror@plt>
sar    $0x8,%ebx
mov    %r13,%rdi
mov    $0x200,%esi
lea    0xda6(%rip),%rdx
mov    %rdx,%r12
mov    %r14d,%ecx
mov    %eax,%r8d
mov    %ebx,%r9d
xor    %eax,%eax
call   1040 <trio_snprintf@plt>
lea    0xe96(%rip),%rdx
lea    0xd9d(%rip),%rdi
mov    $0x40f,%esi
mov    %r15,%rcx
mov    %r13,%r8
call   1050 <Verify@plt>
mov    %rax,%r14
add    %ebp,%r14d
lea    0xe96(%rip),%rdx
mov    %r13,%rdi
mov    $0x200,%esi
mov    $0x1f,%ecx
mov    $0x20,%r8d
xor    %eax,%eax
call   1040 <trio_snprintf@plt>
mov    %eax,%ebp
neg    %ebp
movzbl %bpl,%ebx
mov    %eax,%edi
call   1030 <trio_strerror@plt>
sar    $0x8,%ebp
mov    %r13,%rdi
mov    $0x200,%esi
mov    %r12,%rdx
mov    %ebx,%ecx
mov    %eax,%r8d
mov    %ebp,%r9d
xor    %eax,%eax
call   1040 <trio_snprintf@plt>
lea    0xe59(%rip),%rdx
lea    0xd2c(%rip),%rdi
mov    $0x425,%esi
mov    %r15,%rcx
mov    %r15,%r12
mov    %r13,%r8
call   1050 <Verify@plt>
mov    %rax,%r15
add    %r14d,%r15d
lea    0xe56(%rip),%rdx
mov    %r13,%rdi
mov    $0x200,%esi
mov    $0x1f,%ecx
mov    $0x20,%r8d
mov    $0x21,%r9d
xor    %eax,%eax
call   1040 <trio_snprintf@plt>
mov    %eax,%ebx
neg    %ebx
movzbl %bl,%ebp
mov    %eax,%edi
call   1030 <trio_strerror@plt>
sar    $0x8,%ebx
mov    %r13,%rdi
mov    $0x200,%esi
lea    0xcb4(%rip),%rdx
mov    %ebp,%ecx
mov    %eax,%r8d
mov    %ebx,%r9d
xor    %eax,%eax
call   1040 <trio_snprintf@plt>
lea    0xe0a(%rip),%rdx
lea    0xcaf(%rip),%rdi
mov    $0x444,%esi
mov    %r12,%rcx
mov    %r13,%r8
call   1050 <Verify@plt>
add    %r15d,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %r\00"
@.str.1 = [5 x i8] c"text\00"
@.str.2 = [24 x i8] c"Err = %d (%s), Pos = %d\00"
@.str.3 = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hypermail-project/hypermail/refs/heads/master/src/trio/regression.c\00"
@.str.4 = [36 x i8] c"Err = 2 (Invalid argument), Pos = 5\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [3 x i8] c"%#\00"
@.str.7 = [36 x i8] c"Err = 2 (Invalid argument), Pos = 3\00"
@.str.8 = [6 x i8] c"%hhhd\00"
@.str.9 = [36 x i8] c"Err = 2 (Invalid argument), Pos = 4\00"
@.str.10 = [16 x i8] c"hello %1$d %1$d\00"
@.str.11 = [36 x i8] c"Err = 4 (Double reference), Pos = 0\00"
@.str.12 = [10 x i8] c"%3$d %1$d\00"
@.str.13 = [33 x i8] c"Err = 5 (Reference gap), Pos = 1\00"
define i32 @VerifyErrors() {
%1 = alloca [512 x i8]
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %3
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%5 = call i32 (i8*, i32, i8*, ...) @trio_snprintf(i8* %4, i32 512, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 %5, i32* %2
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%7 = load i32, i32* %2
%8 = sub nsw i32 0, %7
%9 = and i32 %8, 255
%10 = load i32, i32* %2
%11 = call i32 @trio_strerror(i32 %10)
%12 = load i32, i32* %2
%13 = sub nsw i32 0, %12
%14 = ashr i32 %13, 8
%15 = call i32 (i8*, i32, i8*, ...) @trio_snprintf(i8* %6, i32 512, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %11, i32 %14)
%16 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%17 = call i64 @Verify(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.3, i64 0, i64 0), i32 997, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %16)
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = add nsw i64 %19, %17
%21 = trunc i64 %20 to i32
store i32 %21, i32* %3
%22 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%23 = call i32 (i8*, i32, i8*, ...) @trio_snprintf(i8* %22, i32 512, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
store i32 %23, i32* %2
%24 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%25 = load i32, i32* %2
%26 = sub nsw i32 0, %25
%27 = and i32 %26, 255
%28 = load i32, i32* %2
%29 = call i32 @trio_strerror(i32 %28)
%30 = load i32, i32* %2
%31 = sub nsw i32 0, %30
%32 = ashr i32 %31, 8
%33 = call i32 (i8*, i32, i8*, ...) @trio_snprintf(i8* %24, i32 512, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %27, i32 %29, i32 %32)
%34 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%35 = call i64 @Verify(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.3, i64 0, i64 0), i32 1018, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %34)
%36 = load i32, i32* %3
%37 = sext i32 %36 to i64
%38 = add nsw i64 %37, %35
%39 = trunc i64 %38 to i32
store i32 %39, i32* %3
%40 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%41 = call i32 (i8*, i32, i8*, ...) @trio_snprintf(i8* %40, i32 512, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32 42)
store i32 %41, i32* %2
%42 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%43 = load i32, i32* %2
%44 = sub nsw i32 0, %43
%45 = and i32 %44, 255
%46 = load i32, i32* %2
%47 = call i32 @trio_strerror(i32 %46)
%48 = load i32, i32* %2
%49 = sub nsw i32 0, %48
%50 = ashr i32 %49, 8
%51 = call i32 (i8*, i32, i8*, ...) @trio_snprintf(i8* %42, i32 512, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %45, i32 %47, i32 %50)
%52 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%53 = call i64 @Verify(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.3, i64 0, i64 0), i32 1039, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %52)
%54 = load i32, i32* %3
%55 = sext i32 %54 to i64
%56 = add nsw i64 %55, %53
%57 = trunc i64 %56 to i32
store i32 %57, i32* %3
%58 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%59 = call i32 (i8*, i32, i8*, ...) @trio_snprintf(i8* %58, i32 512, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 31, i32 32)
store i32 %59, i32* %2
%60 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%61 = load i32, i32* %2
%62 = sub nsw i32 0, %61
%63 = and i32 %62, 255
%64 = load i32, i32* %2
%65 = call i32 @trio_strerror(i32 %64)
%66 = load i32, i32* %2
%67 = sub nsw i32 0, %66
%68 = ashr i32 %67, 8
%69 = call i32 (i8*, i32, i8*, ...) @trio_snprintf(i8* %60, i32 512, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %63, i32 %65, i32 %68)
%70 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%71 = call i64 @Verify(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.3, i64 0, i64 0), i32 1061, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %70)
%72 = load i32, i32* %3
%73 = sext i32 %72 to i64
%74 = add nsw i64 %73, %71
%75 = trunc i64 %74 to i32
store i32 %75, i32* %3
%76 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%77 = call i32 (i8*, i32, i8*, ...) @trio_snprintf(i8* %76, i32 512, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 31, i32 32, i32 33)
store i32 %77, i32* %2
%78 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%79 = load i32, i32* %2
%80 = sub nsw i32 0, %79
%81 = and i32 %80, 255
%82 = load i32, i32* %2
%83 = call i32 @trio_strerror(i32 %82)
%84 = load i32, i32* %2
%85 = sub nsw i32 0, %84
%86 = ashr i32 %85, 8
%87 = call i32 (i8*, i32, i8*, ...) @trio_snprintf(i8* %78, i32 512, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %81, i32 %83, i32 %86)
%88 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%89 = call i64 @Verify(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.3, i64 0, i64 0), i32 1092, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %88)
%90 = load i32, i32* %3
%91 = sext i32 %90 to i64
%92 = add nsw i64 %91, %89
%93 = trunc i64 %92 to i32
store i32 %93, i32* %3
%94 = load i32, i32* %3
ret i32 %94
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %r\00"
@.str.1 = [5 x i8] c"text\00"
@.str.2 = [24 x i8] c"Err = %d (%s), Pos = %d\00"
@.str.3 = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hypermail-project/hypermail/refs/heads/master/src/trio/regression.c\00"
@.str.4 = [36 x i8] c"Err = 2 (Invalid argument), Pos = 5\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [3 x i8] c"%#\00"
@.str.7 = [36 x i8] c"Err = 2 (Invalid argument), Pos = 3\00"
@.str.8 = [6 x i8] c"%hhhd\00"
@.str.9 = [36 x i8] c"Err = 2 (Invalid argument), Pos = 4\00"
@.str.10 = [16 x i8] c"hello %1$d %1$d\00"
@.str.11 = [36 x i8] c"Err = 4 (Double reference), Pos = 0\00"
@.str.12 = [10 x i8] c"%3$d %1$d\00"
@.str.13 = [33 x i8] c"Err = 5 (Reference gap), Pos = 1\00"
define i32 @VerifyErrors() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, i32, i8*, ...) @trio_snprintf(i8* %2, i32 512, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = sub nsw i32 0, %3
%5 = and i32 %4, 255
%6 = call i32 @trio_strerror(i32 %3)
%7 = ashr i32 %4, 8
%8 = call i32 (i8*, i32, i8*, ...) @trio_snprintf(i8* %2, i32 512, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6, i32 %7)
%9 = call i64 @Verify(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.3, i64 0, i64 0), i32 997, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %2)
%10 = call i32 (i8*, i32, i8*, ...) @trio_snprintf(i8* %2, i32 512, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%11 = sub nsw i32 0, %10
%12 = and i32 %11, 255
%13 = call i32 @trio_strerror(i32 %10)
%14 = ashr i32 %11, 8
%15 = call i32 (i8*, i32, i8*, ...) @trio_snprintf(i8* %2, i32 512, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %12, i32 %13, i32 %14)
%16 = call i64 @Verify(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.3, i64 0, i64 0), i32 1018, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %2)
%17 = add i64 %16, %9
%18 = call i32 (i8*, i32, i8*, ...) @trio_snprintf(i8* %2, i32 512, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32 42)
%19 = sub nsw i32 0, %18
%20 = and i32 %19, 255
%21 = call i32 @trio_strerror(i32 %18)
%22 = ashr i32 %19, 8
%23 = call i32 (i8*, i32, i8*, ...) @trio_snprintf(i8* %2, i32 512, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %20, i32 %21, i32 %22)
%24 = call i64 @Verify(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.3, i64 0, i64 0), i32 1039, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %2)
%25 = add i64 %17, %24
%26 = call i32 (i8*, i32, i8*, ...) @trio_snprintf(i8* %2, i32 512, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 31, i32 32)
%27 = sub nsw i32 0, %26
%28 = and i32 %27, 255
%29 = call i32 @trio_strerror(i32 %26)
%30 = ashr i32 %27, 8
%31 = call i32 (i8*, i32, i8*, ...) @trio_snprintf(i8* %2, i32 512, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %28, i32 %29, i32 %30)
%32 = call i64 @Verify(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.3, i64 0, i64 0), i32 1061, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %2)
%33 = add i64 %25, %32
%34 = call i32 (i8*, i32, i8*, ...) @trio_snprintf(i8* %2, i32 512, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 31, i32 32, i32 33)
%35 = sub nsw i32 0, %34
%36 = and i32 %35, 255
%37 = call i32 @trio_strerror(i32 %34)
%38 = ashr i32 %35, 8
%39 = call i32 (i8*, i32, i8*, ...) @trio_snprintf(i8* %2, i32 512, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %36, i32 %37, i32 %38)
%40 = call i64 @Verify(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.3, i64 0, i64 0), i32 1092, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %2)
%41 = add i64 %33, %40
%42 = trunc i64 %41 to i32
ret i32 %42
}