xunge/DecIR huggingface dataset:
int main() {
  int i;
  int j;
  i = 0;
  j = 3;
  while (i < 10) {
    while (j < 12) {
      j = j - 1;
      j = j + 2;
    }
    i = i + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1157 <main+0x57>
jmp    1128 <main+0x28>
cmpl   $0xc,-0xc(%rbp)
jge    1149 <main+0x49>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <main+0x28>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char *ptbl_get_cp_username();
char *ptbl_get_cp_userrealname(void) { return ptbl_get_cp_username(); }


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

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

LLVM IR (-O0):
define i8* @ptbl_get_cp_userrealname() {
%1 = call i8* (...) @ptbl_get_cp_username()
ret i8* %1
}

LLVM IR (-O2):
define i8* @ptbl_get_cp_userrealname() {
%1 = tail call i8* (...) @ptbl_get_cp_username()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void form_output_remember_keystrokes_button(char *control_string) {
  printf("<td><input type=\"button\" value=\"Recall\" onClick=\"%s\">\n",
         control_string);
}


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

x86 assembly (clang, -O2):
<form_output_remember_keystrokes_button>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"<td><input type=\22button\22 value=\22Recall\22 onClick=\22%s\22>\0A\00"
define void @form_output_remember_keystrokes_button(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"<td><input type=\22button\22 value=\22Recall\22 onClick=\22%s\22>\0A\00"
define void @form_output_remember_keystrokes_button(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ changeFont(void *);
void callChangeFont(int carg, void **pargs) { changeFont(pargs[1]); }


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

x86 assembly (clang, -O2):
<callChangeFont>:
mov    0x8(%rsi),%rdi
jmp    1030 <changeFont@plt>

LLVM IR (-O0):
define void @callChangeFont(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @changeFont(i8* %7)
ret void
}

LLVM IR (-O2):
define void @callChangeFont(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @changeFont(i8* %4)
ret void
}
void ps3av_cmd_av_monitor_info_dump(
    const struct ps3av_pkt_av_get_monitor_info *monitor_info) {}


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

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

LLVM IR (-O0):
%struct.ps3av_pkt_av_get_monitor_info = type opaque
define void @ps3av_cmd_av_monitor_info_dump(%struct.ps3av_pkt_av_get_monitor_info* %0) {
%2 = alloca %struct.ps3av_pkt_av_get_monitor_info*
store %struct.ps3av_pkt_av_get_monitor_info* %0, %struct.ps3av_pkt_av_get_monitor_info** %2
ret void
}

LLVM IR (-O2):
%struct.ps3av_pkt_av_get_monitor_info = type opaque
define void @ps3av_cmd_av_monitor_info_dump(%struct.ps3av_pkt_av_get_monitor_info* nocapture %0) {
ret void
}
int maxcifra(int n) {
  int maxCifra;
  maxCifra = n % 10;
  n /= 10;
  while (n) {
    if ((n % 10) > maxCifra)
      maxCifra = n % 10;
    n /= 10;
  }
  return maxCifra;
}


x86 assembly (clang, -O0):
<maxcifra>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1162 <maxcifra+0x62>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    -0x8(%rbp),%edx
jle    114f <maxcifra+0x4f>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1123 <maxcifra+0x23>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxcifra>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%edx
mov    %eax,%r8d
sub    %edx,%r8d
add    $0x9,%eax
cmp    $0x13,%eax
jae    1130 <maxcifra+0x30>
mov    %r8d,%eax
ret
xchg   %ax,%ax
movslq %edi,%rax
imul   $0x66666667,%rax,%rdx
mov    %rdx,%r9
shr    $0x3f,%r9
sar    $0x22,%rdx
lea    (%rdx,%r9,1),%edi
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rcx
add    %esi,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cmp    %r8d,%eax
cmovle %r8d,%eax
lea    (%rdx,%r9,1),%ecx
add    $0x9,%ecx
mov    %eax,%r8d
cmp    $0x12,%ecx
ja     1130 <maxcifra+0x30>
ret

LLVM IR (-O0):
define i32 @maxcifra(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 10
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 10
store i32 %7, i32* %2
br label %8
8: ; preds = %19, %1
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = load i32, i32* %2
%13 = srem i32 %12, 10
%14 = load i32, i32* %3
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %19
16: ; preds = %11
%17 = load i32, i32* %2
%18 = srem i32 %17, 10
store i32 %18, i32* %3
br label %19
19: ; preds = %16, %11
%20 = load i32, i32* %2
%21 = sdiv i32 %20, 10
store i32 %21, i32* %2
br label %8
22: ; preds = %8
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @maxcifra(i32 %0) {
%2 = srem i32 %0, 10
%3 = add i32 %0, 9
%4 = icmp ult i32 %3, 19
br i1 %4, label %14, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ %0, %1 ]
%7 = phi i32 [ %11, %5 ], [ %2, %1 ]
%8 = sdiv i32 %6, 10
%9 = srem i32 %8, 10
%10 = icmp sgt i32 %9, %7
%11 = select i1 %10, i32 %9, i32 %7
%12 = add nsw i32 %8, 9
%13 = icmp ult i32 %12, 19
br i1 %13, label %14, label %5
14: ; preds = %5, %1
%15 = phi i32 [ %2, %1 ], [ %11, %5 ]
ret i32 %15
}
/* Variables and functions */
scalar_t__ GLeeInit();
int /*<<< orphan*/ pglEndTransformFeedbackNV();
void _Lazy_glEndTransformFeedbackNV(void) {
  if (GLeeInit())
    pglEndTransformFeedbackNV();
}


x86 assembly (clang, -O0):
<_Lazy_glEndTransformFeedbackNV>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GLeeInit@plt>
cmp    $0x0,%rax
je     113c <_Lazy_glEndTransformFeedbackNV+0x1c>
mov    $0x0,%al
call   1040 <pglEndTransformFeedbackNV@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Lazy_glEndTransformFeedbackNV>:
push   %rax
xor    %eax,%eax
call   1030 <GLeeInit@plt>
test   %rax,%rax
je     1135 <_Lazy_glEndTransformFeedbackNV+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pglEndTransformFeedbackNV@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @_Lazy_glEndTransformFeedbackNV() {
%1 = call i64 (...) @GLeeInit()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @pglEndTransformFeedbackNV()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @_Lazy_glEndTransformFeedbackNV() {
%1 = tail call i64 (...) @GLeeInit()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @pglEndTransformFeedbackNV()
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_mvinnwstr(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_mvinnwstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_mvinnwstr+0x2a>
jmp    1170 <cmd_mvinnwstr+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_mvinnwstr>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_mvinnwstr+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_mvinnwstr(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
void filter_add_sample(float *buffer, float sample, int bits,
                       uint32_t *offset) {
  uint32_t cnt_mask = 0xFFFFFFFF >> (32 - bits);
  buffer[*offset] = sample;
  *offset += 1;
  *offset &= cnt_mask;
}


x86 assembly (clang, -O0):
<filter_add_sample>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x20,%ecx
sub    -0x10(%rbp),%ecx
mov    $0xffffffff,%eax
shr    %cl,%eax
mov    %eax,%eax
mov    %rax,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
and    (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter_add_sample>:
mov    %esi,%ecx
mov    (%rdx),%rax
movss  %xmm0,(%rdi,%rax,4)
add    $0x1,%eax
neg    %cl
shl    %cl,%eax
shr    %cl,%eax
mov    %rax,(%rdx)
ret

LLVM IR (-O0):
define void @filter_add_sample(float* %0, float %1, i32 %2, i64* %3) {
%5 = alloca float*
%6 = alloca float
%7 = alloca i32
%8 = alloca i64*
%9 = alloca i64
store float* %0, float** %5
store float %1, float* %6
store i32 %2, i32* %7
store i64* %3, i64** %8
%10 = load i32, i32* %7
%11 = sub nsw i32 32, %10
%12 = lshr i32 -1, %11
%13 = zext i32 %12 to i64
store i64 %13, i64* %9
%14 = load float, float* %6
%15 = load float*, float** %5
%16 = load i64*, i64** %8
%17 = load i64, i64* %16
%18 = getelementptr inbounds float, float* %15, i64 %17
store float %14, float* %18
%19 = load i64*, i64** %8
%20 = load i64, i64* %19
%21 = add i64 %20, 1
store i64 %21, i64* %19
%22 = load i64, i64* %9
%23 = load i64*, i64** %8
%24 = load i64, i64* %23
%25 = and i64 %24, %22
store i64 %25, i64* %23
ret void
}

LLVM IR (-O2):
define void @filter_add_sample(float* nocapture writeonly %0, float %1, i32 %2, i64* nocapture %3) {
%5 = sub nsw i32 32, %2
%6 = lshr i32 -1, %5
%7 = zext i32 %6 to i64
%8 = load i64, i64* %3
%9 = getelementptr inbounds float, float* %0, i64 %8
store float %1, float* %9
%10 = add i64 %8, 1
%11 = and i64 %10, %7
store i64 %11, i64* %3
ret void
}
int ioCanCreatePathOfSize(char *pathString, int pathStringLength) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @ioCanCreatePathOfSize(i8* nocapture readnone %0, i32 %1) {
ret i32 1
}
unsigned long PRCMIntStatus() {
  return (*((volatile unsigned long *)(0x44025000 + 0x00000120)));
}


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

x86 assembly (clang, -O2):
<PRCMIntStatus>:
mov    0x44025120,%rax
44
ret

LLVM IR (-O0):
define i64 @PRCMIntStatus() {
%1 = load volatile i64, i64* inttoptr (i64 1141002528 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @PRCMIntStatus() {
%1 = load volatile i64, i64* inttoptr (i64 1141002528 to i64*)
ret i64 %1
}
/* Variables and functions */
unsigned int __VERIFIER_nondet_U32();
unsigned int ecrobot_get_gyro_sensor(unsigned char port) {
  unsigned int tmp;
  {
    tmp = __VERIFIER_nondet_U32();
    return (tmp);
  }
}


x86 assembly (clang, -O0):
<ecrobot_get_gyro_sensor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_U32@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ecrobot_get_gyro_sensor(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = call i32 (...) @__VERIFIER_nondet_U32()
store i32 %4, i32* %3
%5 = load i32, i32* %3
ret i32 %5
}

LLVM IR (-O2):
define i32 @ecrobot_get_gyro_sensor(i8 zeroext %0) {
%2 = tail call i32 (...) @__VERIFIER_nondet_U32()
ret i32 %2
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcat_s(char *, int, char *);
char *string_function_dynamic(char *astring) {
  char *s;
  s = malloc(20);
  s[0] = 0;
  strcat_s(s, 20, "Hello,");
  strcat_s(s, 20, astring);
  strcat_s(s, 20, "\n");
  return s;
}


x86 assembly (clang, -O0):
<string_function_dynamic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    $0x14,%esi
lea    0xeaf(%rip),%rdx
call   1030 <strcat_s@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x14,%esi
call   1030 <strcat_s@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%esi
lea    0xe8f(%rip),%rdx
call   1030 <strcat_s@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_function_dynamic>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movb   $0x0,(%rax)
lea    0xec2(%rip),%rdx
mov    %rax,%rdi
mov    $0x14,%esi
call   1030 <strcat_s@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
mov    %r14,%rdx
call   1030 <strcat_s@plt>
lea    0xea5(%rip),%rdx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1030 <strcat_s@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Hello,\00"
@.str.1 = [2 x i8] c"\0A\00"
define i8* @string_function_dynamic(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @malloc(i32 20)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 0, i8* %6
%7 = load i8*, i8** %3
%8 = call i32 @strcat_s(i8* %7, i32 20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcat_s(i8* %9, i32 20, i8* %10)
%12 = load i8*, i8** %3
%13 = call i32 @strcat_s(i8* %12, i32 20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [7 x i8] c"Hello,\00"
@.str.1 = [2 x i8] c"\0A\00"
define i8* @string_function_dynamic(i8* %0) {
%2 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
store i8 0, i8* %2
%3 = tail call i32 @strcat_s(i8* %2, i32 20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strcat_s(i8* %2, i32 20, i8* %0)
%5 = tail call i32 @strcat_s(i8* %2, i32 20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i8* %2
}
void exit_signal_handler(int signum) { return; }


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

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

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

LLVM IR (-O2):
define void @exit_signal_handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dprintf2(char *, void *, int, int);
int /*<<< orphan*/ expected_pkey_fault(int);
int read_ptr(void *);
void expect_fault_on_read_execonly_key(void *p1, int pkey) {
  int ptr_contents;
  ptr_contents = read_ptr(p1);
  dprintf2("ptr (%p) contents@%d: %x\n", p1, 173, ptr_contents);
  expected_pkey_fault(pkey);
}


x86 assembly (clang, -O0):
<expect_fault_on_read_execonly_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <read_ptr@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%ecx
lea    0xea7(%rip),%rdi
mov    $0xad,%edx
call   1040 <dprintf2@plt>
mov    -0xc(%rbp),%edi
call   1050 <expected_pkey_fault@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_fault_on_read_execonly_key>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <read_ptr@plt>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
mov    $0xad,%edx
mov    %eax,%ecx
call   1040 <dprintf2@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <expected_pkey_fault@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"ptr (%p) contents@%d: %x\0A\00"
define void @expect_fault_on_read_execonly_key(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @read_ptr(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = call i32 @dprintf2(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %8, i32 173, i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @expected_pkey_fault(i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"ptr (%p) contents@%d: %x\0A\00"
define void @expect_fault_on_read_execonly_key(i8* %0, i32 %1) {
%3 = tail call i32 @read_ptr(i8* %0)
%4 = tail call i32 @dprintf2(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i32 173, i32 %3)
%5 = tail call i32 @expected_pkey_fault(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("char *str_chop( char **s, char delim, char *prev_delim, char "
         "**prev_s )\n");
  printf("int rm_return ( char *s )\n");
  printf("int need_keyboard ()\n");
  printf("int openFH ( char *inFile, FILE **fh, char *type )\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [73 x i8] c"char *str_chop( char **s, char delim, char *prev_delim, char **prev_s )\0A\00"
@.str.1 = [27 x i8] c"int rm_return ( char *s )\0A\00"
@.str.2 = [22 x i8] c"int need_keyboard ()\0A\00"
@.str.3 = [52 x i8] c"int openFH ( char *inFile, FILE **fh, char *type )\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [72 x i8] c"char *str_chop( char **s, char delim, char *prev_delim, char **prev_s )\00"
@str.4 = [26 x i8] c"int rm_return ( char *s )\00"
@str.5 = [21 x i8] c"int need_keyboard ()\00"
@str.6 = [51 x i8] c"int openFH ( char *inFile, FILE **fh, char *type )\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
void iommu_del(struct iommu *iommu) {}


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

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

LLVM IR (-O0):
%struct.iommu = type opaque
define void @iommu_del(%struct.iommu* %0) {
%2 = alloca %struct.iommu*
store %struct.iommu* %0, %struct.iommu** %2
ret void
}

LLVM IR (-O2):
%struct.iommu = type opaque
define void @iommu_del(%struct.iommu* nocapture %0) {
ret void
}
int num_of_digits(int n) {
  int i = 1;
  if (n < 0)
    n = -n;
  while (n > 10) {
    n /= 10;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<num_of_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1120 <num_of_digits+0x20>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1125 <num_of_digits+0x25>
cmpl   $0xa,-0x4(%rbp)
jle    114b <num_of_digits+0x4b>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <num_of_digits+0x25>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_of_digits>:
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
mov    $0x1,%eax
cmp    $0xb,%ecx
jb     1134 <num_of_digits+0x34>
mov    $0x1,%eax
mov    $0xcccccccd,%edx
nopl   0x0(%rax,%rax,1)
mov    %ecx,%esi
imul   %rdx,%rsi
shr    $0x23,%rsi
add    $0x1,%eax
cmp    $0x6d,%ecx
mov    %esi,%ecx
ja     1120 <num_of_digits+0x20>
ret

LLVM IR (-O0):
define i32 @num_of_digits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 0, %7
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %1
br label %10
10: ; preds = %13, %9
%11 = load i32, i32* %2
%12 = icmp sgt i32 %11, 10
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i32, i32* %2
%15 = sdiv i32 %14, 10
store i32 %15, i32* %2
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %10
18: ; preds = %10
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @num_of_digits(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = icmp ugt i32 %2, 10
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i32 [ %7, %4 ], [ %2, %1 ]
%7 = udiv i32 %6, 10
%8 = add nuw nsw i32 %5, 1
%9 = icmp ugt i32 %6, 109
br i1 %9, label %4, label %10
10: ; preds = %4, %1
%11 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ __emit_warning(char *);
__attribute__((always_)) void depth_0(void) { __emit_warning("message"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"message\00"
define void @depth_0() {
%1 = tail call i32 @__emit_warning(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
int __attribute__((no)) test2(int x[1000]) {
  int i;
  return x[12];
}


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

x86 assembly (clang, -O2):
<test2>:
mov    0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @test2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 12
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @test2(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 12
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
struct mbuf {
  int dummy;
};

/* Variables and functions */
int pullup(struct mbuf **, char *, int);
char pullchar(struct mbuf **bpp) {
  char c;
  if (pullup(bpp, &c, 1) != 1)
    c = 0;
  return c;
}


x86 assembly (clang, -O0):
<pullchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <pullup@plt>
cmp    $0x1,%eax
je     113b <pullchar+0x2b>
movb   $0x0,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pullchar>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <pullup@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
movzbl 0x7(%rsp),%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mbuf = type { i32 }
define signext i8 @pullchar(%struct.mbuf** %0) {
%2 = alloca %struct.mbuf**
%3 = alloca i8
store %struct.mbuf** %0, %struct.mbuf*** %2
%4 = load %struct.mbuf**, %struct.mbuf*** %2
%5 = call i32 @pullup(%struct.mbuf** %4, i8* %3, i32 1)
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 0, i8* %3
br label %8
8: ; preds = %7, %1
%9 = load i8, i8* %3
ret i8 %9
}

LLVM IR (-O2):
%struct.mbuf = type { i32 }
define signext i8 @pullchar(%struct.mbuf** %0) {
%2 = alloca i8
%3 = call i32 @pullup(%struct.mbuf** %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, 1
%5 = load i8, i8* %2
%6 = select i1 %4, i8 %5, i8 0
ret i8 %6
}
double median_of(int array[], int size) {
  return size % 2 == 1 ? array[size / 2]
                       : (array[size / 2] + array[size / 2 + 1]) / 2.0;
}


x86 assembly (clang, -O0):
<median_of>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    114a <median_of+0x4a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    119e <median_of+0x9e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
mov    $0x2,%esi
cltd
idiv   %esi
mov    %eax,%edx
mov    -0x24(%rbp),%eax
add    $0x1,%edx
movslq %edx,%rdx
add    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm0
movsd  0xe6b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<median_of>:
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
mov    %eax,%ecx
sar    %ecx
and    $0xfffffffe,%eax
sub    %eax,%esi
movslq %ecx,%rcx
mov    (%rdi,%rcx,4),%eax
cmp    $0x1,%esi
jne    1120 <median_of+0x20>
cvtsi2sd %eax,%xmm0
ret
add    0x4(%rdi,%rcx,4),%eax
cvtsi2sd %eax,%xmm0
mulsd  0xed0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @median_of(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 = srem i32 %5, 2
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = sdiv i32 %10, 2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i32, i32* %13
%15 = sitofp i32 %14 to double
br label %33
16: ; preds = %2
%17 = load i32*, i32** %3
%18 = load i32, i32* %4
%19 = sdiv i32 %18, 2
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %17, i64 %20
%22 = load i32, i32* %21
%23 = load i32*, i32** %3
%24 = load i32, i32* %4
%25 = sdiv i32 %24, 2
%26 = add nsw i32 %25, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %23, i64 %27
%29 = load i32, i32* %28
%30 = add nsw i32 %22, %29
%31 = sitofp i32 %30 to double
%32 = fdiv double %31, 2.000000e+00
br label %33
33: ; preds = %16, %8
%34 = phi double [ %15, %8 ], [ %32, %16 ]
ret double %34
}

LLVM IR (-O2):
define double @median_of(i32* nocapture %0, i32 %1) {
%3 = srem i32 %1, 2
%4 = icmp eq i32 %3, 1
%5 = sdiv i32 %1, 2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
br i1 %4, label %9, label %11
9: ; preds = %2
%10 = sitofp i32 %8 to double
br label %19
11: ; preds = %2
%12 = add nsw i32 %5, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %0, i64 %13
%15 = load i32, i32* %14
%16 = add nsw i32 %15, %8
%17 = sitofp i32 %16 to double
%18 = fmul double %17, 5.000000e-01
br label %19
19: ; preds = %11, %9
%20 = phi double [ %10, %9 ], [ %18, %11 ]
ret double %20
}
/* Variables and functions */
int EOF;
int getchar();
int strlen(char *);
void clear_stdin(char *buf) {
  if (buf[strlen(buf) - 1] != '\n') {
    int ch;
    while (((ch = getchar()) != '\n') && (ch != EOF))
      ;
  }
}


x86 assembly (clang, -O0):
<clear_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     11a1 <clear_stdin+0x81>
jmp    115b <clear_stdin+0x3b>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x19(%rbp)
je     1187 <clear_stdin+0x67>
mov    -0xc(%rbp),%eax
mov    0x2e69(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1197 <clear_stdin+0x77>
jmp    119c <clear_stdin+0x7c>
jmp    115b <clear_stdin+0x3b>
jmp    11a1 <clear_stdin+0x81>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_stdin>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
je     1150 <clear_stdin+0x30>
mov    0x2eaf(%rip),%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     1150 <clear_stdin+0x30>
cmp    (%rbx),%eax
jne    1140 <clear_stdin+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @clear_stdin(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = sub nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %4, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 10
br i1 %12, label %13, label %25
13: ; preds = %1
br label %14
14: ; preds = %23, %13
%15 = call i32 (...) @getchar()
store i32 %15, i32* %3
%16 = icmp ne i32 %15, 10
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i32, i32* %3
%19 = load i32, i32* @EOF
%20 = icmp ne i32 %18, %19
br label %21
21: ; preds = %17, %14
%22 = phi i1 [ false, %14 ], [ %20, %17 ]
br i1 %22, label %23, label %24
23: ; preds = %21
br label %14
24: ; preds = %21
br label %25
25: ; preds = %24, %1
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @clear_stdin(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %14, label %8
8: ; preds = %1, %8
%9 = tail call i32 (...) @getchar()
%10 = icmp ne i32 %9, 10
%11 = load i32, i32* @EOF
%12 = icmp ne i32 %9, %11
%13 = select i1 %10, i1 %12, i1 false
br i1 %13, label %8, label %14
14: ; preds = %8, %1
ret void
}
long long _mpy32u(unsigned int src1, unsigned int src2) {
  return ((long long)((int)src1)) * ((long long)((int)src2));
}


x86 assembly (clang, -O0):
<_mpy32u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mpy32u>:
movslq %edi,%rcx
movslq %esi,%rax
imul   %rcx,%rax
ret

LLVM IR (-O0):
define i64 @_mpy32u(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = mul nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @_mpy32u(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = sext i32 %1 to i64
%5 = mul nsw i64 %4, %3
ret i64 %5
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;
struct hle_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ alist_add(struct hle_t *, int, int, int);
void ADDMIXER(struct hle_t *hle, uint32_t w1, uint32_t w2) {
  uint16_t count = (w1 >> 12) & 0xff0;
  uint16_t dmemi = (w2 >> 16);
  uint16_t dmemo = w2;
  alist_add(hle, dmemo, dmemi, count);
}


x86 assembly (clang, -O0):
<ADDMIXER>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0xc,%eax
and    $0xff0,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <alist_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADDMIXER>:
mov    %esi,%ecx
shr    $0xc,%ecx
and    $0xff0,%ecx
mov    %edx,%eax
sar    $0x10,%eax
mov    %edx,%esi
mov    %eax,%edx
jmp    1030 <alist_add@plt>

LLVM IR (-O0):
%struct.hle_t = type { i32 }
define void @ADDMIXER(%struct.hle_t* %0, i32 %1, i32 %2) {
%4 = alloca %struct.hle_t*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store %struct.hle_t* %0, %struct.hle_t** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %5
%11 = ashr i32 %10, 12
%12 = and i32 %11, 4080
store i32 %12, i32* %7
%13 = load i32, i32* %6
%14 = ashr i32 %13, 16
store i32 %14, i32* %8
%15 = load i32, i32* %6
store i32 %15, i32* %9
%16 = load %struct.hle_t*, %struct.hle_t** %4
%17 = load i32, i32* %9
%18 = load i32, i32* %8
%19 = load i32, i32* %7
%20 = call i32 @alist_add(%struct.hle_t* %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
%struct.hle_t = type { i32 }
define void @ADDMIXER(%struct.hle_t* %0, i32 %1, i32 %2) {
%4 = lshr i32 %1, 12
%5 = and i32 %4, 4080
%6 = ashr i32 %2, 16
%7 = tail call i32 @alist_add(%struct.hle_t* %0, i32 %2, i32 %6, i32 %5)
ret void
}
/* Variables and functions */
unsigned int cpuid_eax(int);
unsigned int cpuid_model(void) {
  const unsigned int eax = cpuid_eax(1);
  return (eax & 0xf0000) >> (16 - 4) | (eax & 0xf0) >> 4;
}


x86 assembly (clang, -O0):
<cpuid_model>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <cpuid_eax@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0000,%eax
shr    $0xc,%eax
mov    -0x4(%rbp),%ecx
and    $0xf0,%ecx
shr    $0x4,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_model>:
push   %rax
mov    $0x1,%edi
call   1030 <cpuid_eax@plt>
mov    %eax,%ecx
shr    $0xc,%ecx
and    $0xf0,%ecx
shr    $0x4,%eax
and    $0xf,%eax
or     %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cpuid_model() {
%1 = alloca i32
%2 = call i32 @cpuid_eax(i32 1)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, 983040
%5 = lshr i32 %4, 12
%6 = load i32, i32* %1
%7 = and i32 %6, 240
%8 = lshr i32 %7, 4
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @cpuid_model() {
%1 = tail call i32 @cpuid_eax(i32 1)
%2 = lshr i32 %1, 12
%3 = and i32 %2, 240
%4 = lshr i32 %1, 4
%5 = and i32 %4, 15
%6 = or i32 %3, %5
ret i32 %6
}
/* Type definitions */
struct selection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct selection *);
void selection_free(struct selection *s) { free(s); }


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

x86 assembly (clang, -O2):
<selection_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.selection = type { i32 }
define void @selection_free(%struct.selection* %0) {
%2 = alloca %struct.selection*
store %struct.selection* %0, %struct.selection** %2
%3 = load %struct.selection*, %struct.selection** %2
%4 = call i32 @free(%struct.selection* %3)
ret void
}

LLVM IR (-O2):
%struct.selection = type { i32 }
define void @selection_free(%struct.selection* nocapture %0) {
%2 = tail call i32 @free(%struct.selection* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void handler(int n) { fprintf(stderr, "Signal %d\n", n); }


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Signal %d\0A\00"
define void @handler(i32 %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), i32 %0)
ret void
}
int KlelGetReleaseMajor(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @KlelGetReleaseMajor() {
ret i32 1
}
void dummy_proc_3(int a0, int a1, int a2) { return; }


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

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

LLVM IR (-O0):
define void @dummy_proc_3(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
ret void
}

LLVM IR (-O2):
define void @dummy_proc_3(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ILibPopStack(void **);
void ILibClearStack(void **TheStack) {
  void *Temp = *TheStack;
  do {
    ILibPopStack(&Temp);
  } while (Temp != NULL);
  *TheStack = NULL;
}


x86 assembly (clang, -O0):
<ILibClearStack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <ILibPopStack@plt>
cmpq   $0x0,-0x10(%rbp)
jne    1127 <ILibClearStack+0x17>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ILibClearStack>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rax
mov    %rax,(%rsp)
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <ILibPopStack@plt>
cmpq   $0x0,(%rsp)
jne    1130 <ILibClearStack+0x20>
movq   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ILibClearStack(i8** nocapture %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = load i8*, i8** %0
store i8* %4, i8** %2
br label %5
5: ; preds = %5, %1
%6 = call i32 @ILibPopStack(i8** %2)
%7 = load i8*, i8** %2
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %5
9: ; preds = %5
store i8* null, i8** %0
ret void
}
/* Variables and functions */
int ioCanRenameFileOfSize(char *, int);
int secCanRenameFileOfSize(char *fileName, int fileNameSize) {
  return ioCanRenameFileOfSize(fileName, fileNameSize);
}


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

x86 assembly (clang, -O2):
<secCanRenameFileOfSize>:
jmp    1030 <ioCanRenameFileOfSize@plt>

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

LLVM IR (-O2):
define i32 @secCanRenameFileOfSize(i8* %0, i32 %1) {
%3 = tail call i32 @ioCanRenameFileOfSize(i8* %0, i32 %1)
ret i32 %3
}
int rnn(int rny) { return (rny); }


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

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

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

LLVM IR (-O2):
define i32 @rnn(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ conio_init();
void caca_conio_nosound(void) { conio_init(); }


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

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

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

LLVM IR (-O2):
define void @caca_conio_nosound() {
%1 = tail call i32 (...) @conio_init()
ret void
}
char *langRomTypeGide() { return "GIDE"; }


x86 assembly (clang, -O0):
<langRomTypeGide>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeGide>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"GIDE\00"
define i8* @langRomTypeGide() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"GIDE\00"
define i8* @langRomTypeGide() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int, int);
int test();
int main(void) {
  int magic = 42;
  int ret = test();
  printf("test return %d, magic %d\n", ret, magic);
  exit(ret);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
mov    $0x0,%al
call   1050 <test@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <test@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
mov    %eax,%esi
mov    $0x2a,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"test return %d, magic %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 42, i32* %2
%4 = call i32 (...) @test()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"test return %d, magic %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @test()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1, i32 42)
%3 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void die(const char *message) {
  printf("%s\n", message);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @die(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int *func5(int i) { return &i; }


x86 assembly (clang, -O0):
<func5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func5>:
lea    -0x4(%rsp),%rax
ret

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

LLVM IR (-O2):
define noalias i32* @func5(i32 %0) {
%2 = alloca i32
ret i32* %2
}