xunge/DecIR huggingface dataset:
/* Type definitions */
struct list_elem {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
struct list_elem *list_back(struct list *);
int /*<<< orphan*/ list_remove(struct list_elem *);
struct list_elem *list_pop_back(struct list *list) {
  struct list_elem *back = list_back(list);
  list_remove(back);
  return back;
}


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

x86 assembly (clang, -O2):
<list_pop_back>:
push   %rbx
call   1030 <list_back@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <list_remove@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.list_elem = type { i32 }
%struct.list = type { i32 }
define %struct.list_elem* @list_pop_back(%struct.list* %0) {
%2 = alloca %struct.list*
%3 = alloca %struct.list_elem*
store %struct.list* %0, %struct.list** %2
%4 = load %struct.list*, %struct.list** %2
%5 = call %struct.list_elem* @list_back(%struct.list* %4)
store %struct.list_elem* %5, %struct.list_elem** %3
%6 = load %struct.list_elem*, %struct.list_elem** %3
%7 = call i32 @list_remove(%struct.list_elem* %6)
%8 = load %struct.list_elem*, %struct.list_elem** %3
ret %struct.list_elem* %8
}

LLVM IR (-O2):
%struct.list_elem = type { i32 }
%struct.list = type { i32 }
define %struct.list_elem* @list_pop_back(%struct.list* %0) {
%2 = tail call %struct.list_elem* @list_back(%struct.list* %0)
%3 = tail call i32 @list_remove(%struct.list_elem* %2)
ret %struct.list_elem* %2
}
void motors_set_vel(double x, double yaw) {}


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

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

LLVM IR (-O0):
define void @motors_set_vel(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
ret void
}

LLVM IR (-O2):
define void @motors_set_vel(double %0, double %1) {
ret void
}
/* Type definitions */
struct game {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ move_left(struct game *);
int /*<<< orphan*/ rotate_clockwise(struct game *);
void move_right(struct game *game) {
  rotate_clockwise(game);
  rotate_clockwise(game);
  move_left(game);
  rotate_clockwise(game);
  rotate_clockwise(game);
}


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

x86 assembly (clang, -O2):
<move_right>:
push   %rbx
mov    %rdi,%rbx
call   1040 <rotate_clockwise@plt>
mov    %rbx,%rdi
call   1040 <rotate_clockwise@plt>
mov    %rbx,%rdi
call   1030 <move_left@plt>
mov    %rbx,%rdi
call   1040 <rotate_clockwise@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <rotate_clockwise@plt>

LLVM IR (-O0):
%struct.game = type { i32 }
define void @move_right(%struct.game* %0) {
%2 = alloca %struct.game*
store %struct.game* %0, %struct.game** %2
%3 = load %struct.game*, %struct.game** %2
%4 = call i32 @rotate_clockwise(%struct.game* %3)
%5 = load %struct.game*, %struct.game** %2
%6 = call i32 @rotate_clockwise(%struct.game* %5)
%7 = load %struct.game*, %struct.game** %2
%8 = call i32 @move_left(%struct.game* %7)
%9 = load %struct.game*, %struct.game** %2
%10 = call i32 @rotate_clockwise(%struct.game* %9)
%11 = load %struct.game*, %struct.game** %2
%12 = call i32 @rotate_clockwise(%struct.game* %11)
ret void
}

LLVM IR (-O2):
%struct.game = type { i32 }
define void @move_right(%struct.game* %0) {
%2 = tail call i32 @rotate_clockwise(%struct.game* %0)
%3 = tail call i32 @rotate_clockwise(%struct.game* %0)
%4 = tail call i32 @move_left(%struct.game* %0)
%5 = tail call i32 @rotate_clockwise(%struct.game* %0)
%6 = tail call i32 @rotate_clockwise(%struct.game* %0)
ret void
}
void func2(void) {
  extern double *p;
  extern double *p;
}


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

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

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

LLVM IR (-O2):
define void @func2() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ qrencode(char *);
int main(int argc, char **argv) {
  if (argc == 2) {
    qrencode(argv[1]);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    113d <main+0x2d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <qrencode@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    111f <main+0xf>
mov    0x8(%rsi),%rdi
call   1030 <qrencode@plt>
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @qrencode(i8* %6)
br label %8
8: ; preds = %4, %2
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}
void wifi_rsp_hardware_rtc_init(
    const struct wifi_msg_hardware_rtc_init_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_hardware_rtc_init_rsp_t = type opaque
define void @wifi_rsp_hardware_rtc_init(%struct.wifi_msg_hardware_rtc_init_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(unsigned char, unsigned char);
void SensorSetReg_GC306(unsigned char uAddr, unsigned short uVal) {
  VIM_SIF_I2cWriteByte((unsigned char)uAddr, (unsigned char)uVal);
}


x86 assembly (clang, -O0):
<SensorSetReg_GC306>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x4(%rbp),%ax
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetReg_GC306>:
movzbl %sil,%esi
jmp    1030 <VIM_SIF_I2cWriteByte@plt>

LLVM IR (-O0):
define void @SensorSetReg_GC306(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = load i16, i16* %4
%7 = trunc i16 %6 to i8
%8 = call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %5, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
define void @SensorSetReg_GC306(i8 zeroext %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
%4 = tail call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %0, i8 zeroext %3)
ret void
}
/* Variables and functions */
char *getlogin();
int /*<<< orphan*/ puts(char *);
int main(void) {
  char *lname = getlogin();
  if (!lname)
    return 1;
  puts(lname);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getlogin@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1151 <main+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1161 <main+0x41>
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getlogin@plt>
test   %rax,%rax
je     1139 <main+0x19>
mov    %rax,%rdi
call   1030 <puts@plt>
jmp    113e <main+0x1e>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* (...) @getlogin()
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 0, %3 ], [ 1, %0 ]
ret i32 %6
}
int iaddr_(void *my_active) { return (int)my_active; }


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

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

LLVM IR (-O0):
define i32 @iaddr_(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @iaddr_(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
int snd_config_update_free_global(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @snd_config_update_free_global() {
ret i32 0
}
void setcelltype(int *flag, int type) {
  if (type == 0) {
    *flag = *flag & (~57344);
    *flag = *flag | 4096;
  } else if (type == 1) {
    *flag = *flag & (~53248);
    *flag = *flag | 8192;
  }
}


x86 assembly (clang, -O0):
<setcelltype>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    113e <setcelltype+0x3e>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xffff1fff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
or     $0x1000,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    1171 <setcelltype+0x71>
cmpl   $0x1,-0xc(%rbp)
jne    116c <setcelltype+0x6c>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xffff2fff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
or     $0x2000,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    1171 <setcelltype+0x71>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setcelltype>:
test   %esi,%esi
je     1110 <setcelltype+0x10>
cmp    $0x1,%esi
jne    1120 <setcelltype+0x20>
mov    $0x2000,%eax
jmp    1115 <setcelltype+0x15>
mov    $0x1000,%eax
mov    $0xffff0fff,%ecx
and    (%rdi),%ecx
or     %eax,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @setcelltype(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 eq i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = and i32 %9, -57345
%11 = load i32*, i32** %3
store i32 %10, i32* %11
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = or i32 %13, 4096
%15 = load i32*, i32** %3
store i32 %14, i32* %15
br label %29
16: ; preds = %2
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %28
19: ; preds = %16
%20 = load i32*, i32** %3
%21 = load i32, i32* %20
%22 = and i32 %21, -53249
%23 = load i32*, i32** %3
store i32 %22, i32* %23
%24 = load i32*, i32** %3
%25 = load i32, i32* %24
%26 = or i32 %25, 8192
%27 = load i32*, i32** %3
store i32 %26, i32* %27
br label %28
28: ; preds = %19, %16
br label %29
29: ; preds = %28, %7
ret void
}

LLVM IR (-O2):
define void @setcelltype(i32* nocapture %0, i32 %1) {
switch i32 %1, label %9 [
i32 0, label %4
i32 1, label %3
]
3: ; preds = %2
br label %4
4: ; preds = %2, %3
%5 = phi i32 [ 8192, %3 ], [ 4096, %2 ]
%6 = load i32, i32* %0
%7 = and i32 %6, -61441
%8 = or i32 %7, %5
store i32 %8, i32* %0
br label %9
9: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
void ironlake_debug_pf_win(char *result, int len, int reg, uint32_t val,
                           uint32_t devid) {
  int a, b;
  a = (val >> 16) & 0x1fff;
  b = val & 0xfff;
  snprintf(result, len, "%d, %d", a, b);
}


x86 assembly (clang, -O0):
<ironlake_debug_pf_win>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sar    $0x10,%eax
and    $0x1fff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
and    $0xfff,%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
lea    0xea9(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ironlake_debug_pf_win>:
mov    %ecx,%r8d
shr    $0x10,%ecx
and    $0x1fff,%ecx
and    $0xfff,%r8d
lea    0xed6(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%d, %d\00"
define void @ironlake_debug_pf_win(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%13 = load i32, i32* %9
%14 = ashr i32 %13, 16
%15 = and i32 %14, 8191
store i32 %15, i32* %11
%16 = load i32, i32* %9
%17 = and i32 %16, 4095
store i32 %17, i32* %12
%18 = load i8*, i8** %6
%19 = load i32, i32* %7
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = call i32 @snprintf(i8* %18, i32 %19, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d, %d\00"
define void @ironlake_debug_pf_win(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = lshr i32 %3, 16
%7 = and i32 %6, 8191
%8 = and i32 %3, 4095
%9 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret void
}
void f_int2(f) int f;
{ return; }


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

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

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

LLVM IR (-O2):
define void @f_int2(i32 %0) {
ret void
}
float mino(float a, float b) { return a - b; }


x86 assembly (clang, -O0):
<mino>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mino>:
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @mino(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @mino(float %0, float %1) {
%3 = fsub float %0, %1
ret float %3
}
double atof(const char *str) { return 0; }


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

x86 assembly (clang, -O2):
<atof>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @atof(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @atof(i8* nocapture readnone %0) {
ret double 0.000000e+00
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
size_t wcrtomb(char *__restrict s, wchar_t wc, mbstate_t *__restrict ps) {
  return -1;
}


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

x86 assembly (clang, -O2):
<wcrtomb>:
mov    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @wcrtomb(i8* noalias nocapture readnone %0, i32 %1, i32* noalias nocapture readnone %2) {
ret i64 -1
}
/* Variables and functions */
int fegetexcept();
int get_fpu_trap_exceptions(void) {
  int exceptions = fegetexcept();
  int res = 0;
  return res;
}


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

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

LLVM IR (-O0):
define i32 @get_fpu_trap_exceptions() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @fegetexcept()
store i32 %3, i32* %1
store i32 0, i32* %2
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
define i32 @get_fpu_trap_exceptions() {
%1 = tail call i32 (...) @fegetexcept()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ drv_generic_serial_close();
int drv_PHAnderson_close(void) {
  drv_generic_serial_close();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @drv_PHAnderson_close() {
%1 = tail call i32 (...) @drv_generic_serial_close()
ret i32 0
}
void rop3_27_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T ^ S;
  stk2 = *D & stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_27_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_27_0_0>:
xor    %esi,%edx
and    (%rdi),%dl
xor    %sil,%dl
not    %dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_27_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %9
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = load i8*, i8** %4
store i8 %33, i8* %34
ret void
}

LLVM IR (-O2):
define void @rop3_27_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = xor i8 %6, %1
%8 = xor i8 %7, -1
store i8 %8, i8* %0
ret void
}
void TimerOC4FastConfigure(unsigned long ulBase, unsigned long ulOCFast) {
  unsigned long ulTempccmr2 = 0;

  ;

  ;
  ulTempccmr2 = (*((volatile unsigned long *)(ulBase + 0x0000001C)));
  ulTempccmr2 &= ~0x00000400;
  ulTempccmr2 |= (ulOCFast << 8);
  (*((volatile unsigned long *)(ulBase + 0x0000001C))) = ulTempccmr2;
}


x86 assembly (clang, -O0):
<TimerOC4FastConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0xfffffffffffffbff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerOC4FastConfigure>:
mov    $0xfffffffffffffbff,%rax
and    0x1c(%rdi),%rax
shl    $0x8,%rsi
or     %rax,%rsi
mov    %rsi,0x1c(%rdi)
ret

LLVM IR (-O0):
define void @TimerOC4FastConfigure(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 0, i64* %5
%6 = load i64, i64* %3
%7 = add i64 %6, 28
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = and i64 %10, -1025
store i64 %11, i64* %5
%12 = load i64, i64* %4
%13 = shl i64 %12, 8
%14 = load i64, i64* %5
%15 = or i64 %14, %13
store i64 %15, i64* %5
%16 = load i64, i64* %5
%17 = load i64, i64* %3
%18 = add i64 %17, 28
%19 = inttoptr i64 %18 to i64*
store volatile i64 %16, i64* %19
ret void
}

LLVM IR (-O2):
define void @TimerOC4FastConfigure(i64 %0, i64 %1) {
%3 = add i64 %0, 28
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -1025
%7 = shl i64 %1, 8
%8 = or i64 %6, %7
store volatile i64 %8, i64* %4
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_retrieve_dobldobl_solution(int n, int k, int *m, double *sol) {
  int fail;
  fail = _ada_use_c2phc4c(344, &k, m, sol, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_retrieve_dobldobl_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x158,%edi
lea    -0x8(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_retrieve_dobldobl_solution>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x158,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solcon_retrieve_dobldobl_solution(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca double*
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store double* %3, double** %8
%10 = load i32*, i32** %7
%11 = load double*, double** %8
%12 = call i32 @_ada_use_c2phc4c(i32 344, i32* %6, i32* %10, double* %11, i32 0)
store i32 %12, i32* %9
%13 = load i32, i32* %9
ret i32 %13
}

LLVM IR (-O2):
define i32 @solcon_retrieve_dobldobl_solution(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca i32
store i32 %1, i32* %5
%6 = call i32 @_ada_use_c2phc4c(i32 344, i32* %5, i32* %2, double* %3, i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ set_parity_flag(int);
void handle_parity_flag(const int value) {
  int tmp = value;
  int number_set_bits = 0;
  while (tmp > 0) {
    if ((tmp & 1) == 1) {
      number_set_bits++;
    }
    tmp = tmp >> 1;
  }
  set_parity_flag((number_set_bits % 2) == 0);
}


x86 assembly (clang, -O0):
<handle_parity_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1158 <handle_parity_flag+0x48>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    114a <handle_parity_flag+0x3a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1128 <handle_parity_flag+0x18>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_parity_flag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_parity_flag>:
test   %edi,%edi
jle    113a <handle_parity_flag+0x2a>
mov    %edi,%eax
xor    %edi,%edi
mov    %eax,%ecx
nopw   0x0(%rax,%rax,1)
mov    %eax,%edx
and    $0x1,%edx
add    %edx,%edi
shr    %ecx
cmp    $0x1,%eax
mov    %ecx,%eax
ja     1120 <handle_parity_flag+0x10>
not    %edi
and    $0x1,%edi
jmp    1030 <set_parity_flag@plt>
mov    $0x1,%edi
jmp    1030 <set_parity_flag@plt>

LLVM IR (-O0):
define void @handle_parity_flag(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %16, %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32, i32* %3
%11 = and i32 %10, 1
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %16
16: ; preds = %13, %9
%17 = load i32, i32* %3
%18 = ashr i32 %17, 1
store i32 %18, i32* %3
br label %6
19: ; preds = %6
%20 = load i32, i32* %4
%21 = srem i32 %20, 2
%22 = icmp eq i32 %21, 0
%23 = zext i1 %22 to i32
%24 = call i32 @set_parity_flag(i32 %23)
ret void
}

LLVM IR (-O2):
define void @handle_parity_flag(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %13
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = lshr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = and i32 %7, 1
%12 = xor i32 %11, 1
br label %13
13: ; preds = %10, %1
%14 = phi i32 [ 1, %1 ], [ %12, %10 ]
%15 = tail call i32 @set_parity_flag(i32 %14)
ret void
}
unsigned long b_system_config(unsigned long function, unsigned long var) {
  unsigned long tlong;
  asm volatile("call *0x00100070" : "=a"(tlong) : "d"(function), "a"(var));
  return tlong;
}


x86 assembly (clang, -O0):
<b_system_config>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rax
call   *0x100070
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_system_config>:
mov    %rsi,%rax
mov    %rdi,%rdx
call   *0x100070
ret

LLVM IR (-O0):
define i64 @b_system_config(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i64 asm sideeffect "call *0x00100070", "={ax},{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i64 %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @b_system_config(i64 %0, i64 %1) {
%3 = tail call i64 asm sideeffect "call *0x00100070", "={ax},{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int identifierEnd(int);
int iterIdentifierEnd(int start) {
  int x;
  while (1) {
    x = identifierEnd(start);
    if (x == start)
      return x;
    start = x;
  }
}


x86 assembly (clang, -O0):
<iterIdentifierEnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <identifierEnd@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    113b <iterIdentifierEnd+0x2b>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    111b <iterIdentifierEnd+0xb>

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

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

LLVM IR (-O2):
define i32 @iterIdentifierEnd(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %4, %2 ]
%4 = tail call i32 @identifierEnd(i32 %3)
%5 = icmp eq i32 %4, %3
br i1 %5, label %6, label %2
6: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void stackFull(void) {
  fprintf(stderr, "Stack is full, cannot add element");
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Stack is full, cannot add element\00"
@EXIT_FAILURE = global i32 0
define void @stackFull() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Stack is full, cannot add element\00"
@EXIT_FAILURE = global i32 0
define void @stackFull() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
const char *indent(int x) {
  static const char buf[] = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
  const char *end = buf + sizeof buf - 1;
  return x > sizeof buf - 1 ? buf : end - x;
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
movslq -0x4(%rbp),%rax
cmp    $0x10,%rax
jbe    1134 <indent+0x34>
lea    0xed5(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1148 <indent+0x48>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
movslq %edi,%rcx
lea    0xef6(%rip),%rdx
mov    %rdx,%rax
sub    %rcx,%rax
add    $0x10,%rax
cmp    $0x11,%ecx
cmovae %rdx,%rax
ret

LLVM IR (-O0):
@indent.buf = internal constant [17 x i8] c"\09\09\09\09\09\09\09\09\09\09\09\09\09\09\09\09\00"
define i8* @indent(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @indent.buf, i64 1, i64 -1), i8** %3
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = icmp ugt i64 %5, 16
br i1 %6, label %7, label %8
7: ; preds = %1
br label %14
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = sub i64 0, %11
%13 = getelementptr inbounds i8, i8* %9, i64 %12
br label %14
14: ; preds = %8, %7
%15 = phi i8* [ getelementptr inbounds ([17 x i8], [17 x i8]* @indent.buf, i64 0, i64 0), %7 ], [ %13, %8 ]
ret i8* %15
}

LLVM IR (-O2):
@indent.buf = internal constant [17 x i8] c"\09\09\09\09\09\09\09\09\09\09\09\09\09\09\09\09\00"
define i8* @indent(i32 %0) {
%2 = sext i32 %0 to i64
%3 = icmp ugt i32 %0, 16
%4 = sub nsw i64 0, %2
%5 = getelementptr inbounds i8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @indent.buf, i64 0, i64 16), i64 %4
%6 = select i1 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @indent.buf, i64 0, i64 0), i8* %5
ret i8* %6
}
/* Variables and functions */
scalar_t__ strstr(char *, char *);
int ns_theater(char *s) { return strstr(s, "NS") && strstr(s, "theater"); }


x86 assembly (clang, -O0):
<ns_theater>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1158 <ns_theater+0x48>
mov    -0x8(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns_theater>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strstr@plt>
test   %rax,%rax
je     1141 <ns_theater+0x31>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"NS\00"
@.str.1 = [8 x i8] c"theater\00"
define i32 @ns_theater(i8* %0) {
%2 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int Project(int argc, char **argv) {
  printf("Calling from Project\n");
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Calling from Project\0A\00"
define i32 @Project(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [21 x i8] c"Calling from Project\00"
define i32 @Project(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ code_for_catch_exception(int);
void exceptions() {
  code_for_catch_exception(9);
  code_for_catch_exception(10);
  code_for_catch_exception(4);
  code_for_catch_exception(6);
  code_for_catch_exception(11);
  code_for_catch_exception(32);
  code_for_catch_exception(255);
  code_for_catch_exception(33);
}


x86 assembly (clang, -O0):
<exceptions>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%edi
call   1030 <code_for_catch_exception@plt>
mov    $0xa,%edi
call   1030 <code_for_catch_exception@plt>
mov    $0x4,%edi
call   1030 <code_for_catch_exception@plt>
mov    $0x6,%edi
call   1030 <code_for_catch_exception@plt>
mov    $0xb,%edi
call   1030 <code_for_catch_exception@plt>
mov    $0x20,%edi
call   1030 <code_for_catch_exception@plt>
mov    $0xff,%edi
call   1030 <code_for_catch_exception@plt>
mov    $0x21,%edi
call   1030 <code_for_catch_exception@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<exceptions>:
push   %rax
mov    $0x9,%edi
call   1030 <code_for_catch_exception@plt>
mov    $0xa,%edi
call   1030 <code_for_catch_exception@plt>
mov    $0x4,%edi
call   1030 <code_for_catch_exception@plt>
mov    $0x6,%edi
call   1030 <code_for_catch_exception@plt>
mov    $0xb,%edi
call   1030 <code_for_catch_exception@plt>
mov    $0x20,%edi
call   1030 <code_for_catch_exception@plt>
mov    $0xff,%edi
call   1030 <code_for_catch_exception@plt>
mov    $0x21,%edi
pop    %rax
jmp    1030 <code_for_catch_exception@plt>

LLVM IR (-O0):
define void @exceptions() {
%1 = call i32 @code_for_catch_exception(i32 9)
%2 = call i32 @code_for_catch_exception(i32 10)
%3 = call i32 @code_for_catch_exception(i32 4)
%4 = call i32 @code_for_catch_exception(i32 6)
%5 = call i32 @code_for_catch_exception(i32 11)
%6 = call i32 @code_for_catch_exception(i32 32)
%7 = call i32 @code_for_catch_exception(i32 255)
%8 = call i32 @code_for_catch_exception(i32 33)
ret void
}

LLVM IR (-O2):
define void @exceptions() {
%1 = tail call i32 @code_for_catch_exception(i32 9)
%2 = tail call i32 @code_for_catch_exception(i32 10)
%3 = tail call i32 @code_for_catch_exception(i32 4)
%4 = tail call i32 @code_for_catch_exception(i32 6)
%5 = tail call i32 @code_for_catch_exception(i32 11)
%6 = tail call i32 @code_for_catch_exception(i32 32)
%7 = tail call i32 @code_for_catch_exception(i32 255)
%8 = tail call i32 @code_for_catch_exception(i32 33)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgscale(void) { gen("shll\t$2,%eax"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"shll\09$2,%eax\00"
define void @cgscale() {
%1 = call i32 @gen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"shll\09$2,%eax\00"
define void @cgscale() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int close(int);
int dsp_close(int handle) { return close(handle); }


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

x86 assembly (clang, -O2):
<dsp_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @dsp_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() { printf("Usage: dumbc <src>\n"); }


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 <puts@plt>

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

LLVM IR (-O2):
@str = [19 x i8] c"Usage: dumbc <src>\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_char(char);
int /*<<< orphan*/ send_string(int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int);
void send_errno(int error) {
  send_char('\177');
  send_string(strerror(error));
}


x86 assembly (clang, -O0):
<send_errno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x7f,%edi
call   1040 <send_char@plt>
mov    -0x4(%rbp),%edi
call   1050 <strerror@plt>
mov    %eax,%edi
call   1030 <send_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_errno>:
push   %rbx
mov    %edi,%ebx
mov    $0x7f,%edi
call   1040 <send_char@plt>
mov    %ebx,%edi
call   1050 <strerror@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <send_string@plt>

LLVM IR (-O0):
define void @send_errno(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @send_char(i8 signext 127)
%4 = load i32, i32* %2
%5 = call i32 @strerror(i32 %4)
%6 = call i32 @send_string(i32 %5)
ret void
}

LLVM IR (-O2):
define void @send_errno(i32 %0) {
%2 = tail call i32 @send_char(i8 signext 127)
%3 = tail call i32 @strerror(i32 %0)
%4 = tail call i32 @send_string(i32 %3)
ret void
}
int t(int a, int b) {
  if (a > 0)
    goto L1;
  if (b > 0)
    goto L2;
L1:
  return 0;
L2:
  return 1;
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1119 <t+0x19>
jmp    112d <t+0x2d>
cmpl   $0x0,-0xc(%rbp)
jle    1128 <t+0x28>
jmp    1139 <t+0x39>
jmp    112d <t+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1140 <t+0x40>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
test   %edi,%edi
setle  %al
test   %esi,%esi
setg   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @t(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 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
br label %14
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
br label %15
13: ; preds = %9
br label %14
14: ; preds = %13, %8
store i32 0, i32* %3
br label %16
15: ; preds = %12
store i32 1, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @t(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 1
%4 = icmp sgt i32 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int scanw(char *, int *, int *);
int ii_scanw(char *fmt, int *i, int *j) { return (scanw(fmt, i, j)); }


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

x86 assembly (clang, -O2):
<ii_scanw>:
jmp    1030 <scanw@plt>

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

LLVM IR (-O2):
define i32 @ii_scanw(i8* %0, i32* %1, i32* %2) {
%4 = tail call i32 @scanw(i8* %0, i32* %1, i32* %2)
ret i32 %4
}
void glCreateShader(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glCreateShader() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printMessage(void) {
  printf("\nIn printMessage function.\n\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [28 x i8] c"\0AIn printMessage function.\0A\00"
define void @printMessage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int readline(char *, int);
int /*<<< orphan*/ reverse(char *, int);
int main() {
  int len;
  char line[80];
  char c;
  while ((len = readline(line, 80)) > 0) {
    reverse(line, len);
    printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    $0x50,%esi
call   1050 <readline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    117a <main+0x4a>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <reverse@plt>
lea    -0x60(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rsp,%rdi
mov    $0x50,%esi
call   1050 <readline@plt>
test   %eax,%eax
jle    1186 <main+0x56>
mov    %rsp,%rbx
lea    0xeae(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <readline@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [80 x i8]
%4 = alloca i8
store i32 0, i32* %1
br label %5
5: ; preds = %9, %0
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%7 = call i32 @readline(i8* %6, i32 80)
store i32 %7, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%11 = load i32, i32* %2
%12 = call i32 @reverse(i8* %10, i32 %11)
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %5
15: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @readline(i8* %2, i32 80)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %0, %5
%6 = phi i32 [ %9, %5 ], [ %3, %0 ]
%7 = call i32 @reverse(i8* %2, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%9 = call i32 @readline(i8* %2, i32 80)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %0
ret i32 0
}