xunge/DecIR huggingface dataset:
/* Type definitions */
struct grid_epbase {
  int dummy;
};

/* Variables and functions */
int grid_ctcp_create(void *, struct grid_epbase **);
int grid_tcp_connect(void *hint, struct grid_epbase **epbase) {
  return grid_ctcp_create(hint, epbase);
}


x86 assembly (clang, -O0):
<grid_tcp_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <grid_ctcp_create@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grid_tcp_connect>:
jmp    1030 <grid_ctcp_create@plt>

LLVM IR (-O0):
%struct.grid_epbase = type { i32 }
define i32 @grid_tcp_connect(i8* %0, %struct.grid_epbase** %1) {
%3 = alloca i8*
%4 = alloca %struct.grid_epbase**
store i8* %0, i8** %3
store %struct.grid_epbase** %1, %struct.grid_epbase*** %4
%5 = load i8*, i8** %3
%6 = load %struct.grid_epbase**, %struct.grid_epbase*** %4
%7 = call i32 @grid_ctcp_create(i8* %5, %struct.grid_epbase** %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.grid_epbase = type { i32 }
define i32 @grid_tcp_connect(i8* %0, %struct.grid_epbase** %1) {
%3 = tail call i32 @grid_ctcp_create(i8* %0, %struct.grid_epbase** %1)
ret i32 %3
}
double abst(double x) {
  if (x < 0)
    return (x * (-1));
  else
    return (x);
}


x86 assembly (clang, -O0):
<abst>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112e <abst+0x2e>
movsd  0xee1(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1138 <abst+0x38>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abst>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @abst(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fmul double %7, -1.000000e+00
store double %8, double* %2
br label %11
9: ; preds = %1
%10 = load double, double* %3
store double %10, double* %2
br label %11
11: ; preds = %9, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @abst(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Type definitions */
struct i2c {
  int dummy;
};

/* Variables and functions */
long setByte(struct i2c *, int, int, int /*<<< orphan*/);
long resetKey(struct i2c *i2c, int key) {
  return setByte(i2c, 0x69, 0x09 + key, 0);
}


x86 assembly (clang, -O0):
<resetKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
add    $0x9,%edx
mov    $0x69,%esi
xor    %ecx,%ecx
call   1030 <setByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resetKey>:
lea    0x9(%rsi),%edx
mov    $0x69,%esi
xor    %ecx,%ecx
jmp    1030 <setByte@plt>

LLVM IR (-O0):
%struct.i2c = type { i32 }
define i64 @resetKey(%struct.i2c* %0, i32 %1) {
%3 = alloca %struct.i2c*
%4 = alloca i32
store %struct.i2c* %0, %struct.i2c** %3
store i32 %1, i32* %4
%5 = load %struct.i2c*, %struct.i2c** %3
%6 = load i32, i32* %4
%7 = add nsw i32 9, %6
%8 = call i64 @setByte(%struct.i2c* %5, i32 105, i32 %7, i32 0)
ret i64 %8
}

LLVM IR (-O2):
%struct.i2c = type { i32 }
define i64 @resetKey(%struct.i2c* %0, i32 %1) {
%3 = add nsw i32 %1, 9
%4 = tail call i64 @setByte(%struct.i2c* %0, i32 105, i32 %3, i32 0)
ret i64 %4
}
/* Type definitions */
struct timeval {
  long long tv_sec;
  long long tv_usec;
};
typedef scalar_t__ s;

/* Variables and functions */
double sub_time(struct timeval t1, struct timeval t2) {
  long long int s = t1.tv_sec - t2.tv_sec;
  long long int u = t1.tv_usec - t2.tv_usec;
  return (double)(s) + ((double)(u)) * 1e-6;
}


x86 assembly (clang, -O0):
<sub_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
cvtsi2sdq -0x28(%rbp),%xmm1
cvtsi2sdq -0x30(%rbp),%xmm0
movsd  0xec0(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_time>:
sub    %rdx,%rdi
sub    %rcx,%rsi
cvtsi2sd %rdi,%xmm1
cvtsi2sd %rsi,%xmm0
mulsd  0xee8(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @sub_time(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = alloca i64
%8 = alloca i64
%9 = bitcast %struct.timeval* %5 to { i64, i64 }*
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %9, i32 0, i32 0
store i64 %0, i64* %10
%11 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %9, i32 0, i32 1
store i64 %1, i64* %11
%12 = bitcast %struct.timeval* %6 to { i64, i64 }*
%13 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %12, i32 0, i32 0
store i64 %2, i64* %13
%14 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %12, i32 0, i32 1
store i64 %3, i64* %14
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%16 = load i64, i64* %15
%17 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%18 = load i64, i64* %17
%19 = sub nsw i64 %16, %18
store i64 %19, i64* %7
%20 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%21 = load i64, i64* %20
%22 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%23 = load i64, i64* %22
%24 = sub nsw i64 %21, %23
store i64 %24, i64* %8
%25 = load i64, i64* %7
%26 = sitofp i64 %25 to double
%27 = load i64, i64* %8
%28 = sitofp i64 %27 to double
%29 = call double @llvm.fmuladd.f64(double %28, double 0x3EB0C6F7A0B5ED8D, double %26)
ret double %29
}

LLVM IR (-O2):
define double @sub_time(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = sub nsw i64 %0, %2
%6 = sub nsw i64 %1, %3
%7 = sitofp i64 %5 to double
%8 = sitofp i64 %6 to double
%9 = tail call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %7)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int);
int /*<<< orphan*/ print(char *);
void testmain() {
  print("scope");
  int a = 31;
  { int a = 64; }
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/"
          "scope.c",
          10, 31, a);
  ;
  {
    int a = 64;
    fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/"
            "scope.c",
            13, 64, a);
    ;
  }
}


x86 assembly (clang, -O0):
<testmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <print@plt>
movl   $0x1f,-0x4(%rbp)
movl   $0x40,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xeba(%rip),%rdi
mov    $0xa,%esi
mov    $0x1f,%edx
call   1040 <fexpect@plt>
movl   $0x40,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
lea    0xe9a(%rip),%rdi
mov    $0xd,%esi
mov    $0x40,%edx
call   1040 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testmain>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <print@plt>
lea    0xed2(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x1f,%edx
mov    $0x1f,%ecx
call   1040 <fexpect@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
mov    $0x40,%edx
mov    $0x40,%ecx
pop    %rbx
jmp    1040 <fexpect@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"scope\00"
@.str.1 = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/scope.c\00"
define void @testmain() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @print(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 31, i32* %1
store i32 64, i32* %2
%5 = load i32, i32* %1
%6 = call i32 @fexpect(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 31, i32 %5)
store i32 64, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @fexpect(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0), i32 13, i32 64, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"scope\00"
@.str.1 = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/scope.c\00"
define void @testmain() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @fexpect(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 31, i32 31)
%3 = tail call i32 @fexpect(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0), i32 13, i32 64, i32 64)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Sys_Error(char *);
long read(int, void *, long);
void SafeRead(int handle, void *buffer, long count) {
  if (read(handle, buffer, count) != count)
    Sys_Error("File read failure");
}


x86 assembly (clang, -O0):
<SafeRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <read@plt>
cmp    -0x18(%rbp),%rax
je     1159 <SafeRead+0x39>
lea    0xeac(%rip),%rdi
call   1030 <Sys_Error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SafeRead>:
push   %rbx
mov    %rdx,%rbx
call   1040 <read@plt>
cmp    %rbx,%rax
jne    1130 <SafeRead+0x10>
pop    %rbx
ret
lea    0xec9(%rip),%rdi
pop    %rbx
jmp    1030 <Sys_Error@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"File read failure\00"
define void @SafeRead(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i64 @read(i32 %7, i8* %8, i64 %9)
%11 = load i64, i64* %6
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @Sys_Error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"File read failure\00"
define void @SafeRead(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @read(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, %2
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @Sys_Error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open_or_die(char const *, int /*<<< orphan*/);
int read_or_die(int, void *, size_t);
int read_blob_or_die(const char *file, void *blob, size_t count) {
  int fd, ret;
  fd = open_or_die(file, O_RDONLY);
  ret = read_or_die(fd, blob, count);
  close(fd);
  return ret;
}


x86 assembly (clang, -O0):
<read_blob_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1040 <open_or_die@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <read_or_die@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <close@plt>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_blob_or_die>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
call   1040 <open_or_die@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <read_or_die@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1030 <close@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define i32 @read_blob_or_die(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i8*, i8** %4
%10 = load i32, i32* @O_RDONLY
%11 = call i32 @open_or_die(i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i8*, i8** %5
%14 = load i64, i64* %6
%15 = call i32 @read_or_die(i32 %12, i8* %13, i64 %14)
store i32 %15, i32* %8
%16 = load i32, i32* %7
%17 = call i32 @close(i32 %16)
%18 = load i32, i32* %8
ret i32 %18
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i32 @read_blob_or_die(i8* %0, i8* %1, i64 %2) {
%4 = load i32, i32* @O_RDONLY
%5 = tail call i32 @open_or_die(i8* %0, i32 %4)
%6 = tail call i32 @read_or_die(i32 %5, i8* %1, i64 %2)
%7 = tail call i32 @close(i32 %5)
ret i32 %6
}
unsigned short int unsignedshortint_ignoring_longlong(unsigned short int x,
                                                      long long y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshortint_ignoring_longlong>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedshortint_ignoring_longlong>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @unsignedshortint_ignoring_longlong(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @unsignedshortint_ignoring_longlong(i16 returned zeroext %0, i64 %1) {
ret i16 %0
}
extern int mmx_ok(void) {
  register int ok = 0;
  __asm__ __volatile__("movl $1, %%eax\n\t"
                       "cpuid\n\t"
                       "movl %%edx, %0"
                       : "=a"(ok)
                       :);
  return ((ok & 0x800000) == 0x800000);
}


x86 assembly (clang, -O0):
<mmx_ok>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
cpuid
mov    %edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x800000,%eax
cmp    $0x800000,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmx_ok>:
mov    $0x1,%eax
cpuid
mov    %edx,%eax
shr    $0x17,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @mmx_ok() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 asm sideeffect "movl $$1, %eax\0A\09cpuid\0A\09movl %edx, $0", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, 8388608
%5 = icmp eq i32 %4, 8388608
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @mmx_ok() {
%1 = tail call i32 asm sideeffect "movl $$1, %eax\0A\09cpuid\0A\09movl %edx, $0", "={ax},~{dirflag},~{fpsr},~{flags}"()
%2 = lshr i32 %1, 23
%3 = and i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int nls_main(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) { return nls_main(stdin, stdout, stderr); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
call   1030 <nls_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
jmp    1030 <nls_main@plt>

LLVM IR (-O0):
@stdin = global i32 0
@stdout = global i32 0
@stderr = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @stdin
%7 = load i32, i32* @stdout
%8 = load i32, i32* @stderr
%9 = call i32 @nls_main(i32 %6, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@stdin = global i32 0
@stdout = global i32 0
@stderr = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdin
%4 = load i32, i32* @stdout
%5 = load i32, i32* @stderr
%6 = tail call i32 @nls_main(i32 %3, i32 %4, i32 %5)
ret i32 %6
}
int RAGetDelayHermite(void *inst) { return 2; }


x86 assembly (clang, -O0):
<RAGetDelayHermite>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RAGetDelayHermite>:
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @RAGetDelayHermite(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 2
}

LLVM IR (-O2):
define i32 @RAGetDelayHermite(i8* nocapture readnone %0) {
ret i32 2
}
extern void gui_ksys_set_keyboard_input_mode(int mode) {
  __asm__ __volatile__("int $0x40" : : "a"(66), "b"(1), "c"(mode));
}


x86 assembly (clang, -O0):
<gui_ksys_set_keyboard_input_mode>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x42,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_ksys_set_keyboard_input_mode>:
push   %rbx
mov    %edi,%ecx
mov    $0x42,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define void @gui_ksys_set_keyboard_input_mode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
ret void
}

LLVM IR (-O2):
define void @gui_ksys_set_keyboard_input_mode(i32 %0) {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 66, i32 1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
char *strdup(char const *);
char *xstrdup(const char *in) {
  char *out = strdup(in);
  if (!out) {
    abort();
  }
  return out;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xstrdup+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rax
call   1040 <strdup@plt>
test   %rax,%rax
je     112d <xstrdup+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ f(unsigned int);
int /*<<< orphan*/ printf(char *);
int main() {
  if (f((~0U) >> 1)) {
    printf("failed\n");
    abort();
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7fffffff,%edi
call   1040 <f@plt>
cmp    $0x0,%rax
je     1176 <main+0x36>
lea    0xe96(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7fffffff,%edi
call   1050 <f@plt>
test   %rax,%rax
jne    1157 <main+0x17>
xor    %edi,%edi
call   1060 <exit@plt>
lea    0xea2(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"failed\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @f(i32 2147483647)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [7 x i8] c"failed\00"
define i32 @main() {
%1 = tail call i64 @f(i32 2147483647)
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int i2c_smbus_read_byte_data(int, int);
int wiringPiI2CReadReg8(int fd, int reg) {
  return i2c_smbus_read_byte_data(fd, reg);
}


x86 assembly (clang, -O0):
<wiringPiI2CReadReg8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <i2c_smbus_read_byte_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wiringPiI2CReadReg8>:
jmp    1030 <i2c_smbus_read_byte_data@plt>

LLVM IR (-O0):
define i32 @wiringPiI2CReadReg8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @i2c_smbus_read_byte_data(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @wiringPiI2CReadReg8(i32 %0, i32 %1) {
%3 = tail call i32 @i2c_smbus_read_byte_data(i32 %0, i32 %1)
ret i32 %3
}
void dostr(str) char *str;
{
  while (*str)
    dopr_outch(*str++);
}


x86 assembly (clang, -O0):
<dostr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <dostr+0x37>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <dopr_outch@plt>
jmp    111c <dostr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dostr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1135 <dostr+0x25>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
xor    %eax,%eax
call   1030 <dopr_outch@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <dostr+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @dostr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 (i32, ...) bitcast (i32 (...)* @dopr_outch to i32 (i32, ...)*)(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @dostr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @dopr_outch to i32 (i32, ...)*)(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
void ft_bzero(void *s, size_t n) {
  size_t i;
  i = 0;
  while (i < n) {
    ((char *)s)[i] = 0;
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_bzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    113f <ft_bzero+0x3f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <ft_bzero+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_bzero>:
test   %rsi,%rsi
je     1124 <ft_bzero+0x14>
push   %rax
mov    %rsi,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @ft_bzero(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %10, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i8, i8* %11, i64 %12
store i8 0, i8* %13
%14 = load i64, i64* %5
%15 = add i64 %14, 1
store i64 %15, i64* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @ft_bzero(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %2
br label %5
5: ; preds = %4, %2
ret void
}
/* Type definitions */
struct tftpx_request {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handle_list(int sock, struct tftpx_request *request) {
  (void)sock;
  (void)request;
  printf("list not support");
}


x86 assembly (clang, -O0):
<handle_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_list>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.tftpx_request = type { i32 }
@.str = [17 x i8] c"list not support\00"
define void @handle_list(i32 %0, %struct.tftpx_request* %1) {
%3 = alloca i32
%4 = alloca %struct.tftpx_request*
store i32 %0, i32* %3
store %struct.tftpx_request* %1, %struct.tftpx_request** %4
%5 = load i32, i32* %3
%6 = load %struct.tftpx_request*, %struct.tftpx_request** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.tftpx_request = type { i32 }
@.str = [17 x i8] c"list not support\00"
define void @handle_list(i32 %0, %struct.tftpx_request* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
void msg_trace_empty(const char *name, ...) { return; }


x86 assembly (clang, -O0):
<msg_trace_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_trace_empty>:
ret

LLVM IR (-O0):
define void @msg_trace_empty(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @msg_trace_empty(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int f2(int);
int f1(int a, int b) { return f2(a) + b; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <f2@plt>
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rbx
mov    %esi,%ebx
call   1030 <f2@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @f2(i32 %5)
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = tail call i32 @f2(i32 %0)
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x14() {
  Assert_real((isupper(20) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              105, ("isupper should be 0 for 0x14"));
}


x86 assembly (clang, -O0):
<t_isupper_0x14>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x69,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x14>:
push   %rax
mov    $0x14,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x69,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x14\00"
define void @t_isupper_0x14() {
%1 = call i64 @isupper(i32 20)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 105, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x14\00"
define void @t_isupper_0x14() {
%1 = tail call i64 @isupper(i32 20)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 105, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ read(int /*<<< orphan*/, unsigned char *, int);
unsigned char kb_getc(void) {
  unsigned char ch;
  ssize_t size;
  size = read(0, &ch, 1);
  if (size == 0) {
    return 0;
  } else {
    return ch;
  }
}


x86 assembly (clang, -O0):
<kb_getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x2(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1140 <kb_getc+0x30>
movb   $0x0,-0x1(%rbp)
jmp    1146 <kb_getc+0x36>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kb_getc>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
lea    0xf(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
test   %rax,%rax
movzbl 0xf(%rsp),%eax
cmove  %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @kb_getc() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i64
%4 = call i64 @read(i32 0, i8* %2, i32 1)
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i8 0, i8* %1
br label %10
8: ; preds = %0
%9 = load i8, i8* %2
store i8 %9, i8* %1
br label %10
10: ; preds = %8, %7
%11 = load i8, i8* %1
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @kb_getc() {
%1 = alloca i8
%2 = call i64 @read(i32 0, i8* %1, i32 1)
%3 = icmp eq i64 %2, 0
%4 = load i8, i8* %1
%5 = select i1 %3, i8 0, i8 %4
ret i8 %5
}
/* Variables and functions */
bool check_int_range(int i, int b) {
  int x = 1 << (b - 1);
  return -x <= i && i < x;
}


x86 assembly (clang, -O0):
<check_int_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0xd(%rbp)
jg     1139 <check_int_range+0x39>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_int_range>:
lea    -0x1(%rsi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
neg    %ecx
cmp    %edi,%ecx
setle  %cl
cmp    %edi,%eax
setg   %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @check_int_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = shl i32 1, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = sub nsw i32 0, %9
%11 = load i32, i32* %3
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = icmp slt i32 %14, %15
br label %17
17: ; preds = %13, %2
%18 = phi i1 [ false, %2 ], [ %16, %13 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @check_int_range(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = shl nuw i32 1, %3
%5 = sub nsw i32 0, %4
%6 = icmp sle i32 %5, %0
%7 = icmp sgt i32 %4, %0
%8 = and i1 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
scalar_t__ run_test(int);
void *run_thread_test(void *args) {
  return (void *)(long)run_test(*(int *)args);
}


x86 assembly (clang, -O0):
<run_thread_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <run_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_thread_test>:
mov    (%rdi),%edi
jmp    1030 <run_test@plt>

LLVM IR (-O0):
define i8* @run_thread_test(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = call i64 @run_test(i32 %5)
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @run_thread_test(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i64 @run_test(i32 %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
unsigned kol_event_wait() { asm volatile("int $0x40" ::"a"(10)); }


x86 assembly (clang, -O0):
<kol_event_wait>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%eax
int    $0x40
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_event_wait>:
mov    $0xa,%eax
int    $0x40
ret

LLVM IR (-O0):
define i32 @kol_event_wait() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @kol_event_wait() {
tail call void asm sideeffect "int $$0x40", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 10)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void pcomp_version(int *major, int *minor) {
  if (major == NULL || minor == NULL)
    abort();
  *major = 1;
  *minor = 0;
}


x86 assembly (clang, -O0):
<pcomp_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1136 <pcomp_version+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    113d <pcomp_version+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcomp_version>:
push   %rax
test   %rdi,%rdi
je     1129 <pcomp_version+0x19>
test   %rsi,%rsi
je     1129 <pcomp_version+0x19>
movl   $0x1,(%rdi)
movl   $0x0,(%rsi)
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @pcomp_version(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = icmp eq i32* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32*, i32** %4
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %7, %2
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %7
%13 = load i32*, i32** %3
store i32 1, i32* %13
%14 = load i32*, i32** %4
store i32 0, i32* %14
ret void
}

LLVM IR (-O2):
define void @pcomp_version(i32* writeonly %0, i32* writeonly %1) {
%3 = icmp eq i32* %0, null
%4 = icmp eq i32* %1, null
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
store i32 1, i32* %0
store i32 0, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pci_read_config_dword(int /*<<< orphan*/, unsigned char,
                                         unsigned char, int, unsigned int *);
int /*<<< orphan*/ pci_write_config_dword(int /*<<< orphan*/, unsigned char,
                                          unsigned char, int, unsigned int);
void pci_mem_enable(unsigned char bus, unsigned char slot,
                    unsigned char function) {
  unsigned int data;
  pci_read_config_dword(0, slot, function, 0x04, &data);
  pci_write_config_dword(0, slot, function, 0x04, data | 0x2);
}


x86 assembly (clang, -O0):
<pci_mem_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%al
xor    %edi,%edi
mov    $0x4,%ecx
lea    -0x8(%rbp),%r8
movzbl %al,%esi
movzbl -0x3(%rbp),%edx
call   1030 <pci_read_config_dword@plt>
mov    -0x2(%rbp),%dl
mov    -0x3(%rbp),%al
mov    -0x8(%rbp),%r8d
or     $0x2,%r8d
xor    %edi,%edi
mov    $0x4,%ecx
movzbl %dl,%esi
movzbl %al,%edx
call   1040 <pci_write_config_dword@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_mem_enable>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
lea    0x4(%rsp),%r8
xor    %edi,%edi
mov    $0x4,%ecx
call   1030 <pci_read_config_dword@plt>
mov    0x4(%rsp),%r8d
or     $0x2,%r8d
xor    %edi,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    $0x4,%ecx
call   1040 <pci_write_config_dword@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @pci_mem_enable(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i32
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8, i8* %5
%9 = load i8, i8* %6
%10 = call i32 @pci_read_config_dword(i32 0, i8 zeroext %8, i8 zeroext %9, i32 4, i32* %7)
%11 = load i8, i8* %5
%12 = load i8, i8* %6
%13 = load i32, i32* %7
%14 = or i32 %13, 2
%15 = call i32 @pci_write_config_dword(i32 0, i8 zeroext %11, i8 zeroext %12, i32 4, i32 %14)
ret void
}

LLVM IR (-O2):
define void @pci_mem_enable(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @pci_read_config_dword(i32 0, i8 zeroext %1, i8 zeroext %2, i32 4, i32* %4)
%7 = load i32, i32* %4
%8 = or i32 %7, 2
%9 = call i32 @pci_write_config_dword(i32 0, i8 zeroext %1, i8 zeroext %2, i32 4, i32 %8)
ret void
}
void foo_2_2_2_2_1_1_2_2_2() {}


x86 assembly (clang, -O0):
<foo_2_2_2_2_1_1_2_2_2>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_2_2_2_2_1_1_2_2_2>:
ret

LLVM IR (-O0):
define void @foo_2_2_2_2_1_1_2_2_2() {
ret void
}

LLVM IR (-O2):
define void @foo_2_2_2_2_1_1_2_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void help(char *addr) {
  printf("chatter ver.0.1\n");
  printf("====================================\n");
  printf("usage : %s [ip] [port] [user name]\n", addr);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    %rdi,%rbx
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"chatter ver.0.1\0A\00"
@.str.1 = [38 x i8] c"====================================\0A\00"
@.str.2 = [36 x i8] c"usage : %s [ip] [port] [user name]\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str.2 = [36 x i8] c"usage : %s [ip] [port] [user name]\0A\00"
@str = [16 x i8] c"chatter ver.0.1\00"
@str.3 = [37 x i8] c"====================================\00"
define void @help(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
int main(void) {
  int a = 0;
  switch (a) {
  case 0:
    break;
  case 1:
    a = 1;
    break;
  default:
    a = 4;
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1136 <main+0x36>
jmp    1125 <main+0x25>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     113b <main+0x3b>
jmp    1147 <main+0x47>
jmp    114e <main+0x4e>
movl   $0x1,-0x8(%rbp)
jmp    114e <main+0x4e>
movl   $0x4,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 0, label %4
i32 1, label %5
]
4: ; preds = %0
br label %7
5: ; preds = %0
store i32 1, i32* %2
br label %7
6: ; preds = %0
store i32 4, i32* %2
br label %7
7: ; preds = %6, %5, %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ find_nth_uint32(int /*<<< orphan*/ *, int, int);
uint32_t median_uint32(uint32_t *array, int n_elements) {
  return find_nth_uint32(array, n_elements, (n_elements - 1) / 2);
}


x86 assembly (clang, -O0):
<median_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1030 <find_nth_uint32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<median_uint32>:
lea    -0x1(%rsi),%eax
shr    $0x1f,%eax
lea    (%rsi,%rax,1),%edx
add    $0xffffffff,%edx
sar    %edx
jmp    1030 <find_nth_uint32@plt>

LLVM IR (-O0):
define i32 @median_uint32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = sdiv i32 %8, 2
%10 = call i32 @find_nth_uint32(i32* %5, i32 %6, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @median_uint32(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sdiv i32 %3, 2
%5 = tail call i32 @find_nth_uint32(i32* %0, i32 %1, i32 %4)
ret i32 %5
}
unsigned char unsignedchar_ignoring_signedlonglong(unsigned char x,
                                                   signed long long y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedchar_ignoring_signedlonglong>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedchar_ignoring_signedlonglong>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @unsignedchar_ignoring_signedlonglong(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @unsignedchar_ignoring_signedlonglong(i8 returned zeroext %0, i64 %1) {
ret i8 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblock_ref() {
  printf("NOT IMPLEMENTED:"
         "pa_memblock_ref"
         "\n");
}


x86 assembly (clang, -O0):
<pa_memblock_ref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pa_memblock_ref>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"NOT IMPLEMENTED:pa_memblock_ref\0A\00"
define i32 @pa_memblock_ref() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_memblock_ref\00"
define i32 @pa_memblock_ref() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int isSymbol(char c) {
  switch (c) {
  case '\n':
  case ' ':
  case '(':
  case ')':
  case '[':
  case ']':
  case ':':
  case ';':
  case ',':
  case '\t':
  case '=':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isSymbol>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xfffffff7,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x54,%eax
ja     1140 <isSymbol+0x40>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1147 <isSymbol+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSymbol>:
add    $0xfffffff7,%edi
cmp    $0x54,%edi
ja     111e <isSymbol+0x1e>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isSymbol(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 10, label %6
i32 32, label %6
i32 40, label %6
i32 41, label %6
i32 91, label %6
i32 93, label %6
i32 58, label %6
i32 59, label %6
i32 44, label %6
i32 9, label %6
i32 61, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @isSymbol(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 10, label %4
i32 32, label %4
i32 40, label %4
i32 41, label %4
i32 91, label %4
i32 93, label %4
i32 58, label %4
i32 59, label %4
i32 44, label %4
i32 9, label %4
i32 61, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
void f(int a, double p) {}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
ret

LLVM IR (-O0):
define void @f(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
ret void
}

LLVM IR (-O2):
define void @f(i32 %0, double %1) {
ret void
}