xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ TimerStop(unsigned long);
void xTimerCounterDisable(unsigned long ulBase, unsigned long ulChannel) {
  TimerStop(ulBase);
}


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

x86 assembly (clang, -O2):
<xTimerCounterDisable>:
jmp    1030 <TimerStop@plt>

LLVM IR (-O0):
define void @xTimerCounterDisable(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 = call i32 @TimerStop(i64 %5)
ret void
}

LLVM IR (-O2):
define void @xTimerCounterDisable(i64 %0, i64 %1) {
%3 = tail call i32 @TimerStop(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void banner() {
  fprintf(stderr, "\nJarrett Host-To-Host Connector\n");
  fprintf(stderr,
          "Copyright(c) 2005 Angelo Dell'Aera <buffer@antifork.org>\n\n");
}


x86 assembly (clang, -O0):
<banner>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xee8(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<banner>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef2(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"\0AJarrett Host-To-Host Connector\0A\00"
@.str.1 = [59 x i8] c"Copyright(c) 2005 Angelo Dell'Aera <buffer@antifork.org>\0A\0A\00"
define void @banner() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"\0AJarrett Host-To-Host Connector\0A\00"
@.str.1 = [59 x i8] c"Copyright(c) 2005 Angelo Dell'Aera <buffer@antifork.org>\0A\0A\00"
define void @banner() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int where_history();
query_latest_event_nr() { return where_history() + 1; }


x86 assembly (clang, -O0):
<query_latest_event_nr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <where_history@plt>
add    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @query_latest_event_nr() {
%1 = call i32 (...) @where_history()
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @query_latest_event_nr() {
%1 = tail call i32 (...) @where_history()
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ extern_dcl();
int /*<<< orphan*/ func_dcl();
int /*<<< orphan*/ proc_dcl();
int yyselect();
func_proc() {
  switch (yyselect()) {
  case 6: {
    func_dcl();
  } break;
  case 7: {
    proc_dcl();
  } break;
  case 8: {
    extern_dcl();
  } break;
  }
}


x86 assembly (clang, -O0):
<func_proc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <yyselect@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0x6,%eax
je     1184 <func_proc+0x44>
jmp    1162 <func_proc+0x22>
mov    -0x8(%rbp),%eax
sub    $0x7,%eax
je     1190 <func_proc+0x50>
jmp    1173 <func_proc+0x33>
mov    -0x8(%rbp),%eax
sub    $0x8,%eax
je     119c <func_proc+0x5c>
jmp    11a3 <func_proc+0x63>
mov    $0x0,%al
call   1050 <func_dcl@plt>
jmp    11a3 <func_proc+0x63>
mov    $0x0,%al
call   1030 <proc_dcl@plt>
jmp    11a3 <func_proc+0x63>
mov    $0x0,%al
call   1060 <extern_dcl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_proc>:
push   %rax
xor    %eax,%eax
call   1040 <yyselect@plt>
cmp    $0x8,%eax
je     1160 <func_proc+0x20>
cmp    $0x7,%eax
je     1169 <func_proc+0x29>
cmp    $0x6,%eax
jne    1167 <func_proc+0x27>
xor    %eax,%eax
call   1050 <func_dcl@plt>
pop    %rcx
ret
xor    %eax,%eax
call   1060 <extern_dcl@plt>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <proc_dcl@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @func_proc() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %9 [
i32 6, label %3
i32 7, label %5
i32 8, label %7
]
3: ; preds = %0
%4 = call i32 (...) @func_dcl()
br label %9
5: ; preds = %0
%6 = call i32 (...) @proc_dcl()
br label %9
7: ; preds = %0
%8 = call i32 (...) @extern_dcl()
br label %9
9: ; preds = %0, %7, %5, %3
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @func_proc() {
%1 = tail call i32 (...) @yyselect()
switch i32 %1, label %8 [
i32 6, label %2
i32 7, label %4
i32 8, label %6
]
2: ; preds = %0
%3 = tail call i32 (...) @func_dcl()
br label %8
4: ; preds = %0
%5 = tail call i32 (...) @proc_dcl()
br label %8
6: ; preds = %0
%7 = tail call i32 (...) @extern_dcl()
br label %8
8: ; preds = %0, %6, %4, %2
ret i32 undef
}
/* Variables and functions */
int isascii(char);
int _eml_parse822_is_char(char c) { return isascii(c); }


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

x86 assembly (clang, -O2):
<_eml_parse822_is_char>:
jmp    1030 <isascii@plt>

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

LLVM IR (-O2):
define i32 @_eml_parse822_is_char(i8 signext %0) {
%2 = tail call i32 @isascii(i8 signext %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_significandl();
scalar_t__ significandl(long double);
void test_significandl(long double ld) {
  if (significandl(ld) != significandl(ld))
    link_failure_significandl();
}


x86 assembly (clang, -O0):
<test_significandl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <significandl@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <significandl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_significandl+0x43>
mov    $0x0,%al
call   1030 <link_failure_significandl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_significandl>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1040 <significandl@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1040 <significandl@plt>
cmp    %rax,%rbx
jne    1151 <test_significandl+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1030 <link_failure_significandl@plt>

LLVM IR (-O0):
define void @test_significandl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @significandl(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @significandl(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_significandl()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_significandl(x86_fp80 %0) {
%2 = tail call i64 @significandl(x86_fp80 %0)
%3 = tail call i64 @significandl(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_significandl()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ joystick_update_hal();
void joystick_update(void) { joystick_update_hal(); }


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

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

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

LLVM IR (-O2):
define void @joystick_update() {
%1 = tail call i32 (...) @joystick_update_hal()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void printerr(char *s) { fprintf(stderr, "ERROR: %s\n", s); }


x86 assembly (clang, -O0):
<printerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printerr>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @printerr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @printerr(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
char add() {
  int age;
  return '0';
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    $0x30,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
mov    $0x30,%al
ret

LLVM IR (-O0):
define signext i8 @add() {
%1 = alloca i32
ret i8 48
}

LLVM IR (-O2):
define signext i8 @add() {
ret i8 48
}
/* Variables and functions */
int /*<<< orphan*/ get_lexval();
int yyselect();
gotofunc() {
  switch (yyselect()) {
  case 96: {
    get_lexval();
    get_lexval();
  } break;
  }
}


x86 assembly (clang, -O0):
<gotofunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <yyselect@plt>
sub    $0x60,%eax
jne    114b <gotofunc+0x2b>
jmp    113d <gotofunc+0x1d>
mov    $0x0,%al
call   1040 <get_lexval@plt>
mov    $0x0,%al
call   1040 <get_lexval@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotofunc>:
push   %rax
xor    %eax,%eax
call   1030 <yyselect@plt>
cmp    $0x60,%eax
jne    113b <gotofunc+0x1b>
xor    %eax,%eax
call   1040 <get_lexval@plt>
xor    %eax,%eax
call   1040 <get_lexval@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @gotofunc() {
%1 = tail call i32 (...) @yyselect()
%2 = icmp eq i32 %1, 96
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 (...) @get_lexval()
%5 = tail call i32 (...) @get_lexval()
br label %6
6: ; preds = %0, %3
ret i32 undef
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main() {
  fputs("Hello", stdout);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
lea    0xed1(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ postorderBST(struct node *, int *, int);
void postorder(struct node *root, int *arr) { postorderBST(root, arr, 1); }


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

x86 assembly (clang, -O2):
<postorder>:
mov    $0x1,%edx
jmp    1030 <postorderBST@plt>

LLVM IR (-O0):
%struct.node = type { i32 }
define void @postorder(%struct.node* %0, i32* %1) {
%3 = alloca %struct.node*
%4 = alloca i32*
store %struct.node* %0, %struct.node** %3
store i32* %1, i32** %4
%5 = load %struct.node*, %struct.node** %3
%6 = load i32*, i32** %4
%7 = call i32 @postorderBST(%struct.node* %5, i32* %6, i32 1)
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @postorder(%struct.node* %0, i32* %1) {
%3 = tail call i32 @postorderBST(%struct.node* %0, i32* %1, i32 1)
ret void
}
int isonum_711(char *p) { return (*p & 0xff); }


x86 assembly (clang, -O0):
<isonum_711>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isonum_711>:
movzbl (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @isonum_711(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
ret i32 %3
}
int _failed_test_case(int option, int reset) {
  static int count = 0;
  if (reset)
    count = option;
  else
    count += option;
  return count;
}


x86 assembly (clang, -O0):
<_failed_test_case>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1122 <_failed_test_case+0x22>
mov    -0x4(%rbp),%eax
mov    %eax,0x2f07(%rip)
jmp    1131 <_failed_test_case+0x31>
mov    -0x4(%rbp),%eax
add    0x2ef9(%rip),%eax
mov    %eax,0x2ef3(%rip)
mov    0x2eed(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_failed_test_case>:
xor    %eax,%eax
test   %esi,%esi
jne    110c <_failed_test_case+0xc>
mov    0x2f18(%rip),%eax
add    %edi,%eax
mov    %eax,0x2f10(%rip)
ret

LLVM IR (-O0):
@_failed_test_case.count = internal global i32 0
define i32 @_failed_test_case(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32, i32* %3
store i32 %8, i32* @_failed_test_case.count
br label %13
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* @_failed_test_case.count
%12 = add nsw i32 %11, %10
store i32 %12, i32* @_failed_test_case.count
br label %13
13: ; preds = %9, %7
%14 = load i32, i32* @_failed_test_case.count
ret i32 %14
}

LLVM IR (-O2):
@_failed_test_case.count = internal unnamed_addr global i32 0
define i32 @_failed_test_case(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = load i32, i32* @_failed_test_case.count
%5 = select i1 %3, i32 %4, i32 0
%6 = add nsw i32 %5, %0
store i32 %6, i32* @_failed_test_case.count
ret i32 %6
}
/* Variables and functions */
int bar(int, int);
int foo(int, int);
int main(int argc, char **argv) {
  int a = argc;
  a = foo(a, a);
  a = bar(a, a);
  a = foo(a, a);
  return a;
}


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)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <foo@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <bar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <foo@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%esi
call   1040 <foo@plt>
mov    %eax,%edi
mov    %eax,%esi
call   1030 <bar@plt>
mov    %eax,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <foo@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @foo(i32 %8, i32 %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = load i32, i32* %6
%13 = call i32 @bar(i32 %11, i32 %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %6
%16 = call i32 @foo(i32 %14, i32 %15)
store i32 %16, i32* %6
%17 = load i32, i32* %6
ret i32 %17
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 %0, i32 %0)
%4 = tail call i32 @bar(i32 %3, i32 %3)
%5 = tail call i32 @foo(i32 %4, i32 %4)
ret i32 %5
}
int nl_socket(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @nl_socket() {
ret i32 -1
}
_Bool audio_close(void *handle) { return 0; }


x86 assembly (clang, -O0):
<audio_close>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i1 @audio_close(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i1 false
}

LLVM IR (-O2):
define zeroext i1 @audio_close(i8* nocapture readnone %0) {
ret i1 false
}
/* Type definitions */
struct exfat_de_iter {
  int dummy;
};

/* Variables and functions */
int ENOTSUP;
int read_ahead_next_dir_blocks(struct exfat_de_iter *iter) { return -ENOTSUP; }


x86 assembly (clang, -O0):
<read_ahead_next_dir_blocks>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ed7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_ahead_next_dir_blocks>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.exfat_de_iter = type { i32 }
@ENOTSUP = global i32 0
define i32 @read_ahead_next_dir_blocks(%struct.exfat_de_iter* %0) {
%2 = alloca %struct.exfat_de_iter*
store %struct.exfat_de_iter* %0, %struct.exfat_de_iter** %2
%3 = load i32, i32* @ENOTSUP
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
%struct.exfat_de_iter = type { i32 }
@ENOTSUP = global i32 0
define i32 @read_ahead_next_dir_blocks(%struct.exfat_de_iter* nocapture readnone %0) {
%2 = load i32, i32* @ENOTSUP
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
long cfgDataSet(char *, char *, char *, char *);
int /*<<< orphan*/ cfgDbName(int, char *);
long cfgDbDataSet(int iDbId, char *sSect, char *sKey, char *sData) {
  char sDbName[32];
  if (cfgDbName(iDbId, sDbName) == (0))
    return (-1);
  return cfgDataSet(sDbName, sSect, sKey, sData);
}


x86 assembly (clang, -O0):
<cfgDbDataSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x50(%rbp),%rsi
call   1030 <cfgDbName@plt>
cmp    $0x0,%eax
jne    1159 <cfgDbDataSet+0x39>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1172 <cfgDbDataSet+0x52>
lea    -0x50(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1040 <cfgDataSet@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfgDbDataSet>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rsp,%rsi
call   1030 <cfgDbName@plt>
test   %eax,%eax
je     1151 <cfgDbDataSet+0x31>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1040 <cfgDataSet@plt>
jmp    1158 <cfgDbDataSet+0x38>
mov    $0xffffffffffffffff,%rax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @cfgDbDataSet(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i64
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca [32 x i8]
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
%11 = load i32, i32* %6
%12 = getelementptr inbounds [32 x i8], [32 x i8]* %10, i64 0, i64 0
%13 = call i32 @cfgDbName(i32 %11, i8* %12)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %4
store i64 -1, i64* %5
br label %22
16: ; preds = %4
%17 = getelementptr inbounds [32 x i8], [32 x i8]* %10, i64 0, i64 0
%18 = load i8*, i8** %7
%19 = load i8*, i8** %8
%20 = load i8*, i8** %9
%21 = call i64 @cfgDataSet(i8* %17, i8* %18, i8* %19, i8* %20)
store i64 %21, i64* %5
br label %22
22: ; preds = %16, %15
%23 = load i64, i64* %5
ret i64 %23
}

LLVM IR (-O2):
define i64 @cfgDbDataSet(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca [32 x i8]
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = call i32 @cfgDbName(i32 %0, i8* %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = call i64 @cfgDataSet(i8* %6, i8* %1, i8* %2, i8* %3)
br label %11
11: ; preds = %4, %9
%12 = phi i64 [ %10, %9 ], [ -1, %4 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ constdata(int);
void prmb(void) { constdata(1); }


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

x86 assembly (clang, -O2):
<prmb>:
mov    $0x1,%edi
jmp    1030 <constdata@plt>

LLVM IR (-O0):
define void @prmb() {
%1 = call i32 @constdata(i32 1)
ret void
}

LLVM IR (-O2):
define void @prmb() {
%1 = tail call i32 @constdata(i32 1)
ret void
}
/* Variables and functions */
int foobar(int);
int testStaticImplicit(void) { return foobar(3); }


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

x86 assembly (clang, -O2):
<testStaticImplicit>:
mov    $0x3,%edi
jmp    1030 <foobar@plt>

LLVM IR (-O0):
define i32 @testStaticImplicit() {
%1 = call i32 @foobar(i32 3)
ret i32 %1
}

LLVM IR (-O2):
define i32 @testStaticImplicit() {
%1 = tail call i32 @foobar(i32 3)
ret i32 %1
}
/* Type definitions */
struct nlattr {
  int dummy;
};
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
scalar_t__ nla_data(struct nlattr const *);
__u32 nla_get_u32(const struct nlattr *nla) { return *(__u32 *)nla_data(nla); }


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

x86 assembly (clang, -O2):
<nla_get_u32>:
push   %rax
call   1030 <nla_data@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.nlattr = type { i32 }
define i32 @nla_get_u32(%struct.nlattr* %0) {
%2 = alloca %struct.nlattr*
store %struct.nlattr* %0, %struct.nlattr** %2
%3 = load %struct.nlattr*, %struct.nlattr** %2
%4 = call i64 @nla_data(%struct.nlattr* %3)
%5 = inttoptr i64 %4 to i32*
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.nlattr = type { i32 }
define i32 @nla_get_u32(%struct.nlattr* %0) {
%2 = tail call i64 @nla_data(%struct.nlattr* %0)
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
scalar_t__ blk_oversized_queue_5(int *);
int __attribute__((no)) get_request_5(int *q, int rw) {
  if (blk_oversized_queue_5(q)) {
    if ((rw == 1) || (rw == 0))
      return -33;
    return 0;
  }
  return -100;
}


x86 assembly (clang, -O0):
<get_request_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <blk_oversized_queue_5@plt>
cmp    $0x0,%rax
je     115e <get_request_5+0x4e>
cmpl   $0x1,-0x14(%rbp)
je     1146 <get_request_5+0x36>
cmpl   $0x0,-0x14(%rbp)
jne    1152 <get_request_5+0x42>
movl   $0xffffffdf,-0x4(%rbp)
jmp    1165 <get_request_5+0x55>
movl   $0x0,-0x4(%rbp)
jmp    1165 <get_request_5+0x55>
movl   $0xffffff9c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_request_5>:
push   %rbx
mov    %esi,%ebx
call   1030 <blk_oversized_queue_5@plt>
xor    %ecx,%ecx
cmp    $0x2,%ebx
mov    $0xffffffdf,%edx
cmovae %ecx,%edx
test   %rax,%rax
mov    $0xffffff9c,%eax
cmovne %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_request_5(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32*, i32** %4
%7 = call i64 @blk_oversized_queue_5(i32* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 1
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %5
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12, %9
store i32 -33, i32* %3
br label %18
16: ; preds = %12
store i32 0, i32* %3
br label %18
17: ; preds = %2
store i32 -100, i32* %3
br label %18
18: ; preds = %17, %16, %15
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @get_request_5(i32* %0, i32 %1) {
%3 = tail call i64 @blk_oversized_queue_5(i32* %0)
%4 = icmp eq i64 %3, 0
%5 = icmp ult i32 %1, 2
%6 = select i1 %5, i32 -33, i32 0
%7 = select i1 %4, i32 -100, i32 %6
ret i32 %7
}
int _strlen(const char *string) {
  int length = 0;
  while (*string != '\0') {
    string++;
    length++;
  };
  return length;
}


x86 assembly (clang, -O0):
<_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <_strlen+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strlen>:
cmpb   $0x0,(%rdi)
je     111c <_strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
int main(void) {
  volatile const unsigned long int o = 1UL;
  int zero = 0;
  o / 0;
  1UL / 0;
  1UL / zero;
  o / zero;
  o / (++zero - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movq   $0x1,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    -0x8(%rsp),%rax
mov    -0x8(%rsp),%rax
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
store i32 0, i32* %1
store volatile i64 1, i64* %2
store i32 0, i32* %3
%4 = load volatile i64, i64* %2
%5 = udiv i64 %4, 0
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = udiv i64 1, %7
%9 = load volatile i64, i64* %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = udiv i64 %9, %11
%13 = load volatile i64, i64* %2
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
%16 = sub nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = udiv i64 %13, %17
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store volatile i64 1, i64* %1
%3 = load volatile i64, i64* %1
%4 = load volatile i64, i64* %1
%5 = load volatile i64, i64* %1
ret i32 0
}
void BIO_set_flags(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_set_flags() {
ret void
}
void call___do_global_dtors_aux() { return; }


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

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

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

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

/* Variables and functions */
struct share_mem *get_share_mem();
int offset_of_trout_addr(void *);
void *__from_trout_addr(void *trout_addr) {
  struct share_mem *mem = get_share_mem();
  return (void *)mem + offset_of_trout_addr(trout_addr);
}


x86 assembly (clang, -O0):
<__from_trout_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_share_mem@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <offset_of_trout_addr@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__from_trout_addr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <get_share_mem@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <offset_of_trout_addr@plt>
cltq
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.share_mem = type { i32 }
define i8* @__from_trout_addr(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.share_mem*
store i8* %0, i8** %2
%4 = call %struct.share_mem* (...) @get_share_mem()
store %struct.share_mem* %4, %struct.share_mem** %3
%5 = load %struct.share_mem*, %struct.share_mem** %3
%6 = bitcast %struct.share_mem* %5 to i8*
%7 = load i8*, i8** %2
%8 = call i32 @offset_of_trout_addr(i8* %7)
%9 = sext i32 %8 to i64
%10 = getelementptr i8, i8* %6, i64 %9
ret i8* %10
}

LLVM IR (-O2):
%struct.share_mem = type { i32 }
define i8* @__from_trout_addr(i8* %0) {
%2 = tail call %struct.share_mem* (...) @get_share_mem()
%3 = bitcast %struct.share_mem* %2 to i8*
%4 = tail call i32 @offset_of_trout_addr(i8* %0)
%5 = sext i32 %4 to i64
%6 = getelementptr i8, i8* %3, i64 %5
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ ObjectPersistenceHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void ObjectPersistenceUpdated() { UAVObjUpdated(ObjectPersistenceHandle()); }


x86 assembly (clang, -O0):
<ObjectPersistenceUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ObjectPersistenceHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ObjectPersistenceUpdated() {
%1 = call i32 (...) @ObjectPersistenceHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @ObjectPersistenceUpdated() {
%1 = tail call i32 (...) @ObjectPersistenceHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void error(char *file, int line, int etype, char *fmt, ...) {
  printf("error\n");
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [6 x i8] c"error\00"
define void @error(i8* nocapture readnone %0, i32 %1, i32 %2, i8* nocapture readnone %3, ...) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *);
int main() {
  FILE *fp;
  fp = fopen("test1", "bw");
  if (fp == NULL) {
    printf("File opening failed\n");
  } else {
    printf("File opening succeeded\n");
  }
  fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1172 <main+0x42>
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
jmp    117e <main+0x4e>
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xec7(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
lea    0xecf(%rip),%rax
lea    0xeb1(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"test1\00"
@.str.1 = [3 x i8] c"bw\00"
@.str.2 = [21 x i8] c"File opening failed\0A\00"
@.str.3 = [24 x i8] c"File opening succeeded\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = load i32*, i32** %2
%12 = call i32 @fclose(i32* %11)
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [6 x i8] c"test1\00"
@.str.1 = [3 x i8] c"bw\00"
@str = [23 x i8] c"File opening succeeded\00"
@str.4 = [20 x i8] c"File opening failed\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
%5 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Type definitions */
struct group {
  int /*<<< orphan*/ gr_name;
};
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ _itoa(int /*<<< orphan*/);
struct group *getgrgid(int /*<<< orphan*/);
int /*<<< orphan*/ writesn(int /*<<< orphan*/);
void writeg(gid_t g) {
  struct group *gp;
  gp = getgrgid(g);
  if (gp)
    writesn(gp->gr_name);
  else
    writesn(_itoa(g));
}


x86 assembly (clang, -O0):
<writeg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <getgrgid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1162 <writeg+0x32>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <writesn@plt>
jmp    1171 <writeg+0x41>
mov    -0x4(%rbp),%edi
call   1050 <_itoa@plt>
mov    %eax,%edi
call   1030 <writesn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeg>:
push   %rbx
mov    %edi,%ebx
call   1040 <getgrgid@plt>
test   %rax,%rax
je     1145 <writeg+0x15>
mov    (%rax),%edi
pop    %rbx
jmp    1030 <writesn@plt>
mov    %ebx,%edi
call   1050 <_itoa@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <writesn@plt>

LLVM IR (-O0):
%struct.group = type { i32 }
define void @writeg(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.group*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.group* @getgrgid(i32 %4)
store %struct.group* %5, %struct.group** %3
%6 = load %struct.group*, %struct.group** %3
%7 = icmp ne %struct.group* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load %struct.group*, %struct.group** %3
%10 = getelementptr inbounds %struct.group, %struct.group* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @writesn(i32 %11)
br label %17
13: ; preds = %1
%14 = load i32, i32* %2
%15 = call i32 @_itoa(i32 %14)
%16 = call i32 @writesn(i32 %15)
br label %17
17: ; preds = %13, %8
ret void
}

LLVM IR (-O2):
%struct.group = type { i32 }
define void @writeg(i32 %0) {
%2 = tail call %struct.group* @getgrgid(i32 %0)
%3 = icmp eq %struct.group* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.group, %struct.group* %2, i64 0, i32 0
%6 = load i32, i32* %5
br label %9
7: ; preds = %1
%8 = tail call i32 @_itoa(i32 %0)
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %8, %7 ], [ %6, %4 ]
%11 = tail call i32 @writesn(i32 %10)
ret void
}
/* Variables and functions */
float logf(float const);
float log256f(const float x) { return logf(x) / logf(256); }


x86 assembly (clang, -O0):
<log256f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <logf@plt>
movss  %xmm0,-0x8(%rbp)
movss  0xecc(%rip),%xmm0
call   1030 <logf@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log256f>:
push   %rax
call   1030 <logf@plt>
divss  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @log256f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @logf(float %3)
%5 = call float @logf(float 2.560000e+02)
%6 = fdiv float %4, %5
ret float %6
}

LLVM IR (-O2):
define float @log256f(float %0) {
%2 = tail call float @logf(float %0)
%3 = fdiv float %2, 0x40162E4300000000
ret float %3
}
int rubiksnotation(char x) {
  switch (x) {
  case 'U':
    return 0;
  case 'L':
    return 1;
  case 'F':
    return 2;
  case 'R':
    return 3;
  case 'B':
    return 4;
  case 'D':
    return 5;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<rubiksnotation>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbe,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x13,%eax
ja     117c <rubiksnotation+0x7c>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    1183 <rubiksnotation+0x83>
movl   $0x1,-0x4(%rbp)
jmp    1183 <rubiksnotation+0x83>
movl   $0x2,-0x4(%rbp)
jmp    1183 <rubiksnotation+0x83>
movl   $0x3,-0x4(%rbp)
jmp    1183 <rubiksnotation+0x83>
movl   $0x4,-0x4(%rbp)
jmp    1183 <rubiksnotation+0x83>
movl   $0x5,-0x4(%rbp)
jmp    1183 <rubiksnotation+0x83>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rubiksnotation>:
add    $0xffffffbe,%edi
cmp    $0x13,%edi
ja     1120 <rubiksnotation+0x20>
xor    %eax,%eax
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x4,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x5,%eax
ret
mov    $0x2,%eax
ret
mov    $0x1,%eax
ret
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @rubiksnotation(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %12 [
i32 85, label %6
i32 76, label %7
i32 70, label %8
i32 82, label %9
i32 66, label %10
i32 68, label %11
]
6: ; preds = %1
store i32 0, i32* %2
br label %13
7: ; preds = %1
store i32 1, i32* %2
br label %13
8: ; preds = %1
store i32 2, i32* %2
br label %13
9: ; preds = %1
store i32 3, i32* %2
br label %13
10: ; preds = %1
store i32 4, i32* %2
br label %13
11: ; preds = %1
store i32 5, i32* %2
br label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @rubiksnotation(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %8 [
i32 85, label %9
i32 76, label %3
i32 70, label %4
i32 82, label %5
i32 66, label %6
i32 68, label %7
]
3: ; preds = %1
br label %9
4: ; preds = %1
br label %9
5: ; preds = %1
br label %9
6: ; preds = %1
br label %9
7: ; preds = %1
br label %9
8: ; preds = %1
br label %9
9: ; preds = %1, %8, %7, %6, %5, %4, %3
%10 = phi i32 [ -1, %8 ], [ 5, %7 ], [ 4, %6 ], [ 3, %5 ], [ 2, %4 ], [ 1, %3 ], [ 0, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() { printf("Help"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"Help\00"
define void @print_help() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ d0_blind_id_util_sha256(char *, char const *, size_t);
const unsigned char *sha(unsigned char *h, const unsigned char *in,
                         size_t len) {
  d0_blind_id_util_sha256((char *)h, (const char *)in, len);
  return h;
}


x86 assembly (clang, -O0):
<sha>:
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 <d0_blind_id_util_sha256@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha>:
push   %rbx
mov    %rdi,%rbx
call   1030 <d0_blind_id_util_sha256@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @sha(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @d0_blind_id_util_sha256(i8* %7, i8* %8, i64 %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
define i8* @sha(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @d0_blind_id_util_sha256(i8* %0, i8* %1, i64 %2)
ret i8* %0
}
/* Variables and functions */
double __ieee754_exp(double);
double jexp(double x) { return __ieee754_exp(x); }


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

x86 assembly (clang, -O2):
<jexp>:
jmp    1030 <__ieee754_exp@plt>

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

LLVM IR (-O2):
define double @jexp(double %0) {
%2 = tail call double @__ieee754_exp(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ stderr;
void waitEnter(void) {
  fprintf(stderr, "Press enter to continue...\n");
  getchar();
}


x86 assembly (clang, -O0):
<waitEnter>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitEnter>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <getchar@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Press enter to continue...\0A\00"
define void @waitEnter() {
%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 (...) @getchar()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Press enter to continue...\0A\00"
define void @waitEnter() {
%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 (...) @getchar()
ret void
}