xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ vputc(char);
beep() { vputc('\7'); }


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

x86 assembly (clang, -O2):
<beep>:
mov    $0x7,%edi
jmp    1030 <vputc@plt>

LLVM IR (-O0):
define i32 @beep() {
%1 = alloca i32
%2 = call i32 @vputc(i8 signext 7)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @beep() {
%1 = tail call i32 @vputc(i8 signext 7)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ cpc_key_press(int);
int /*<<< orphan*/ cpc_key_unpress(int);
void Joy_Opqa_Up(int value) {
  if (value) {
    cpc_key_press(0x83);
  } else {
    cpc_key_unpress(0x83);
  };
}


x86 assembly (clang, -O0):
<Joy_Opqa_Up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <Joy_Opqa_Up+0x24>
mov    $0x83,%edi
call   1030 <cpc_key_press@plt>
jmp    114e <Joy_Opqa_Up+0x2e>
mov    $0x83,%edi
call   1040 <cpc_key_unpress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Joy_Opqa_Up>:
test   %edi,%edi
je     112e <Joy_Opqa_Up+0xe>
mov    $0x83,%edi
jmp    1030 <cpc_key_press@plt>
mov    $0x83,%edi
jmp    1040 <cpc_key_unpress@plt>

LLVM IR (-O0):
define void @Joy_Opqa_Up(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @cpc_key_press(i32 131)
br label %9
7: ; preds = %1
%8 = call i32 @cpc_key_unpress(i32 131)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @Joy_Opqa_Up(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cpc_key_press(i32 131)
br label %7
5: ; preds = %1
%6 = tail call i32 @cpc_key_unpress(i32 131)
br label %7
7: ; preds = %5, %3
ret void
}
SORU_7_PROTOTYPE() {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<SORU_7_PROTOTYPE>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <SORU_7_PROTOTYPE+0x9>
jmp    1109 <SORU_7_PROTOTYPE+0x9>

x86 assembly (clang, -O2):
<SORU_7_PROTOTYPE>:
jmp    1100 <SORU_7_PROTOTYPE>

LLVM IR (-O0):
define i32 @SORU_7_PROTOTYPE() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define i32 @SORU_7_PROTOTYPE() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ do_unary2();
void do_app2(void) { do_unary2(); }


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

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

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

LLVM IR (-O2):
define void @do_app2() {
%1 = tail call i32 (...) @do_unary2()
ret void
}
long long int gcd(long long int a, long long int b) {
  if (a == b)
    return a;
  if (a > b)
    return gcd(a - b, b);
  return gcd(a, b - a);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    113b <gcd+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <gcd+0x68>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1163 <gcd+0x53>
mov    -0x10(%rbp),%rdi
sub    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <gcd@plt>
mov    %rax,-0x8(%rbp)
jmp    1178 <gcd+0x68>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
sub    -0x10(%rbp),%rsi
call   1030 <gcd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
cmp    %rsi,%rdi
jne    1109 <gcd+0x9>
mov    %rdi,%rax
ret
mov    %rsi,%rax
mov    %rax,%rcx
nop
sub    %rdi,%rcx
jl     1120 <gcd+0x20>
mov    %rcx,%rax
cmp    %rcx,%rdi
jne    1110 <gcd+0x10>
jmp    1105 <gcd+0x5>
nop
sub    %rax,%rdi
cmp    %rdi,%rax
jne    110c <gcd+0xc>
jmp    1108 <gcd+0x8>

LLVM IR (-O0):
define i64 @gcd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i64, i64* %4
store i64 %10, i64* %3
br label %27
11: ; preds = %2
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = icmp sgt i64 %12, %13
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load i64, i64* %4
%17 = load i64, i64* %5
%18 = sub nsw i64 %16, %17
%19 = load i64, i64* %5
%20 = call i64 @gcd(i64 %18, i64 %19)
store i64 %20, i64* %3
br label %27
21: ; preds = %11
%22 = load i64, i64* %4
%23 = load i64, i64* %5
%24 = load i64, i64* %4
%25 = sub nsw i64 %23, %24
%26 = call i64 @gcd(i64 %22, i64 %25)
store i64 %26, i64* %3
br label %27
27: ; preds = %21, %15, %9
%28 = load i64, i64* %3
ret i64 %28
}

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
br i1 %3, label %16, label %4
4: ; preds = %2, %10
%5 = phi i64 [ %8, %10 ], [ %1, %2 ]
%6 = phi i64 [ %11, %10 ], [ %0, %2 ]
br label %7
7: ; preds = %4, %13
%8 = phi i64 [ %5, %4 ], [ %14, %13 ]
%9 = icmp slt i64 %8, %6
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = sub nsw i64 %6, %8
%12 = icmp eq i64 %11, %8
br i1 %12, label %16, label %4
13: ; preds = %7
%14 = sub nsw i64 %8, %6
%15 = icmp eq i64 %6, %14
br i1 %15, label %16, label %7
16: ; preds = %10, %13, %2
%17 = phi i64 [ %0, %2 ], [ %6, %13 ], [ %8, %10 ]
ret i64 %17
}
void UARTHalfDuplexEnable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000010))) &=
      ~(0x00004000 | 0x00000800);
  (*((volatile unsigned long *)(ulBase + 0x00000014))) &=
      ~(0x00000020 | 0x00000002);
  (*((volatile unsigned long *)(ulBase + 0x00000014))) |= 0x00000008;
}


x86 assembly (clang, -O0):
<UARTHalfDuplexEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rcx
and    $0xffffffffffffb7ff,%rcx
mov    %rcx,0x10(%rax)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%rcx
and    $0xffffffffffffffdd,%rcx
mov    %rcx,0x14(%rax)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%rcx
or     $0x8,%rcx
mov    %rcx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTHalfDuplexEnable>:
andq   $0xffffffffffffb7ff,0x10(%rdi)
ff
andq   $0xffffffffffffffdd,0x14(%rdi)
orq    $0x8,0x14(%rdi)
ret

LLVM IR (-O0):
define void @UARTHalfDuplexEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 16
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -18433
store volatile i64 %7, i64* %5
%8 = load i64, i64* %2
%9 = add i64 %8, 20
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = and i64 %11, -35
store volatile i64 %12, i64* %10
%13 = load i64, i64* %2
%14 = add i64 %13, 20
%15 = inttoptr i64 %14 to i64*
%16 = load volatile i64, i64* %15
%17 = or i64 %16, 8
store volatile i64 %17, i64* %15
ret void
}

LLVM IR (-O2):
define void @UARTHalfDuplexEnable(i64 %0) {
%2 = add i64 %0, 16
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -18433
store volatile i64 %5, i64* %3
%6 = add i64 %0, 20
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, -35
store volatile i64 %9, i64* %7
%10 = load volatile i64, i64* %7
%11 = or i64 %10, 8
store volatile i64 %11, i64* %7
ret void
}
int __test() {
  int a = 33;
  return a;
}


x86 assembly (clang, -O0):
<__test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x21,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__test() {
ret i32 33
}
int search_arr(int myArray[], int elements, int number) {
  int i;
  for (i = 0; i < elements; i++) {
    if (myArray[i] == number)
      return (number);
  }
  return (-1);
}


x86 assembly (clang, -O0):
<search_arr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <search_arr+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <search_arr+0x40>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <search_arr+0x5a>
jmp    1145 <search_arr+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <search_arr+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_arr>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <search_arr+0x1e>
mov    %esi,%ecx
xor    %esi,%esi
nopl   (%rax)
cmp    %edx,(%rdi,%rsi,4)
je     111f <search_arr+0x1f>
add    $0x1,%rsi
cmp    %rsi,%rcx
jne    1110 <search_arr+0x10>
ret
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @search_arr(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
store i32 0, i32* %8
br label %9
9: ; preds = %24, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %27
13: ; preds = %9
%14 = load i32*, i32** %5
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %7
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %13
%22 = load i32, i32* %7
store i32 %22, i32* %4
br label %28
23: ; preds = %13
br label %24
24: ; preds = %23
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %9
27: ; preds = %9
store i32 -1, i32* %4
br label %28
28: ; preds = %27, %21
%29 = load i32, i32* %4
ret i32 %29
}

LLVM IR (-O2):
define i32 @search_arr(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %2
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ -1, %3 ], [ -1, %7 ], [ %2, %9 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
const int const *print_int(const int const *i) {
  printf("%d\n", *i);
  return (i);
}


x86 assembly (clang, -O0):
<print_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32* @print_int(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32*, i32** %2
ret i32* %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32* @print_int(i32* returned %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32* %0
}
/* Variables and functions */
scalar_t__ foo(int);
int wait_reading_process_output(void) {
  int nfds = 0;
  int channel;
  for (channel = 0; channel < 1024; ++channel) {
    if (foo(channel))
      nfds++;
  }
  if (nfds < 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<wait_reading_process_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x400,-0xc(%rbp)
jge    1161 <wait_reading_process_output+0x51>
mov    -0xc(%rbp),%edi
call   1030 <foo@plt>
cmp    $0x0,%rax
je     114e <wait_reading_process_output+0x3e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1153 <wait_reading_process_output+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <wait_reading_process_output+0x16>
cmpl   $0x0,-0x8(%rbp)
jge    1177 <wait_reading_process_output+0x67>
movl   $0x1,-0x4(%rbp)
jmp    117e <wait_reading_process_output+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_reading_process_output>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <foo@plt>
add    $0x1,%ebx
cmp    $0x400,%ebx
jne    1120 <wait_reading_process_output+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @wait_reading_process_output() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %15, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1024
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load i32, i32* %3
%9 = call i64 @foo(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %7
br label %15
15: ; preds = %14
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %4
%19 = load i32, i32* %2
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %18
store i32 1, i32* %1
br label %23
22: ; preds = %18
store i32 0, i32* %1
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
define i32 @wait_reading_process_output() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i64 @foo(i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 1024
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
void NoSoundDrv_CD_Stop(void) {}


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

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

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

LLVM IR (-O2):
define void @NoSoundDrv_CD_Stop() {
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
bool path_exists(const char *path) {
  struct stat sb;
  int ret;
  ret = stat(path, &sb);
  if (ret < 0)
    return (false);
  return (true);
}


x86 assembly (clang, -O0):
<path_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1142 <path_exists+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1149 <path_exists+0x39>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
not    %eax
shr    $0x1f,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @path_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %12
11: ; preds = %1
store i32 1, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @path_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = xor i32 %4, -1
%6 = lshr i32 %5, 31
ret i32 %6
}
int test_imm_B6int8_mem(signed char *val) {
  return ((*val) & (0xB6 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B6int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 182
%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_B6int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -74
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int main(void) {
  int i = 0;
  int t;
  if (i == 0)
    ;
  if (i == 0)
    return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1121 <main+0x21>
jmp    1121 <main+0x21>
cmpl   $0x0,-0x8(%rbp)
jne    1132 <main+0x32>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
int verify_benchmark(int r) {
  int expected = 1425391793;
  if (r != expected)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<verify_benchmark>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x54f5c0b1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1126 <verify_benchmark+0x26>
movl   $0x0,-0x4(%rbp)
jmp    112d <verify_benchmark+0x2d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_benchmark>:
xor    %eax,%eax
cmp    $0x54f5c0b1,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @verify_benchmark(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 1425391793, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %10
9: ; preds = %1
store i32 1, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @verify_benchmark(i32 %0) {
%2 = icmp eq i32 %0, 1425391793
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ bingham_dY_params_3d_slow(double *, double *, double *);
void bingham_dY_params_3d(double *Z, double *F, double *dY) {
  bingham_dY_params_3d_slow(Z, F, dY);
}


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

x86 assembly (clang, -O2):
<bingham_dY_params_3d>:
jmp    1030 <bingham_dY_params_3d_slow@plt>

LLVM IR (-O0):
define void @bingham_dY_params_3d(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load double*, double** %6
%10 = call i32 @bingham_dY_params_3d_slow(double* %7, double* %8, double* %9)
ret void
}

LLVM IR (-O2):
define void @bingham_dY_params_3d(double* %0, double* %1, double* %2) {
%4 = tail call i32 @bingham_dY_params_3d_slow(double* %0, double* %1, double* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void input_print(char *in) {
  printf("Input file:\n");
  printf("\n%s", in);
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Input file:\0A\00"
@.str.1 = [4 x i8] c"\0A%s\00"
define void @input_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"\0A%s\00"
@str = [12 x i8] c"Input file:\00"
define void @input_print(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int print_aft_stats_log(double *, int, int *);
int print_aft_stats(double *vertex, int nt, int *tetra) {
  return print_aft_stats_log(vertex, nt, tetra);
}


x86 assembly (clang, -O0):
<print_aft_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <print_aft_stats_log@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_aft_stats>:
jmp    1030 <print_aft_stats_log@plt>

LLVM IR (-O0):
define i32 @print_aft_stats(double* %0, i32 %1, i32* %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32*
store double* %0, double** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load double*, double** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32 @print_aft_stats_log(double* %7, i32 %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @print_aft_stats(double* %0, i32 %1, i32* %2) {
%4 = tail call i32 @print_aft_stats_log(double* %0, i32 %1, i32* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void hexdump_nl(unsigned char *d, int l) {
  int i;
  for (i = 0; i < l; i++) {
    printf("%2.2X ", d[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<hexdump_nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <hexdump_nl+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <hexdump_nl+0x16>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdump_nl>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1158 <hexdump_nl+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <hexdump_nl+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%2.2X \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @hexdump_nl(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%2.2X \00"
define void @hexdump_nl(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
struct athena_args {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_args(struct athena_args *);
int /*<<< orphan*/ clear_given(struct athena_args *);
int /*<<< orphan*/ init_args_info(struct athena_args *);
void arg_parser_init(struct athena_args *args_info) {
  clear_given(args_info);
  clear_args(args_info);
  init_args_info(args_info);
}


x86 assembly (clang, -O0):
<arg_parser_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <clear_given@plt>
mov    -0x8(%rbp),%rdi
call   1030 <clear_args@plt>
mov    -0x8(%rbp),%rdi
call   1050 <init_args_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_parser_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <clear_given@plt>
mov    %rbx,%rdi
call   1030 <clear_args@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <init_args_info@plt>

LLVM IR (-O0):
%struct.athena_args = type { i32 }
define void @arg_parser_init(%struct.athena_args* %0) {
%2 = alloca %struct.athena_args*
store %struct.athena_args* %0, %struct.athena_args** %2
%3 = load %struct.athena_args*, %struct.athena_args** %2
%4 = call i32 @clear_given(%struct.athena_args* %3)
%5 = load %struct.athena_args*, %struct.athena_args** %2
%6 = call i32 @clear_args(%struct.athena_args* %5)
%7 = load %struct.athena_args*, %struct.athena_args** %2
%8 = call i32 @init_args_info(%struct.athena_args* %7)
ret void
}

LLVM IR (-O2):
%struct.athena_args = type { i32 }
define void @arg_parser_init(%struct.athena_args* %0) {
%2 = tail call i32 @clear_given(%struct.athena_args* %0)
%3 = tail call i32 @clear_args(%struct.athena_args* %0)
%4 = tail call i32 @init_args_info(%struct.athena_args* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void *malloc(size_t);
void *smalloc(size_t size) {
  void *p;
  p = malloc(size);
  if (!p) {
    fatal("out of memory");
  }
  return p;
}


x86 assembly (clang, -O0):
<smalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <smalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <smalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @smalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ h265nal_init(int *);
int /*<<< orphan*/ h265nal_set_type(int *, int);
void h265vps_init(uint8_t *p_h265vps) {
  h265nal_init(p_h265vps);
  h265nal_set_type(p_h265vps, 32);
  p_h265vps[5] = 0x6;
}


x86 assembly (clang, -O0):
<h265vps_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <h265nal_init@plt>
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1030 <h265nal_set_type@plt>
mov    -0x8(%rbp),%rax
movl   $0x6,0x14(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265vps_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <h265nal_init@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
call   1030 <h265nal_set_type@plt>
movl   $0x6,0x14(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @h265vps_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @h265nal_init(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @h265nal_set_type(i32* %5, i32 32)
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 5
store i32 6, i32* %8
ret void
}

LLVM IR (-O2):
define void @h265vps_init(i32* %0) {
%2 = tail call i32 @h265nal_init(i32* %0)
%3 = tail call i32 @h265nal_set_type(i32* %0, i32 32)
%4 = getelementptr inbounds i32, i32* %0, i64 5
store i32 6, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ANET_Poll();
int N_PollClient() {
  ANET_Poll();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @N_PollClient() {
%1 = call i32 (...) @ANET_Poll()
ret i32 0
}

LLVM IR (-O2):
define i32 @N_PollClient() {
%1 = tail call i32 (...) @ANET_Poll()
ret i32 0
}
void dummy_null_func(void) {}


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

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

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

LLVM IR (-O2):
define void @dummy_null_func() {
ret void
}
void i2d_PKCS7_ENVELOPE(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_PKCS7_ENVELOPE() {
ret void
}
/* Variables and functions */
scalar_t__ get_kb_alt();
scalar_t__ get_kb_ctrl();
scalar_t__ get_kb_guikey();
scalar_t__ get_kb_shift();
int get_kb_all_mods() {
  return (get_kb_shift() > 0) + (get_kb_ctrl() > 0) + (get_kb_guikey() > 0) +
         (get_kb_alt() > 0);
}


x86 assembly (clang, -O0):
<get_kb_all_mods>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <get_kb_shift@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <get_kb_ctrl@plt>
mov    %rax,%rcx
mov    -0xc(%rbp),%eax
cmp    $0x0,%rcx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_kb_guikey@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%eax
cmp    $0x0,%rcx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_kb_alt@plt>
mov    %rax,%rcx
mov    -0x4(%rbp),%eax
cmp    $0x0,%rcx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_kb_all_mods>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <get_kb_shift@plt>
xor    %ebx,%ebx
test   %rax,%rax
setg   %bl
xor    %eax,%eax
call   1050 <get_kb_ctrl@plt>
xor    %ebp,%ebp
test   %rax,%rax
setg   %bpl
add    %ebx,%ebp
xor    %eax,%eax
call   1030 <get_kb_guikey@plt>
xor    %ebx,%ebx
test   %rax,%rax
setg   %bl
add    %ebp,%ebx
xor    %eax,%eax
call   1040 <get_kb_alt@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
add    %ebx,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_kb_all_mods() {
%1 = call i64 (...) @get_kb_shift()
%2 = icmp sgt i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i64 (...) @get_kb_ctrl()
%5 = icmp sgt i64 %4, 0
%6 = zext i1 %5 to i32
%7 = add nsw i32 %3, %6
%8 = call i64 (...) @get_kb_guikey()
%9 = icmp sgt i64 %8, 0
%10 = zext i1 %9 to i32
%11 = add nsw i32 %7, %10
%12 = call i64 (...) @get_kb_alt()
%13 = icmp sgt i64 %12, 0
%14 = zext i1 %13 to i32
%15 = add nsw i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @get_kb_all_mods() {
%1 = tail call i64 (...) @get_kb_shift()
%2 = icmp sgt i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i64 (...) @get_kb_ctrl()
%5 = icmp sgt i64 %4, 0
%6 = zext i1 %5 to i32
%7 = add nuw nsw i32 %6, %3
%8 = tail call i64 (...) @get_kb_guikey()
%9 = icmp sgt i64 %8, 0
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = tail call i64 (...) @get_kb_alt()
%13 = icmp sgt i64 %12, 0
%14 = zext i1 %13 to i32
%15 = add nuw nsw i32 %11, %14
ret i32 %15
}
void free_ivector(v, nl, nh) int *v, nl, nh;
{
  nh = nh;
  free((char *)(v + nl));
}


x86 assembly (clang, -O0):
<free_ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_ivector>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_ivector(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
store i32 %7, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = bitcast i32* %11 to i8*
ret void
}

LLVM IR (-O2):
define void @free_ivector(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = bitcast i32* %5 to i8*
tail call void @free(i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doexit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
size_t add2(size_t a, size_t b) {
  size_t sum = a + b;
  if (sum < a) {
    fprintf(stderr, "\nInteger overflow\n");
    doexit(5);
  }
  return sum;
}


x86 assembly (clang, -O0):
<add2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1169 <add2+0x49>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xea6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x5,%edi
call   1040 <doexit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add2>:
push   %rbx
mov    %rdi,%rbx
add    %rsi,%rbx
jae    1148 <add2+0x28>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x5,%edi
call   1040 <doexit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"\0AInteger overflow\0A\00"
define i64 @add2(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = add i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = load i64, i64* %3
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @doexit(i32 5)
br label %16
16: ; preds = %12, %2
%17 = load i64, i64* %5
ret i64 %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"\0AInteger overflow\0A\00"
define i64 @add2(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = icmp ult i64 %3, %0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @doexit(i32 5)
br label %9
9: ; preds = %5, %2
ret i64 %3
}
void glUniform4ui(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glUniform4ui() {
ret void
}
int binary_reader_read_internal(const void *src, int n, void **out_value) {
  return n;
}


x86 assembly (clang, -O0):
<binary_reader_read_internal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary_reader_read_internal>:
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @binary_reader_read_internal(i8* %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i32, i32* %5
ret i32 %7
}

LLVM IR (-O2):
define i32 @binary_reader_read_internal(i8* nocapture readnone %0, i32 returned %1, i8** nocapture readnone %2) {
ret i32 %1
}
int xtables_lock_or_exit(int wait, struct timeval *wait_interval) {}


x86 assembly (clang, -O0):
<xtables_lock_or_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.timeval = type opaque
define i32 @xtables_lock_or_exit(i32 %0, %struct.timeval* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.timeval*
store i32 %0, i32* %4
store %struct.timeval* %1, %struct.timeval** %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.timeval = type opaque
define i32 @xtables_lock_or_exit(i32 %0, %struct.timeval* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ _mu_test_postprocess();
int /*<<< orphan*/ _mu_test_preprocess(char *);
int /*<<< orphan*/ test_read_target_from_file();
void test_target(void) {
  do {
    _mu_test_preprocess("test_read_target_from_file");
    test_read_target_from_file();
    _mu_test_postprocess();
  } while (0);
}


x86 assembly (clang, -O0):
<test_target>:
push   %rbp
mov    %rsp,%rbp
jmp    1139 <test_target+0x9>
lea    0xec0(%rip),%rdi
call   1040 <_mu_test_preprocess@plt>
mov    $0x0,%al
call   1030 <test_read_target_from_file@plt>
mov    $0x0,%al
call   1050 <_mu_test_postprocess@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_target>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <_mu_test_preprocess@plt>
xor    %eax,%eax
call   1030 <test_read_target_from_file@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <_mu_test_postprocess@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"test_read_target_from_file\00"
define void @test_target() {
br label %1
1: ; preds = %0
%2 = call i32 @_mu_test_preprocess(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @test_read_target_from_file()
%4 = call i32 (...) @_mu_test_postprocess()
br label %5
5: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"test_read_target_from_file\00"
define void @test_target() {
%1 = tail call i32 @_mu_test_preprocess(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @test_read_target_from_file()
%3 = tail call i32 (...) @_mu_test_postprocess()
ret void
}
double cube(double d) { return (d * d * d); }


x86 assembly (clang, -O0):
<cube>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cube>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @cube(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @cube(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double);
double rint(double);
int main(void) {
  double d1, d2;
  d1 = 0.6;
  d2 = rint(d1);
  printf("d1 = %f, d2 = %f\n", d1, d2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <rint@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"d1 = %f, d2 = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 6.000000e-01, double* %2
%4 = load double, double* %2
%5 = call double @llvm.rint.f64(double %4)
store double %5, double* %3
%6 = load double, double* %2
%7 = load double, double* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double %6, double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"d1 = %f, d2 = %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double 6.000000e-01, double 1.000000e+00)
ret i32 0
}
/* Variables and functions */
double tanh(double);
double coth(double x) { return 1.0 / tanh(x); }


x86 assembly (clang, -O0):
<coth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <tanh@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coth>:
push   %rax
call   1030 <tanh@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @coth(double %0) {
%2 = tail call double @tanh(double %0)
%3 = fdiv double 1.000000e+00, %2
ret double %3
}
/* Type definitions */
typedef scalar_t__ const int64_t;

/* Variables and functions */
__attribute__((always_)) int64_t sub64(const int64_t a, const int64_t b) {
  return a - b;
}


x86 assembly (clang, -O0):
<sub64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub64>:
mov    %rdi,%rax
sub    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @sub64(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 = sub nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @sub64(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
ret i64 %3
}
int test_imm_B8int64_highword_reg(long long val) {
  return ((val >> 32) & (0xB8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B8int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0xb8,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B8int64_highword_reg>:
movabs $0xb800000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B8int64_highword_reg(i64 %0) {
%2 = and i64 %0, 790273982464
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ glLoadPaletteFromModelViewMatrixOES();
void qglLoadPaletteFromModelViewMatrixOES(void) {
  glLoadPaletteFromModelViewMatrixOES();
}


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

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

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

LLVM IR (-O2):
define void @qglLoadPaletteFromModelViewMatrixOES() {
%1 = tail call i32 (...) @glLoadPaletteFromModelViewMatrixOES()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
int yes_no(char *question) {
  char answer[3];
  printf("%s? (y/n): ", question);
  fgets(answer, 3, stdin);
  return answer[0] == 'y';
}


x86 assembly (clang, -O0):
<yes_no>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    -0xb(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%esi
call   1040 <fgets@plt>
movsbl -0xb(%rbp),%eax
cmp    $0x79,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yes_no>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
lea    0x5(%rsp),%rdi
mov    $0x3,%esi
call   1040 <fgets@plt>
xor    %eax,%eax
cmpb   $0x79,0x5(%rsp)
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%s? (y/n): \00"
@stdin = global i32 0
define i32 @yes_no(i8* %0) {
%2 = alloca i8*
%3 = alloca [3 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %6, i32 3, i32 %7)
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 121
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s? (y/n): \00"
@stdin = global i32 0
define i32 @yes_no(i8* %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %3, i32 3, i32 %5)
%7 = load i8, i8* %3
%8 = icmp eq i8 %7, 121
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
double distorter_init() { srand(time(0)); }


x86 assembly (clang, -O0):
<distorter_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distorter_init>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define double @distorter_init() {
%1 = alloca double
%2 = call i32 @time(i32 0)
%3 = call i32 @srand(i32 %2)
%4 = load double, double* %1
ret double %4
}

LLVM IR (-O2):
define double @distorter_init() {
%1 = tail call i32 @time(i32 0)
%2 = tail call i32 @srand(i32 %1)
ret double undef
}