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

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, char const *, ...);
int rundiff(char const *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *);
int /*<<< orphan*/ stdout;
int system(char *);
int runtest(const char *binname, const char *testname, int testno) {
  char cmdline[1024];
  int rc;
  int ret;
  int diff;
  snprintf(cmdline, sizeof(cmdline),
           "ODBCSYSINI=. ODBCINSTINI=./odbcinst.ini ODBCINI=./odbc.ini "
           "%s > results/%s.out",
           binname, testname);
  rc = system(cmdline);
  diff = rundiff(testname);
  if (rc != 0) {
    printf("not ok %d - %s test returned %d\n", testno, testname, rc);
    ret = 1;
  } else if (diff != 0) {
    printf("not ok %d - %s test output differs\n", testno, testname);
    ret = 1;
  } else {
    printf("ok %d - %s\n", testno, testname);
    ret = 0;
  }
  fflush(stdout);
  return ret;
}


x86 assembly (clang, -O0):
<runtest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    $0x400,%esi
lea    0xe7f(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x420(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,-0x424(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <rundiff@plt>
mov    %eax,-0x42c(%rbp)
cmpl   $0x0,-0x424(%rbp)
je     11de <runtest+0x8e>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x424(%rbp),%ecx
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x428(%rbp)
jmp    1233 <runtest+0xe3>
cmpl   $0x0,-0x42c(%rbp)
je     120f <runtest+0xbf>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x428(%rbp)
jmp    122e <runtest+0xde>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x428(%rbp)
jmp    1233 <runtest+0xe3>
mov    0x2da6(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    -0x428(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runtest>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rcx
lea    0xe95(%rip),%rdx
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    $0x400,%esi
mov    %rbx,%r8
call   1050 <snprintf@plt>
mov    %rbp,%rdi
call   1030 <system@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1070 <rundiff@plt>
test   %ebp,%ebp
je     11b1 <runtest+0x61>
lea    0xeb4(%rip),%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%ebp
jmp    11e6 <runtest+0x96>
test   %eax,%eax
je     11d0 <runtest+0x80>
lea    0xeb4(%rip),%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%ebp
jmp    11e6 <runtest+0x96>
lea    0xebd(%rip),%rdi
xor    %ebp,%ebp
mov    %r14d,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2df3(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    %ebp,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [79 x i8] c"ODBCSYSINI=. ODBCINSTINI=./odbcinst.ini ODBCINI=./odbc.ini %s > results/%s.out\00"
@.str.1 = [33 x i8] c"not ok %d - %s test returned %d\0A\00"
@.str.2 = [36 x i8] c"not ok %d - %s test output differs\0A\00"
@.str.3 = [12 x i8] c"ok %d - %s\0A\00"
@stdout = global i32 0
define i32 @runtest(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [1024 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = call i32 @snprintf(i8* %11, i32 1024, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%16 = call i32 @system(i8* %15)
store i32 %16, i32* %8
%17 = load i8*, i8** %5
%18 = call i32 @rundiff(i8* %17)
store i32 %18, i32* %10
%19 = load i32, i32* %8
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %3
%22 = load i32, i32* %6
%23 = load i8*, i8** %5
%24 = load i32, i32* %8
%25 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %22, i8* %23, i32 %24)
store i32 1, i32* %9
br label %38
26: ; preds = %3
%27 = load i32, i32* %10
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %33
29: ; preds = %26
%30 = load i32, i32* %6
%31 = load i8*, i8** %5
%32 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %30, i8* %31)
store i32 1, i32* %9
br label %37
33: ; preds = %26
%34 = load i32, i32* %6
%35 = load i8*, i8** %5
%36 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %34, i8* %35)
store i32 0, i32* %9
br label %37
37: ; preds = %33, %29
br label %38
38: ; preds = %37, %21
%39 = load i32, i32* @stdout
%40 = call i32 @fflush(i32 %39)
%41 = load i32, i32* %9
ret i32 %41
}

LLVM IR (-O2):
@.str = [79 x i8] c"ODBCSYSINI=. ODBCINSTINI=./odbcinst.ini ODBCINI=./odbc.ini %s > results/%s.out\00"
@.str.1 = [33 x i8] c"not ok %d - %s test returned %d\0A\00"
@.str.2 = [36 x i8] c"not ok %d - %s test output differs\0A\00"
@.str.3 = [12 x i8] c"ok %d - %s\0A\00"
@stdout = global i32 0
define i32 @runtest(i8* %0, i8* %1, i32 %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 1024, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%7 = call i32 @system(i8* %5)
%8 = call i32 @rundiff(i8* %1)
%9 = icmp eq i32 %7, 0
br i1 %9, label %12, label %10
10: ; preds = %3
%11 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %2, i8* %1, i32 %7)
br label %18
12: ; preds = %3
%13 = icmp eq i32 %8, 0
br i1 %13, label %16, label %14
14: ; preds = %12
%15 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %2, i8* %1)
br label %18
16: ; preds = %12
%17 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %2, i8* %1)
br label %18
18: ; preds = %14, %16, %10
%19 = phi i32 [ 1, %10 ], [ 1, %14 ], [ 0, %16 ]
%20 = load i32, i32* @stdout
%21 = call i32 @fflush(i32 %20)
ret i32 %19
}