xunge/DecIR huggingface dataset:
void div_num(unsigned int num, int *first, int *second, int *third) {
  unsigned int temp = num;
  *first = num >> 22;
  *second = (num << 10) >> 22;
  *third = (num << 20) >> 20;
}


x86 assembly (clang, -O0):
<div_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x16,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
shl    $0xa,%ecx
shr    $0x16,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
shl    $0x14,%ecx
shr    $0x14,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_num>:
mov    %edi,%eax
shr    $0x16,%eax
mov    %eax,(%rsi)
mov    %edi,%eax
shr    $0xc,%eax
and    $0x3ff,%eax
mov    %eax,(%rdx)
and    $0xfff,%edi
mov    %edi,(%rcx)
ret

LLVM IR (-O0):
define void @div_num(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = load i32, i32* %5
store i32 %10, i32* %9
%11 = load i32, i32* %5
%12 = lshr i32 %11, 22
%13 = load i32*, i32** %6
store i32 %12, i32* %13
%14 = load i32, i32* %5
%15 = shl i32 %14, 10
%16 = lshr i32 %15, 22
%17 = load i32*, i32** %7
store i32 %16, i32* %17
%18 = load i32, i32* %5
%19 = shl i32 %18, 20
%20 = lshr i32 %19, 20
%21 = load i32*, i32** %8
store i32 %20, i32* %21
ret void
}

LLVM IR (-O2):
define void @div_num(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = lshr i32 %0, 22
store i32 %5, i32* %1
%6 = lshr i32 %0, 12
%7 = and i32 %6, 1023
store i32 %7, i32* %2
%8 = and i32 %0, 4095
store i32 %8, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void testCaseSkip() { printf("Skipped\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"Skipped\00"
define void @testCaseSkip() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void error() {
  fprintf(stderr, "This is an error function.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"This is an error function.\0A\00"
define void @error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"This is an error function.\0A\00"
define void @error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_174() {
  Assert_real((isqrt(174) == 13),
              "/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/stdlib/isqrt.c",
              875, ("Integer square root of 174 should be 13"));
}


x86 assembly (clang, -O0):
<t_sqrt_174>:
push   %rbp
mov    %rsp,%rbp
mov    $0xae,%edi
call   1030 <isqrt@plt>
cmp    $0xd,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x36b,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_174>:
push   %rax
mov    $0xae,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xd,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x36b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 174 should be 13\00"
define void @t_sqrt_174() {
%1 = call i32 @isqrt(i32 174)
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 875, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 174 should be 13\00"
define void @t_sqrt_174() {
%1 = tail call i32 @isqrt(i32 174)
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 875, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
__complex__ long double ctest_long_double(__complex__ long double x) {
  __complex__ long double res;
  res = ~x;
  return res;
}


x86 assembly (clang, -O0):
<ctest_long_double>:
push   %rbp
mov    %rsp,%rbp
lea    0x10(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rax)
fchs
fxch   %st(1)
fstpt  -0x40(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x40(%rbp)
fldt   -0x30(%rbp)
fxch   %st(1)
fstpt  -0x20(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctest_long_double>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fchs
fxch   %st(1)
ret

LLVM IR (-O0):
define { x86_fp80, x86_fp80 } @ctest_long_double({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = alloca { x86_fp80, x86_fp80 }
%3 = alloca { x86_fp80, x86_fp80 }
%4 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%5 = load x86_fp80, x86_fp80* %4
%6 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%7 = load x86_fp80, x86_fp80* %6
%8 = fneg x86_fp80 %7
%9 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 0
%10 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 1
store x86_fp80 %5, x86_fp80* %9
store x86_fp80 %8, x86_fp80* %10
%11 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 0
%12 = load x86_fp80, x86_fp80* %11
%13 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 1
%14 = load x86_fp80, x86_fp80* %13
%15 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 0
%16 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 1
store x86_fp80 %12, x86_fp80* %15
store x86_fp80 %14, x86_fp80* %16
%17 = load { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2
ret { x86_fp80, x86_fp80 } %17
}

LLVM IR (-O2):
define { x86_fp80, x86_fp80 } @ctest_long_double({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 0
%3 = load x86_fp80, x86_fp80* %2
%4 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%5 = load x86_fp80, x86_fp80* %4
%6 = fneg x86_fp80 %5
%7 = insertvalue { x86_fp80, x86_fp80 } poison, x86_fp80 %3, 0
%8 = insertvalue { x86_fp80, x86_fp80 } %7, x86_fp80 %6, 1
ret { x86_fp80, x86_fp80 } %8
}
int f2(int a, int b) {
  int tem = b & a;
  return a - tem;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    %esi,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f2(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 = load i32, i32* %3
%8 = and i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = sub nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = and i32 %3, %0
ret i32 %4
}
int empty_destroy(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @empty_destroy() {
ret i32 0
}

LLVM IR (-O2):
define i32 @empty_destroy() {
ret i32 0
}
/* Variables and functions */
double timer_nsec();
double timer(void) { return timer_nsec(); }


x86 assembly (clang, -O0):
<timer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <timer_nsec@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define double @timer() {
%1 = call double (...) @timer_nsec()
ret double %1
}

LLVM IR (-O2):
define double @timer() {
%1 = tail call double (...) @timer_nsec()
ret double %1
}
int ff_network_init(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @ff_network_init() {
ret i32 1
}

LLVM IR (-O2):
define i32 @ff_network_init() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_traceids(int, char *);
void fgmvwrite_traceids_(int ntracers, char *traceids) {
  gmvwrite_traceids(ntracers, traceids);
}


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

x86 assembly (clang, -O2):
<fgmvwrite_traceids_>:
jmp    1030 <gmvwrite_traceids@plt>

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

LLVM IR (-O2):
define void @fgmvwrite_traceids_(i32 %0, i8* %1) {
%3 = tail call i32 @gmvwrite_traceids(i32 %0, i8* %1)
ret void
}
unsigned int McASPTxStatusGet(unsigned int baseAddr) {
  return ((*((volatile unsigned int *)(baseAddr + (0xC0)))));
}


x86 assembly (clang, -O0):
<McASPTxStatusGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%eax
mov    %eax,%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPTxStatusGet>:
add    $0xc0,%edi
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @McASPTxStatusGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 192
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @McASPTxStatusGet(i32 %0) {
%2 = add i32 %0, 192
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int *malloc(int);
int /*<<< orphan*/ stderr;
int *my_malloc(int chunksize) {
  int *ptr;
  ptr = malloc(chunksize);
  if (ptr == NULL) {
    fprintf(stderr, "ERROR: malloc failed");
  }
  return ptr;
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1157 <my_malloc+0x37>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <my_malloc+0x23>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"ERROR: malloc failed\00"
define i32* @my_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32* @malloc(i32 %4)
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %1
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"ERROR: malloc failed\00"
define noalias i32* @my_malloc(i32 %0) {
%2 = tail call i32* @malloc(i32 %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %4, %1
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: uname [-amnsrv]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"usage: uname [-amnsrv]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"usage: uname [-amnsrv]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void(__attribute__((nosave_low_regs)) isr)(void) { bar(); }


x86 assembly (clang, -O0):
<isr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bar@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @isr() {
%1 = call i32 (...) @bar()
ret void
}

LLVM IR (-O2):
define void @isr() {
%1 = tail call i32 (...) @bar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int score;
  scanf("%d", &score);
  if (score >= 60)
    printf("YES");
  else
    printf("NO");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x3c,-0x8(%rbp)
jl     115a <main+0x3a>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1166 <main+0x46>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x3c,0x4(%rsp)
lea    0xec5(%rip),%rax
lea    0xec2(%rip),%rdi
cmovge %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"YES\00"
@.str.2 = [3 x i8] c"NO\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 60
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"YES\00"
@.str.2 = [3 x i8] c"NO\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 59
%6 = select i1 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%7 = call i32 @printf(i8* dereferenceable(1) %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nist_ecb_tbl(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  nist_ecb_tbl(128);
  nist_ecb_tbl(192);
  nist_ecb_tbl(256);
  printf("\n==========");
  return 0;
}


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    $0x80,%edi
call   1040 <nist_ecb_tbl@plt>
mov    $0xc0,%edi
call   1040 <nist_ecb_tbl@plt>
mov    $0x100,%edi
call   1040 <nist_ecb_tbl@plt>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x80,%edi
call   1040 <nist_ecb_tbl@plt>
mov    $0xc0,%edi
call   1040 <nist_ecb_tbl@plt>
mov    $0x100,%edi
call   1040 <nist_ecb_tbl@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"\0A==========\00"
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 = call i32 @nist_ecb_tbl(i32 128)
%7 = call i32 @nist_ecb_tbl(i32 192)
%8 = call i32 @nist_ecb_tbl(i32 256)
%9 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"\0A==========\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @nist_ecb_tbl(i32 128)
%4 = tail call i32 @nist_ecb_tbl(i32 192)
%5 = tail call i32 @nist_ecb_tbl(i32 256)
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void menuSound(void) {}


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

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

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

LLVM IR (-O2):
define void @menuSound() {
ret void
}
__attribute__((always_)) const char *refstr_get(const char *r) {
  if (r)
    ((unsigned int *)r)[-1]++;
  return r;
}


x86 assembly (clang, -O0):
<refstr_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <refstr_get+0x20>
mov    -0x8(%rbp),%rax
mov    -0x4(%rax),%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<refstr_get>:
mov    %rdi,%rax
test   %rdi,%rdi
je     110c <refstr_get+0xc>
addl   $0x1,-0x4(%rax)
ret

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

LLVM IR (-O2):
define i8* @refstr_get(i8* returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = add i32 %6, 1
store i32 %7, i32* %5
br label %8
8: ; preds = %3, %1
ret i8* %0
}
/* Variables and functions */
unsigned int BMP_ReadWord();
unsigned int BMP_ReadLong(void) {
  return BMP_ReadWord() | ((unsigned int)BMP_ReadWord() << 16);
}


x86 assembly (clang, -O0):
<BMP_ReadLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <BMP_ReadWord@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <BMP_ReadWord@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
shl    $0x10,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BMP_ReadLong>:
push   %rbx
xor    %eax,%eax
call   1030 <BMP_ReadWord@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <BMP_ReadWord@plt>
shl    $0x10,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @BMP_ReadLong() {
%1 = call i32 (...) @BMP_ReadWord()
%2 = call i32 (...) @BMP_ReadWord()
%3 = shl i32 %2, 16
%4 = or i32 %1, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @BMP_ReadLong() {
%1 = tail call i32 (...) @BMP_ReadWord()
%2 = tail call i32 (...) @BMP_ReadWord()
%3 = shl i32 %2, 16
%4 = or i32 %3, %1
ret i32 %4
}
long rshift16_round(long l) { return (l + 0x8000) >> 16; }


x86 assembly (clang, -O0):
<rshift16_round>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8000,%rax
sar    $0x10,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rshift16_round>:
lea    0x8000(%rdi),%rax
sar    $0x10,%rax
ret

LLVM IR (-O0):
define i64 @rshift16_round(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 32768
%5 = ashr i64 %4, 16
ret i64 %5
}

LLVM IR (-O2):
define i64 @rshift16_round(i64 %0) {
%2 = add nsw i64 %0, 32768
%3 = ashr i64 %2, 16
ret i64 %3
}
/* Variables and functions */
double fsq(double);
double fquad(double x) { return fsq(fsq(x)); }


x86 assembly (clang, -O0):
<fquad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <fsq@plt>
call   1030 <fsq@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fquad>:
push   %rax
call   1030 <fsq@plt>
pop    %rax
jmp    1030 <fsq@plt>

LLVM IR (-O0):
define double @fquad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @fsq(double %3)
%5 = call double @fsq(double %4)
ret double %5
}

LLVM IR (-O2):
define double @fquad(double %0) {
%2 = tail call double @fsq(double %0)
%3 = tail call double @fsq(double %2)
ret double %3
}
int test_imm_23uint32_reg(unsigned int val) {
  return ((val) & (0x23 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_23uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x23,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_23uint32_reg>:
test   $0x23,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_23uint32_reg(i32 %0) {
%2 = and i32 %0, 35
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ errfunc(int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ size_name(int);
void warn_overflow(int pass, int size) {
  errfunc(0x00000000 | pass | ((5) << 12), "%s data exceeds bounds",
          size_name(size));
}


x86 assembly (clang, -O0):
<warn_overflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     $0x0,%eax
or     $0x5000,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <size_name@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%edx
lea    0xeb0(%rip),%rsi
call   1040 <errfunc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warn_overflow>:
push   %rbx
mov    %edi,%ebx
or     $0x5000,%ebx
mov    %esi,%edi
call   1030 <size_name@plt>
lea    0xec9(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1040 <errfunc@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"%s data exceeds bounds\00"
define void @warn_overflow(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 = or i32 0, %5
%7 = or i32 %6, 20480
%8 = load i32, i32* %4
%9 = call i32 @size_name(i32 %8)
%10 = call i32 @errfunc(i32 %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"%s data exceeds bounds\00"
define void @warn_overflow(i32 %0, i32 %1) {
%3 = or i32 %0, 20480
%4 = tail call i32 @size_name(i32 %1)
%5 = tail call i32 @errfunc(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
int comparator_double(double *a, double *b) {
  return *a == *b ? 0 : *a < *b ? -1 : 1;
}


x86 assembly (clang, -O0):
<comparator_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
jne    1132 <comparator_double+0x32>
jp     1132 <comparator_double+0x32>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1156 <comparator_double+0x56>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0x1,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparator_double>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
setbe  %cl
xor    %eax,%eax
ucomisd %xmm1,%xmm0
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @comparator_double(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp oeq double %6, %8
br i1 %9, label %10, label %11
10: ; preds = %2
br label %19
11: ; preds = %2
%12 = load double*, double** %3
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = load double, double* %14
%16 = fcmp olt double %13, %15
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 -1, i32 1
br label %19
19: ; preds = %11, %10
%20 = phi i32 [ 0, %10 ], [ %18, %11 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @comparator_double(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp oeq double %3, %4
%6 = fcmp olt double %3, %4
%7 = select i1 %6, i32 -1, i32 1
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void idt_default_int(void) { print("!! Unknown interrupt\n"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"!! Unknown interrupt\0A\00"
define void @idt_default_int() {
%1 = call i32 @print(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"!! Unknown interrupt\0A\00"
define void @idt_default_int() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test1(void (*)(char const *));
void test(void (*callback)(const char *)) { test1(callback); }


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <test1@plt>

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

LLVM IR (-O2):
define void @test(void (i8*)* %0) {
%2 = tail call i32 @test1(void (i8*)* %0)
ret void
}
unsigned test6(unsigned x) {
  return ((x & 0x00FF0000) >> 16) | ((x & 0x000000FF) << 16);
}


x86 assembly (clang, -O0):
<test6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff0000,%eax
shr    $0x10,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test6>:
mov    %edi,%eax
rol    $0x10,%eax
and    $0xff00ff,%eax
ret

LLVM IR (-O0):
define i32 @test6(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 16711680
%5 = lshr i32 %4, 16
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = shl i32 %7, 16
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test6(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 255
%4 = shl i32 %0, 16
%5 = and i32 %4, 16711680
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
char *mod_home(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  printf("%s\n", ((argc < 2) ? mod_home("") : mod_home(argv[1])));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1155 <main+0x35>
lea    0xebc(%rip),%rdi
call   1040 <mod_home@plt>
mov    %rax,-0x18(%rbp)
jmp    1166 <main+0x46>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <mod_home@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jge    112f <main+0xf>
lea    0xed6(%rip),%rdi
jmp    1133 <main+0x13>
mov    0x8(%rsi),%rdi
call   1040 <mod_home@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
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* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i8* @mod_home(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i8* @mod_home(i8* %13)
br label %15
15: ; preds = %10, %8
%16 = phi i8* [ %9, %8 ], [ %14, %10 ]
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %2 ]
%9 = tail call i8* @mod_home(i8* %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}
__attribute__((visibility("default"))) __attribute__((cdecl)) int OnInit() {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @OnInit() {
ret i32 0
}

LLVM IR (-O2):
define i32 @OnInit() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ft_strlen(char const *);
char *ft_strndup(char const *, int /*<<< orphan*/);
char *ft_strdup(const char *s1) { return (ft_strndup(s1, ft_strlen(s1))); }


x86 assembly (clang, -O0):
<ft_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <ft_strndup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <ft_strndup@plt>

LLVM IR (-O0):
define i8* @ft_strdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @ft_strlen(i8* %4)
%6 = call i8* @ft_strndup(i8* %3, i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @ft_strdup(i8* %0) {
%2 = tail call i32 @ft_strlen(i8* %0)
%3 = tail call i8* @ft_strndup(i8* %0, i32 %2)
ret i8* %3
}
/* Variables and functions */
void __asan_get_redzones(char *ptr, char **left, char **right) {
  char *rz_left = ptr - (32);
  char *rz_right = *(char **)rz_left;
  if (left != NULL)
    *left = rz_left;
  if (right != NULL)
    *right = rz_right;
}


x86 assembly (clang, -O0):
<__asan_get_redzones>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffe0,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113d <__asan_get_redzones+0x3d>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <__asan_get_redzones+0x53>
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__asan_get_redzones>:
mov    -0x20(%rdi),%rax
test   %rsi,%rsi
je     1110 <__asan_get_redzones+0x10>
add    $0xffffffffffffffe0,%rdi
mov    %rdi,(%rsi)
test   %rdx,%rdx
je     1118 <__asan_get_redzones+0x18>
mov    %rax,(%rdx)
ret

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

LLVM IR (-O2):
define void @__asan_get_redzones(i8* %0, i8** writeonly %1, i8** writeonly %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 -32
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
%7 = icmp eq i8** %1, null
br i1 %7, label %9, label %8
8: ; preds = %3
store i8* %4, i8** %1
br label %9
9: ; preds = %8, %3
%10 = icmp eq i8** %2, null
br i1 %10, label %12, label %11
11: ; preds = %9
store i8* %6, i8** %2
br label %12
12: ; preds = %11, %9
ret void
}
/* Type definitions */
struct protoent {
  int p_proto;
};

/* Variables and functions */
struct protoent *getprotobyname(char *);
int find_proto(void) {
  struct protoent *ent = getprotobyname("ICMP");
  if (ent == NULL)
    return -1;
  return ent->p_proto;
}


x86 assembly (clang, -O0):
<find_proto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getprotobyname@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113f <find_proto+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1148 <find_proto+0x38>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_proto>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getprotobyname@plt>
test   %rax,%rax
je     1126 <find_proto+0x16>
mov    (%rax),%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.protoent = type { i32 }
@.str = [5 x i8] c"ICMP\00"
define i32 @find_proto() {
%1 = tail call %struct.protoent* @getprotobyname(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq %struct.protoent* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = getelementptr inbounds %struct.protoent, %struct.protoent* %1, i64 0, i32 0
%5 = load i32, i32* %4
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ %5, %3 ], [ -1, %0 ]
ret i32 %7
}
/* Variables and functions */
void *realloc(void *, size_t);
void *memCxtRealloc(void *addr, size_t needed) {
  return (realloc(addr, needed));
}


x86 assembly (clang, -O0):
<memCxtRealloc>:
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 <realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memCxtRealloc>:
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @memCxtRealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @memCxtRealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
unsigned long nam2num(char const *);
int /*<<< orphan*/ rtai_free(unsigned long, void *);
void rtai_shm_detach(const char *name, void *mbuf) {
  unsigned long name_as_num = nam2num(name);
  rtai_free(name_as_num, mbuf);
}


x86 assembly (clang, -O0):
<rtai_shm_detach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <nam2num@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <rtai_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtai_shm_detach>:
push   %rbx
mov    %rsi,%rbx
call   1030 <nam2num@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <rtai_free@plt>

LLVM IR (-O0):
define void @rtai_shm_detach(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @nam2num(i8* %6)
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = load i8*, i8** %4
%10 = call i32 @rtai_free(i64 %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @rtai_shm_detach(i8* %0, i8* %1) {
%3 = tail call i64 @nam2num(i8* %0)
%4 = tail call i32 @rtai_free(i64 %3, i8* %1)
ret void
}
/* Variables and functions */
int PERQTInit(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @PERQTInit() {
ret i32 0
}

LLVM IR (-O2):
define i32 @PERQTInit() {
ret i32 0
}
/* Variables and functions */
int minsz(int);
unsigned nextsz(unsigned nelem) { return minsz(minsz(nelem)); }


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

x86 assembly (clang, -O2):
<nextsz>:
push   %rax
call   1030 <minsz@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <minsz@plt>

LLVM IR (-O0):
define i32 @nextsz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @minsz(i32 %3)
%5 = call i32 @minsz(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @nextsz(i32 %0) {
%2 = tail call i32 @minsz(i32 %0)
%3 = tail call i32 @minsz(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ do_cpuid(int);
void qsim_bin_out(char i) { do_cpuid((0xff & i) | 0xc5b10000); }


x86 assembly (clang, -O0):
<qsim_bin_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
and    $0xff,%edi
or     $0xc5b10000,%edi
call   1030 <do_cpuid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsim_bin_out>:
movzbl %dil,%edi
or     $0xc5b10000,%edi
jmp    1030 <do_cpuid@plt>

LLVM IR (-O0):
define void @qsim_bin_out(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 255, %4
%6 = or i32 %5, -978255872
%7 = call i32 @do_cpuid(i32 %6)
ret void
}

LLVM IR (-O2):
define void @qsim_bin_out(i8 signext %0) {
%2 = zext i8 %0 to i32
%3 = or i32 %2, -978255872
%4 = tail call i32 @do_cpuid(i32 %3)
ret void
}
int search(int A[], int n, int key) {
  int a_size = n;
  while (--a_size >= 0)
    if (key == A[a_size])
      return 1;
  return -1;
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jl     114b <search+0x4b>
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    1146 <search+0x46>
movl   $0x1,-0x4(%rbp)
jmp    1152 <search+0x52>
jmp    1114 <search+0x14>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
mov    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %eax,%eax
jle    1127 <search+0x27>
lea    -0x1(%rax),%rcx
cmp    %edx,-0x4(%rdi,%rax,4)
mov    %rcx,%rax
jne    1110 <search+0x10>
mov    $0x1,%eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @search(i32* nocapture %0, i32 %1, i32 %2) {
%4 = zext i32 %1 to i64
br label %5
5: ; preds = %10, %3
%6 = phi i64 [ %7, %10 ], [ %4, %3 ]
%7 = add nsw i64 %6, -1
%8 = trunc i64 %6 to i32
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = getelementptr inbounds i32, i32* %0, i64 %7
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %2
br i1 %13, label %14, label %5
14: ; preds = %5, %10
%15 = phi i32 [ 1, %10 ], [ -1, %5 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_add_ss(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_add_ss(__m128 A, __m128 B) { return _mm_add_ss(A, B); }


x86 assembly (clang, -O0):
<test_mm_add_ss>:
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 <_mm_add_ss@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_add_ss>:
jmp    1030 <_mm_add_ss@plt>

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

LLVM IR (-O2):
define i32 @test_mm_add_ss(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_add_ss(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
double exp(scalar_t__);
scalar_t__ lnbico(int, int);
double hyper_323(int n11, int n1_, int n_1, int n) {
  return (exp(lnbico(n1_, n11) + lnbico(n - n1_, n_1 - n11) - lnbico(n, n_1)));
}


x86 assembly (clang, -O0):
<hyper_323>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <lnbico@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%edi
sub    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    -0x4(%rbp),%esi
call   1030 <lnbico@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <lnbico@plt>
mov    -0x18(%rbp),%rdi
sub    %rax,%rdi
call   1040 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hyper_323>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%r12d
mov    %esi,%edi
mov    %r12d,%esi
call   1030 <lnbico@plt>
mov    %rax,%rbp
mov    %r14d,%edi
sub    %ebx,%edi
mov    %r15d,%esi
sub    %r12d,%esi
call   1030 <lnbico@plt>
add    %rax,%rbp
mov    %r14d,%edi
mov    %r15d,%esi
call   1030 <lnbico@plt>
sub    %rax,%rbp
mov    %rbp,%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <exp@plt>

LLVM IR (-O0):
define double @hyper_323(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = call i64 @lnbico(i32 %9, i32 %10)
%12 = load i32, i32* %8
%13 = load i32, i32* %6
%14 = sub nsw i32 %12, %13
%15 = load i32, i32* %7
%16 = load i32, i32* %5
%17 = sub nsw i32 %15, %16
%18 = call i64 @lnbico(i32 %14, i32 %17)
%19 = add nsw i64 %11, %18
%20 = load i32, i32* %8
%21 = load i32, i32* %7
%22 = call i64 @lnbico(i32 %20, i32 %21)
%23 = sub nsw i64 %19, %22
%24 = call double @exp(i64 %23)
ret double %24
}

LLVM IR (-O2):
define double @hyper_323(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i64 @lnbico(i32 %1, i32 %0)
%6 = sub nsw i32 %3, %1
%7 = sub nsw i32 %2, %0
%8 = tail call i64 @lnbico(i32 %6, i32 %7)
%9 = add nsw i64 %8, %5
%10 = tail call i64 @lnbico(i32 %3, i32 %2)
%11 = sub i64 %9, %10
%12 = tail call double @exp(i64 %11)
ret double %12
}