xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ copyname(char *, char *);
char *gsym(char *s) {
  static char name[16 + 2];
  name[0] = 'C';
  copyname(&name[1], s);
  return name;
}


x86 assembly (clang, -O0):
<gsym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x43,0x2f1d(%rip)
mov    -0x8(%rbp),%rsi
lea    0x2f12(%rip),%rdi
add    $0x1,%rdi
call   1030 <copyname@plt>
lea    0x2f02(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsym>:
push   %rbx
mov    %rdi,%rsi
movb   $0x43,0x2f25(%rip)
lea    0x2f1e(%rip),%rbx
lea    0x2f18(%rip),%rdi
call   1030 <copyname@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@gsym.name = internal global [18 x i8] zeroinitializer
define i8* @gsym(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
store i8 67, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @gsym.name, i64 0, i64 0)
%3 = load i8*, i8** %2
%4 = call i32 @copyname(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @gsym.name, i64 0, i64 1), i8* %3)
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @gsym.name, i64 0, i64 0)
}

LLVM IR (-O2):
@gsym.name = internal global [18 x i8] zeroinitializer
define i8* @gsym(i8* %0) {
store i8 67, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @gsym.name, i64 0, i64 0)
%2 = tail call i32 @copyname(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @gsym.name, i64 0, i64 1), i8* %0)
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @gsym.name, i64 0, i64 0)
}
unsigned xrop3_172_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D ^ S;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_172_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_172_0_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
mov    %ecx,%edx
xor    $0xff,%edx
and    %eax,%edx
xor    %ecx,%edx
not    %eax
or     %edx,%eax
xor    %esi,%eax
and    %ecx,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_172_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = load i32, i32* %8
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = or i32 %34, %38
%40 = load i32, i32* %7
%41 = load i32, i32* %6
%42 = xor i32 %41, -1
%43 = and i32 %40, %42
%44 = load i32, i32* %5
%45 = and i32 %43, %44
%46 = or i32 %39, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_172_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, 255
%8 = and i32 %6, %7
%9 = xor i32 %8, %4
%10 = xor i32 %6, -1
%11 = or i32 %9, %10
%12 = and i32 %11, %4
%13 = xor i32 %4, -1
%14 = and i32 %13, %5
%15 = or i32 %12, %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ cPrintf(char *);
void help05(void) {
  cPrintf("  c                 continue execution\n");
  cPrintf("  c  <cnt>          continue execution <cnt> times\n");
}


x86 assembly (clang, -O0):
<help05>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <cPrintf@plt>
lea    0xf01(%rip),%rdi
call   1030 <cPrintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help05>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <cPrintf@plt>
lea    0xf04(%rip),%rdi
pop    %rax
jmp    1030 <cPrintf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c" c continue execution\0A\00"
@.str.1 = [52 x i8] c" c <cnt> continue execution <cnt> times\0A\00"
define void @help05() {
%1 = call i32 @cPrintf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @cPrintf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c" c continue execution\0A\00"
@.str.1 = [52 x i8] c" c <cnt> continue execution <cnt> times\0A\00"
define void @help05() {
%1 = tail call i32 @cPrintf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cPrintf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_2Cuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x2C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Cuint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x2c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Cuint64_midword_mem>:
testb  $0x2c,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_2Cuint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 44
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_2Cuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 2883584
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void dns_atomic_fence(void) { return; }


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

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

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

LLVM IR (-O2):
define void @dns_atomic_fence() {
ret void
}
AR0IR1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (p0[10000000]) = (*p1); }


x86 assembly (clang, -O0):
<AR0IR1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x2625a00(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0IR1>:
mov    (%r9),%eax
mov    %eax,0x2625a00(%r8)
ret

LLVM IR (-O0):
define i32 @AR0IR1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %13
%15 = load i32, i32* %14
%16 = load i32*, i32** %12
%17 = getelementptr inbounds i32, i32* %16, i64 10000000
store i32 %15, i32* %17
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @AR0IR1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture %5) {
%7 = load i32, i32* %5
%8 = getelementptr inbounds i32, i32* %4, i64 10000000
store i32 %7, i32* %8
ret i32 undef
}
void Qcommon_Shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @Qcommon_Shutdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ time(int);
__attribute__((visibility("hidden"))) void func_0xE2_0x01() {
  time(2);
  ;
}


x86 assembly (clang, -O0):
<func_0xE2_0x01>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <time@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_0xE2_0x01>:
mov    $0x2,%edi
jmp    1030 <time@plt>

LLVM IR (-O0):
define hidden void @func_0xE2_0x01() {
%1 = call i32 @time(i32 2)
ret void
}

LLVM IR (-O2):
define hidden void @func_0xE2_0x01() {
%1 = tail call i32 @time(i32 2)
ret void
}
/* Variables and functions */
void *xmalloc(int size) { return 0; }


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i32 %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int _XAllocScratch() {
  printf("_XAllocScratch called\n");
  return 0;
}


x86 assembly (clang, -O0):
<_XAllocScratch>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_XAllocScratch>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"_XAllocScratch called\0A\00"
define i32 @_XAllocScratch() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"_XAllocScratch called\00"
define i32 @_XAllocScratch() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int crash() {
  int *i = 0;
  return *i;
}


x86 assembly (clang, -O0):
<crash>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @crash() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void *kvm_openfiles(const char *execfile, const char *corefile,
                    const char *swapfile, int flags, char *errout) {
  if (errout)
    strcpy(errout, "/dev/mem: No such file or directory");
  return (0);
}


x86 assembly (clang, -O0):
<kvm_openfiles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1146 <kvm_openfiles+0x36>
mov    -0x28(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kvm_openfiles>:
test   %r8,%r8
je     1129 <kvm_openfiles+0x19>
push   %rax
lea    0xee3(%rip),%rsi
mov    %r8,%rdi
call   1030 <strcpy@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [36 x i8] c"/dev/mem: No such file or directory\00"
define i8* @kvm_openfiles(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %10
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %5
%14 = load i8*, i8** %10
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %13, %5
ret i8* null
}

LLVM IR (-O2):
@.str = [36 x i8] c"/dev/mem: No such file or directory\00"
define noalias i8* @kvm_openfiles(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3, i8* %4) {
%6 = icmp eq i8* %4, null
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret i8* null
}
char *strchr(const char *s, int c) {
  for (; *s; s++) {
    if (*s == c)
      return (char *)s;
  }
  return 0;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <strchr+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1135 <strchr+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <strchr+0x53>
jmp    113a <strchr+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @strchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i32, i32* %5
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = load i8*, i8** %4
store i8* %17, i8** %3
br label %23
18: ; preds = %10
br label %19
19: ; preds = %18
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %4
br label %6
22: ; preds = %6
store i8* null, i8** %3
br label %23
23: ; preds = %22, %16
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
signed long int readlink(const char *restrict __path, char *restrict __buf,
                         unsigned long int __len) {
  signed long int return_value___readlink_chk$1;
  signed long int return_value___readlink_chk_warn$2;
  signed long int return_value___readlink_alias$3;
  return_value___readlink_alias$3 = __readlink_alias(__path, __buf, __len);
  return return_value___readlink_alias$3;
}


x86 assembly (clang, -O0):
<readlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <__readlink_alias@plt>
cltq
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readlink>:
push   %rax
xor    %eax,%eax
call   1030 <__readlink_alias@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @readlink(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = call i32 (i8*, i8*, i64, ...) bitcast (i32 (...)* @__readlink_alias to i32 (i8*, i8*, i64, ...)*)(i8* %10, i8* %11, i64 %12)
%14 = sext i32 %13 to i64
store i64 %14, i64* %9
%15 = load i64, i64* %9
ret i64 %15
}

LLVM IR (-O2):
define i64 @readlink(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = tail call i32 (i8*, i8*, i64, ...) bitcast (i32 (...)* @__readlink_alias to i32 (i8*, i8*, i64, ...)*)(i8* %0, i8* %1, i64 %2)
%5 = sext i32 %4 to i64
ret i64 %5
}
OP(fd, b2) { op_b2(); }


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

x86 assembly (clang, -O2):
<OP>:
xor    %eax,%eax
jmp    1030 <op_b2@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_b2()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
int /*<<< orphan*/ glutTimerFunc(int, void (*)(int), int);
void glut_on_timer(int value) {
  glutPostRedisplay();
  glutTimerFunc(40, glut_on_timer, value);
}


x86 assembly (clang, -O0):
<glut_on_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
mov    -0x4(%rbp),%edx
mov    $0x28,%edi
mov    0x2ea7(%rip),%rsi
call   1030 <glutTimerFunc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glut_on_timer>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <glutPostRedisplay@plt>
mov    0x2eb7(%rip),%rsi
mov    $0x28,%edi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <glutTimerFunc@plt>

LLVM IR (-O0):
define void @glut_on_timer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @glutPostRedisplay()
%4 = load i32, i32* %2
%5 = call i32 @glutTimerFunc(i32 40, void (i32)* @glut_on_timer, i32 %4)
ret void
}

LLVM IR (-O2):
define void @glut_on_timer(i32 %0) {
%2 = tail call i32 (...) @glutPostRedisplay()
%3 = tail call i32 @glutTimerFunc(i32 40, void (i32)* @glut_on_timer, i32 %0)
ret void
}
void __attribute__((nocf_check)) t23(void) {}


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

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

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

LLVM IR (-O2):
define void @t23() {
ret void
}
int test(_Bool pos, _Bool color) {
  return 0;
  return (pos && color);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
and    $0x1,%cl
mov    %cl,-0x1(%rbp)
and    $0x1,%al
mov    %al,-0x2(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test(i1 zeroext %0, i1 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = zext i1 %0 to i8
store i8 %5, i8* %3
%6 = zext i1 %1 to i8
store i8 %6, i8* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @test(i1 zeroext %0, i1 zeroext %1) {
ret i32 0
}
int test_imm_1Aint16_mem(short *val) {
  return ((*val) & (-0x1A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Aint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffffe6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Aint16_mem>:
movzwl (%rdi),%eax
test   $0xffe6,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Aint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -26
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_1Aint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -26
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *justify(char *, char *, long);
int /*<<< orphan*/ ltoa(int, char *, int);
char *justifynum(char *target, int source, long tmax) {
  char x[33];
  ltoa(source, x, 10);
  return justify(target, x, tmax);
}


x86 assembly (clang, -O0):
<justifynum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0xa,%edx
call   1030 <ltoa@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <justify@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<justifynum>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %esi,%edi
mov    %r15,%rsi
mov    $0xa,%edx
call   1030 <ltoa@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <justify@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @justifynum(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
%7 = alloca [33 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%8 = load i32, i32* %5
%9 = getelementptr inbounds [33 x i8], [33 x i8]* %7, i64 0, i64 0
%10 = call i32 @ltoa(i32 %8, i8* %9, i32 10)
%11 = load i8*, i8** %4
%12 = getelementptr inbounds [33 x i8], [33 x i8]* %7, i64 0, i64 0
%13 = load i64, i64* %6
%14 = call i8* @justify(i8* %11, i8* %12, i64 %13)
ret i8* %14
}

LLVM IR (-O2):
define i8* @justifynum(i8* %0, i32 %1, i64 %2) {
%4 = alloca [33 x i8]
%5 = getelementptr inbounds [33 x i8], [33 x i8]* %4, i64 0, i64 0
%6 = call i32 @ltoa(i32 %1, i8* %5, i32 10)
%7 = call i8* @justify(i8* %0, i8* %5, i64 %2)
ret i8* %7
}
void d2i_X509_CRL_INFO(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_X509_CRL_INFO() {
ret void
}
double cc_ignitor_to_voltage(double ignite) { return ignite / 32767 * 15.0; }


x86 assembly (clang, -O0):
<cc_ignitor_to_voltage>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_ignitor_to_voltage>:
divsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @cc_ignitor_to_voltage(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 3.276700e+04
%5 = fmul double %4, 1.500000e+01
ret double %5
}

LLVM IR (-O2):
define double @cc_ignitor_to_voltage(double %0) {
%2 = fdiv double %0, 3.276700e+04
%3 = fmul double %2, 1.500000e+01
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello world.\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double squareRoot(double);
int main(void) {
  printf("squareRoot(2.00) = %f\n", squareRoot(2.00));
  printf("squareRoot(144) = %f\n", squareRoot(144));
  printf("squareRoot(17.5) = %f\n", squareRoot(17.5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
call   1040 <squareRoot@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
movsd  0xeb8(%rip),%xmm0
call   1040 <squareRoot@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe97(%rip),%xmm0
call   1040 <squareRoot@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <squareRoot@plt>
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
movsd  0xec6(%rip),%xmm0
call   1040 <squareRoot@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
movsd  0xeb5(%rip),%xmm0
call   1040 <squareRoot@plt>
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"squareRoot(2.00) = %f\0A\00"
@.str.1 = [22 x i8] c"squareRoot(144) = %f\0A\00"
@.str.2 = [23 x i8] c"squareRoot(17.5) = %f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @squareRoot(double 2.000000e+00)
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call double @squareRoot(double 1.440000e+02)
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = call double @squareRoot(double 1.750000e+01)
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"squareRoot(2.00) = %f\0A\00"
@.str.1 = [22 x i8] c"squareRoot(144) = %f\0A\00"
@.str.2 = [23 x i8] c"squareRoot(17.5) = %f\0A\00"
define i32 @main() {
%1 = tail call double @squareRoot(double 2.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call double @squareRoot(double 1.440000e+02)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = tail call double @squareRoot(double 1.750000e+01)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double %5)
ret i32 0
}
int statlibfunc2() { return 18; }


x86 assembly (clang, -O0):
<statlibfunc2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @statlibfunc2() {
ret i32 18
}

LLVM IR (-O2):
define i32 @statlibfunc2() {
ret i32 18
}
int big_calc1(int id) { return id * 10; }


x86 assembly (clang, -O0):
<big_calc1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xa,-0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<big_calc1>:
add    %edi,%edi
lea    (%rdi,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @big_calc1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 10
ret i32 %4
}

LLVM IR (-O2):
define i32 @big_calc1(i32 %0) {
%2 = mul nsw i32 %0, 10
ret i32 %2
}
/* Variables and functions */
long long __thinthin_syscall(long long, long long, long long, long long,
                             long long, long long, long long);
long long __wasm_syscall(long long n, long long a1, long long a2, long long a3,
                         long long a4, long long a5, long long a6) {
  return __thinthin_syscall(n, a1, a2, a3, a4, a5, a6);
}


x86 assembly (clang, -O0):
<__wasm_syscall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <__thinthin_syscall@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wasm_syscall>:
jmp    1030 <__thinthin_syscall@plt>

LLVM IR (-O0):
define i64 @__wasm_syscall(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
store i64 %0, i64* %8
store i64 %1, i64* %9
store i64 %2, i64* %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i64 %5, i64* %13
store i64 %6, i64* %14
%15 = load i64, i64* %8
%16 = load i64, i64* %9
%17 = load i64, i64* %10
%18 = load i64, i64* %11
%19 = load i64, i64* %12
%20 = load i64, i64* %13
%21 = load i64, i64* %14
%22 = call i64 @__thinthin_syscall(i64 %15, i64 %16, i64 %17, i64 %18, i64 %19, i64 %20, i64 %21)
ret i64 %22
}

LLVM IR (-O2):
define i64 @__wasm_syscall(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = tail call i64 @__thinthin_syscall(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6)
ret i64 %8
}
int fci_bypass_deinit(void *hDevice) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fci_bypass_deinit(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int getCount();
int *malloc(int);
int *randomIndexArray(int size) {
  int i;
  int *idcs = malloc(size * sizeof(int));
  for (i = 0; i < size; i++) {
    idcs[i] = getCount() % size;
  }
  return idcs;
}


x86 assembly (clang, -O0):
<randomIndexArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1175 <randomIndexArray+0x55>
mov    $0x0,%al
call   1030 <getCount@plt>
cltd
idivl  -0x4(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <randomIndexArray+0x25>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomIndexArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edi,%r14d
lea    0x0(,%r14,4),%edi
call   1040 <malloc@plt>
mov    %rax,%r15
test   %r14d,%r14d
jle    1168 <randomIndexArray+0x48>
mov    %r14d,%r12d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <getCount@plt>
cltd
idiv   %r14d
mov    %edx,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1150 <randomIndexArray+0x30>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @randomIndexArray(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = mul i64 %6, 4
%8 = trunc i64 %7 to i32
%9 = call i32* @malloc(i32 %8)
store i32* %9, i32** %4
store i32 0, i32* %3
br label %10
10: ; preds = %22, %1
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %25
14: ; preds = %10
%15 = call i32 (...) @getCount()
%16 = load i32, i32* %2
%17 = srem i32 %15, %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
br label %22
22: ; preds = %14
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %10
25: ; preds = %10
%26 = load i32*, i32** %4
ret i32* %26
}

LLVM IR (-O2):
define noalias i32* @randomIndexArray(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i32* @malloc(i32 %2)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = tail call i32 (...) @getCount()
%10 = srem i32 %9, %0
%11 = getelementptr inbounds i32, i32* %3, i64 %8
store i32 %10, i32* %11
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %1
ret i32* %3
}
double add_one(double x) { return x + 1; }


x86 assembly (clang, -O0):
<add_one>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_one>:
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @add_one(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 1.000000e+00
ret double %4
}

LLVM IR (-O2):
define double @add_one(double %0) {
%2 = fadd double %0, 1.000000e+00
ret double %2
}
/* Variables and functions */
int fscan_uhex(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
unsigned scan_uhex() { return fscan_uhex(stdin); }


x86 assembly (clang, -O0):
<scan_uhex>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <fscan_uhex@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_uhex>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fscan_uhex@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @scan_uhex() {
%1 = load i32, i32* @stdin
%2 = call i32 @fscan_uhex(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @scan_uhex() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @fscan_uhex(i32 %1)
ret i32 %2
}
/* Variables and functions */
double atof(char *);
char *strchr(char *, char);
double sqlDoubleComma(char **pS) {
  char *s = *pS;
  char *e = strchr(s, ',');
  double ret;
  *e++ = 0;
  *pS = e;
  ret = atof(s);
  return ret;
}


x86 assembly (clang, -O0):
<sqlDoubleComma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2c,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlDoubleComma>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%r14
mov    %r14,%rdi
mov    $0x2c,%esi
call   1040 <strchr@plt>
movb   $0x0,(%rax)
add    $0x1,%rax
mov    %rax,(%rbx)
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <atof@plt>

LLVM IR (-O0):
define double @sqlDoubleComma(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double
store i8** %0, i8*** %2
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i8* @strchr(i8* %8, i8 signext 44)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
store i8 0, i8* %10
%12 = load i8*, i8** %4
%13 = load i8**, i8*** %2
store i8* %12, i8** %13
%14 = load i8*, i8** %3
%15 = call double @atof(i8* %14)
store double %15, double* %5
%16 = load double, double* %5
ret double %16
}

LLVM IR (-O2):
define double @sqlDoubleComma(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i8* @strchr(i8* dereferenceable(1) %2, i8 signext 44)
%4 = getelementptr inbounds i8, i8* %3, i64 1
store i8 0, i8* %3
store i8* %4, i8** %0
%5 = tail call double @atof(i8* %2)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0x9e() {
  Assert_real((isascii(158) == 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_isascii.c",
              795, ("isascii should be 0 for 0x9e"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x9e>:
push   %rax
mov    $0x9e,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x31b,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x9e\00"
define void @t_isascii_0x9e() {
%1 = call i64 @isascii(i32 158)
%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 795, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x9e\00"
define void @t_isascii_0x9e() {
%1 = tail call i64 @isascii(i32 158)
%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 795, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(char *, char *);
int check_path(char path[100]) {
  if (strstr(path, "PATH") != NULL)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<check_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1142 <check_path+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <check_path+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_path>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"PATH\00"
define i32 @check_path(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32* @strstr(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"PATH\00"
define i32 @check_path(i8* %0) {
%2 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ log10(int const);
int digit_count(const int number) { return (int)log10(number) + 1; }


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

x86 assembly (clang, -O2):
<digit_count>:
push   %rax
call   1030 <log10@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @digit_count(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @log10(i32 %3)
%5 = trunc i64 %4 to i32
%6 = add nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @digit_count(i32 %0) {
%2 = tail call i64 @log10(i32 %0)
%3 = trunc i64 %2 to i32
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int nrf_802154_ack_pending_bit_for_addr_clear(int /*<<< orphan*/ const *, int);
bool nrf_802154_pending_bit_for_addr_clear(const uint8_t *p_addr,
                                           bool extended) {
  return nrf_802154_ack_pending_bit_for_addr_clear(p_addr, extended);
}


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

x86 assembly (clang, -O2):
<nrf_802154_pending_bit_for_addr_clear>:
jmp    1030 <nrf_802154_ack_pending_bit_for_addr_clear@plt>

LLVM IR (-O0):
define i32 @nrf_802154_pending_bit_for_addr_clear(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 @nrf_802154_ack_pending_bit_for_addr_clear(i32* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @nrf_802154_pending_bit_for_addr_clear(i32* %0, i32 %1) {
%3 = tail call i32 @nrf_802154_ack_pending_bit_for_addr_clear(i32* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, float);
int /*<<< orphan*/ sscanf(char *, char *, float *);
float fix_float(float number) {
  float result;
  char ascii[10];
  sprintf(ascii, "%8.4e", number);
  sscanf(ascii, "%e", &result);
  return (result);
}


x86 assembly (clang, -O0):
<fix_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
lea    -0x12(%rbp),%rdi
movss  -0x4(%rbp),%xmm0
lea    0xec3(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x12(%rbp),%rdi
lea    0xeb9(%rip),%rsi
lea    -0x8(%rbp),%rdx
call   1030 <sscanf@plt>
movss  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_float>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
lea    0xec6(%rip),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1030 <sscanf@plt>
movss  (%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%8.4e\00"
@.str.1 = [3 x i8] c"%e\00"
define float @fix_float(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca [10 x i8]
store float %0, float* %2
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%6 = load float, float* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%9 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%10 = load float, float* %3
ret float %10
}

LLVM IR (-O2):
@.str = [6 x i8] c"%8.4e\00"
@.str.1 = [3 x i8] c"%e\00"
define float @fix_float(float %0) {
%2 = alloca float
%3 = alloca [10 x i8]
%4 = bitcast float* %2 to i8*
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %0)
%7 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%8 = load float, float* %2
ret float %8
}
/* Variables and functions */
int O_NDELAY;
int O_WRONLY;
int open(char *, int);
int open_write(char *fn) { return open(fn, O_WRONLY | O_NDELAY); }


x86 assembly (clang, -O0):
<open_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
or     (%rax),%esi
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_write>:
mov    0x2eb9(%rip),%rax
mov    0x2ec2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_NDELAY = global i32 0
define i32 @open_write(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_WRONLY
%5 = load i32, i32* @O_NDELAY
%6 = or i32 %4, %5
%7 = call i32 @open(i8* %3, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_NDELAY = global i32 0
define i32 @open_write(i8* nocapture %0) {
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_NDELAY
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4)
ret i32 %5
}
char ConditionFalse(void) { return 0; }


x86 assembly (clang, -O0):
<ConditionFalse>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @ConditionFalse() {
ret i8 0
}

LLVM IR (-O2):
define signext i8 @ConditionFalse() {
ret i8 0
}
/* Variables and functions */
void *morecore_reject(unsigned long increment) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @morecore_reject(i64 %0) {
ret i8* null
}
void XtRemoveEventHandler() {}


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

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

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

LLVM IR (-O2):
define void @XtRemoveEventHandler() {
ret void
}
/* Variables and functions */
size_t cblUSizeMin(size_t lhs, size_t rhs) { return (lhs < rhs) ? lhs : rhs; }


x86 assembly (clang, -O0):
<cblUSizeMin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <cblUSizeMin+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <cblUSizeMin+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cblUSizeMin>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @cblUSizeMin(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @cblUSizeMin(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}