xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ clearerr(int /*<<< orphan*/ *);
void uninitvar_clearerr(void) {
  FILE *fp;
  clearerr(fp);
}


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

x86 assembly (clang, -O2):
<uninitvar_clearerr>:
jmp    1030 <clearerr@plt>

LLVM IR (-O0):
define void @uninitvar_clearerr() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @clearerr(i32* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_clearerr() {
%1 = tail call i32 @clearerr(i32* undef)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void PWMFaultIntClear(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x0000001C))) = 0x00010000;
}


x86 assembly (clang, -O0):
<PWMFaultIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1c,%eax
cltq
movl   $0x10000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMFaultIntClear>:
movslq %edi,%rax
movl   $0x10000,0x1c(%rax)
ret

LLVM IR (-O0):
define void @PWMFaultIntClear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 28
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 65536, i32* %6
ret void
}

LLVM IR (-O2):
define void @PWMFaultIntClear(i32 %0) {
%2 = add nsw i32 %0, 28
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 65536, i32* %4
ret void
}
int main(void) {
  int *a;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
/* Variables and functions */
scalar_t__ i0(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int open_database(char *database_name) {
  int database_open = 0;
  char bss_command[1024];
  char bss_result[1024];
  sprintf(bss_command, "choose %s", database_name);
  if ((database_open = (i0(bss_command, bss_result) == 0))) {
  }
  return database_open;
}


x86 assembly (clang, -O0):
<open_database>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeb8(%rip),%rsi
call   1030 <sprintf@plt>
lea    -0x410(%rbp),%rdi
lea    -0x810(%rbp),%rsi
call   1040 <i0@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0xc(%rbp)
test   $0x1,%al
jne    117f <open_database+0x5f>
jmp    1184 <open_database+0x64>
jmp    1184 <open_database+0x64>
mov    -0xc(%rbp),%eax
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_database>:
push   %rbx
sub    $0x800,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
lea    0x400(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <i0@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"choose %s\00"
define i32 @open_database(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [1024 x i8]
%5 = alloca [1024 x i8]
store i8* %0, i8** %2
store i32 0, i32* %3
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%11 = call i64 @i0(i8* %9, i8* %10)
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
store i32 %13, i32* %3
br i1 %12, label %14, label %15
14: ; preds = %1
br label %15
15: ; preds = %14, %1
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [10 x i8] c"choose %s\00"
define i32 @open_database(i8* %0) {
%2 = alloca [1024 x i8]
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = call i64 @i0(i8* %4, i8* %5)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
short setBit_fun_short(short x, unsigned i) { return x | 1 << i; }


x86 assembly (clang, -O0):
<setBit_fun_short>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movswl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
cwtl
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @setBit_fun_short(i16 signext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = or i32 %6, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define signext i16 @setBit_fun_short(i16 signext %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = trunc i32 %3 to i16
%5 = or i16 %4, %0
ret i16 %5
}
/* Variables and functions */
int OS_mainLoop();
int SceneManager_run() { return OS_mainLoop(); }


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

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

LLVM IR (-O0):
define i32 @SceneManager_run() {
%1 = call i32 (...) @OS_mainLoop()
ret i32 %1
}

LLVM IR (-O2):
define i32 @SceneManager_run() {
%1 = tail call i32 (...) @OS_mainLoop()
ret i32 %1
}
/* Variables and functions */
int base_operand(char *);
int translate_mnem(char *);
int translate_key(char *token, int instr_count) {
  int translated;
  if (instr_count == 0)
    translated = translate_mnem(token);
  else
    translated = base_operand(token);
  if (translated != -1)
    return translated;
  else
    return -1;
}


x86 assembly (clang, -O0):
<translate_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    114a <translate_key+0x2a>
mov    -0x10(%rbp),%rdi
call   1030 <translate_mnem@plt>
mov    %eax,-0x18(%rbp)
jmp    1156 <translate_key+0x36>
mov    -0x10(%rbp),%rdi
call   1040 <base_operand@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
je     116b <translate_key+0x4b>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <translate_key+0x52>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<translate_key>:
test   %esi,%esi
je     1129 <translate_key+0x9>
jmp    1040 <base_operand@plt>
jmp    1030 <translate_mnem@plt>

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

LLVM IR (-O2):
define i32 @translate_key(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @translate_mnem(i8* %0)
br label %8
6: ; preds = %2
%7 = tail call i32 @base_operand(i8* %0)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ initialized();
int global_var_is_fp(void *global, void *fp) {
  if (!initialized())
    return (global == fp);
  return (*((void **)global) == fp);
}


x86 assembly (clang, -O0):
<global_var_is_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x0,%al
call   1030 <initialized@plt>
cmp    $0x0,%eax
jne    1148 <global_var_is_fp+0x38>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    115e <global_var_is_fp+0x4e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<global_var_is_fp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <initialized@plt>
test   %eax,%eax
je     1128 <global_var_is_fp+0x18>
mov    (%rbx),%rbx
xor    %eax,%eax
cmp    %r14,%rbx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @global_var_is_fp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = call i32 (...) @initialized()
%7 = icmp ne i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = icmp eq i8* %9, %10
%12 = zext i1 %11 to i32
store i32 %12, i32* %3
br label %20
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = bitcast i8* %14 to i8**
%16 = load i8*, i8** %15
%17 = load i8*, i8** %5
%18 = icmp eq i8* %16, %17
%19 = zext i1 %18 to i32
store i32 %19, i32* %3
br label %20
20: ; preds = %13, %8
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @global_var_is_fp(i8* %0, i8* readnone %1) {
%3 = tail call i32 (...) @initialized()
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = bitcast i8* %0 to i8**
%7 = load i8*, i8** %6
br label %8
8: ; preds = %2, %5
%9 = phi i8* [ %7, %5 ], [ %0, %2 ]
%10 = icmp eq i8* %9, %1
%11 = zext i1 %10 to i32
ret i32 %11
}
void made_address(int addr, unsigned char *buf) {
  int k;
  k = addr;
  buf[1] = (unsigned char)(k & 0xFF);
  k = addr & 0xFF00;
  buf[0] = ((unsigned char)(k >> 8)) & 0x7F;
  return;
}


x86 assembly (clang, -O0):
<made_address>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sar    $0x8,%eax
movzbl %al,%eax
and    $0x7f,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<made_address>:
mov    %dil,0x1(%rsi)
shr    $0x8,%edi
and    $0x7f,%dil
mov    %dil,(%rsi)
ret

LLVM IR (-O0):
define void @made_address(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %9, i8* %11
%12 = load i32, i32* %3
%13 = and i32 %12, 65280
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = ashr i32 %14, 8
%16 = trunc i32 %15 to i8
%17 = zext i8 %16 to i32
%18 = and i32 %17, 127
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 0
store i8 %19, i8* %21
ret void
}

LLVM IR (-O2):
define void @made_address(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
%4 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %3, i8* %4
%5 = lshr i32 %0, 8
%6 = trunc i32 %5 to i8
%7 = and i8 %6, 127
store i8 %7, i8* %1
ret void
}
/* Variables and functions */
unsigned long gfx_pci_config_read(int);
unsigned long gu2_get_graphics_register_base(void) {
  return gfx_pci_config_read(0x80000914);
}


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

x86 assembly (clang, -O2):
<gu2_get_graphics_register_base>:
mov    $0x80000914,%edi
jmp    1030 <gfx_pci_config_read@plt>

LLVM IR (-O0):
define i64 @gu2_get_graphics_register_base() {
%1 = call i64 @gfx_pci_config_read(i32 -2147481324)
ret i64 %1
}

LLVM IR (-O2):
define i64 @gu2_get_graphics_register_base() {
%1 = tail call i64 @gfx_pci_config_read(i32 -2147481324)
ret i64 %1
}
char *is_prime(int a) {
  int c;
  for (c = 2; c <= a - 1; c++) {
    if (a % c == 0)
      return "No";
  }
  if (c == a)
    return "Si";
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1152 <is_prime+0x52>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    113f <is_prime+0x3f>
lea    0xeca(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <is_prime+0x69>
jmp    1144 <is_prime+0x44>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    110e <is_prime+0xe>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1169 <is_prime+0x69>
lea    0xe9e(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
lea    0xefc(%rip),%rcx
cmp    $0x3,%edi
jl     1130 <is_prime+0x30>
mov    $0x2,%esi
lea    0xee8(%rip),%r8
nopl   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1134 <is_prime+0x34>
add    $0x1,%esi
cmp    %esi,%edi
jne    1120 <is_prime+0x20>
mov    %rcx,%rax
ret
mov    %r8,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"No\00"
@.str.1 = [3 x i8] c"Si\00"
define i8* @is_prime(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 2, i32* %4
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 1
%9 = icmp sle i32 %6, %8
br i1 %9, label %10, label %20
10: ; preds = %5
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = srem i32 %11, %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %25
16: ; preds = %10
br label %17
17: ; preds = %16
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %5
20: ; preds = %5
%21 = load i32, i32* %4
%22 = load i32, i32* %3
%23 = icmp eq i32 %21, %22
br i1 %23, label %24, label %25
24: ; preds = %20
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %25
25: ; preds = %15, %24, %20
%26 = load i8*, i8** %2
ret i8* %26
}

LLVM IR (-O2):
@.str = [3 x i8] c"No\00"
@.str.1 = [3 x i8] c"Si\00"
define i8* @is_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %1 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %5 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main_preinit1() {
  printf("main_preinit1"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"main_preinit1\00"
define void @main_preinit1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_D4int16_mem(short *val) {
  return ((*val) & (-0xD4 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D4int16_mem>:
movzwl (%rdi),%eax
test   $0xff2c,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D4int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -212
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int HighestFrequency(char *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char arr[] = {'H', 'H', 'A', 'D', 'R', 'B', 'C'};
  printf("The character that has the highest occurence is %c\n",
         HighestFrequency(arr, 7));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0xb(%rbp),%rdi
mov    $0x7,%esi
call   1030 <HighestFrequency@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x43425244,0x3(%rsp)
43
movl   $0x44414848,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1030 <HighestFrequency@plt>
lea    0xec3(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.arr = [7 x i8] c"HHADRBC"
@.str = [52 x i8] c"The character that has the highest occurence is %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
store i32 0, i32* %1
%3 = bitcast [7 x i8]* %2 to i8*
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%5 = call i32 @HighestFrequency(i8* %4, i32 7)
%6 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [7 x i8] c"HHADRBC"
@.str = [52 x i8] c"The character that has the highest occurence is %c\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i32 @HighestFrequency(i8* %2, i32 7)
%4 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
struct ibv_async_event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ibv_ack_async_event(struct ibv_async_event *);
void mlx4_glue_ack_async_event(struct ibv_async_event *event) {
  ibv_ack_async_event(event);
}


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

x86 assembly (clang, -O2):
<mlx4_glue_ack_async_event>:
jmp    1030 <ibv_ack_async_event@plt>

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

LLVM IR (-O2):
%struct.ibv_async_event = type { i32 }
define void @mlx4_glue_ack_async_event(%struct.ibv_async_event* %0) {
%2 = tail call i32 @ibv_ack_async_event(%struct.ibv_async_event* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ posix_binary_file_delete(char *);
void ext_configuration_delete(void) {
  posix_binary_file_delete("kaa_configuration.bin");
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"kaa_configuration.bin\00"
define void @ext_configuration_delete() {
%1 = call i32 @posix_binary_file_delete(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"kaa_configuration.bin\00"
define void @ext_configuration_delete() {
%1 = tail call i32 @posix_binary_file_delete(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int x = 123;
  switch (x) {
  do_again:
  case 100:
    x *= 10;
  case 101:
    x *= 10;
    printf("x: %d\n", x);
    break;
  defau1t:
  default:
    x = 100;
    goto do_again;
    break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x7b,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x64,%eax
je     1157 <main+0x47>
jmp    1141 <main+0x31>
mov    -0x18(%rbp),%eax
sub    $0x65,%eax
je     115e <main+0x4e>
jmp    1179 <main+0x69>
jmp    1157 <main+0x47>
imul   $0xa,-0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
imul   $0xa,-0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
jmp    1185 <main+0x75>
movl   $0x64,-0x14(%rbp)
jmp    1152 <main+0x42>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2710,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"x: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 123, i32* %6
%7 = load i32, i32* %6
switch i32 %7, label %18 [
i32 100, label %9
i32 101, label %12
]
8: ; preds = %18
br label %9
9: ; preds = %2, %8
%10 = load i32, i32* %6
%11 = mul nsw i32 %10, 10
store i32 %11, i32* %6
br label %12
12: ; preds = %2, %9
%13 = load i32, i32* %6
%14 = mul nsw i32 %13, 10
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %19
17: ; No predecessors!
br label %18
18: ; preds = %2, %17
store i32 100, i32* %6
br label %8
19: ; preds = %12
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [7 x i8] c"x: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 10000)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ min_width;
};
typedef TYPE_1__ XIconSize;

/* Variables and functions */
int get_XIconSize_min_width(void *_p) {
  return (int)((XIconSize *)_p)->min_width;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XIconSize_min_width(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XIconSize_min_width(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ omp_set_num_threads(int);
int main(void) {
  omp_set_num_threads(10);
  for (int i = 0; i < 100000; i++) {
#pragma omp parallel for
    for (int j = 0; j < 5000; j++) {
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <omp_set_num_threads@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x186a0,-0x8(%rbp)
jge    1177 <main+0x67>
movl   $0x0,-0xc(%rbp)
cmpl   $0x1388,-0xc(%rbp)
jge    1164 <main+0x54>
jmp    1156 <main+0x46>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <main+0x34>
jmp    1169 <main+0x59>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <omp_set_num_threads@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @omp_set_num_threads(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ map_islegalvert(int);
int marker_left(int pos) {
  do {
    pos -= 1;
    if (pos < 0)
      pos = 63;
  } while (!map_islegalvert(pos));
  return pos;
}


x86 assembly (clang, -O0):
<marker_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1135 <marker_left+0x25>
movl   $0x3f,-0x4(%rbp)
jmp    113a <marker_left+0x2a>
mov    -0x4(%rbp),%edi
call   1030 <map_islegalvert@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    111b <marker_left+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<marker_left>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x3f,%ebp
nopw   0x0(%rax,%rax,1)
test   %ebx,%ebx
lea    -0x1(%rbx),%eax
mov    %eax,%ebx
cmovle %ebp,%ebx
mov    %ebx,%edi
call   1030 <map_islegalvert@plt>
test   %eax,%eax
je     1120 <marker_left+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @marker_left(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %10, %1
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %3
store i32 63, i32* %2
br label %9
9: ; preds = %8, %3
br label %10
10: ; preds = %9
%11 = load i32, i32* %2
%12 = call i32 @map_islegalvert(i32 %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br i1 %14, label %3, label %15
15: ; preds = %10
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @marker_left(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = add nsw i32 %3, -1
%5 = icmp slt i32 %3, 1
%6 = select i1 %5, i32 63, i32 %4
%7 = tail call i32 @map_islegalvert(i32 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %2, label %9
9: ; preds = %2
ret i32 %6
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ traverse(struct TreeNode *, int, int, int *);
int rangeSumBST(struct TreeNode *root, int L, int R) {
  if (!root) {
    return 0;
  }
  int sum = 0;
  traverse(root, L, R, &sum);
  return sum;
}


x86 assembly (clang, -O0):
<rangeSumBST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1139 <rangeSumBST+0x29>
movl   $0x0,-0x4(%rbp)
jmp    1159 <rangeSumBST+0x49>
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    -0x1c(%rbp),%rcx
call   1030 <traverse@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rangeSumBST>:
test   %rdi,%rdi
je     1131 <rangeSumBST+0x21>
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rcx
call   1030 <traverse@plt>
mov    0x4(%rsp),%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32 @rangeSumBST(%struct.TreeNode* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.TreeNode*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.TreeNode* %0, %struct.TreeNode** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load %struct.TreeNode*, %struct.TreeNode** %5
%10 = icmp ne %struct.TreeNode* %9, null
br i1 %10, label %12, label %11
11: ; preds = %3
store i32 0, i32* %4
br label %18
12: ; preds = %3
store i32 0, i32* %8
%13 = load %struct.TreeNode*, %struct.TreeNode** %5
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = call i32 @traverse(%struct.TreeNode* %13, i32 %14, i32 %15, i32* %8)
%17 = load i32, i32* %8
store i32 %17, i32* %4
br label %18
18: ; preds = %12, %11
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32 @rangeSumBST(%struct.TreeNode* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = icmp eq %struct.TreeNode* %0, null
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%8 = call i32 @traverse(%struct.TreeNode* %0, i32 %1, i32 %2, i32* %4)
%9 = load i32, i32* %4
br label %10
10: ; preds = %3, %6
%11 = phi i32 [ %9, %6 ], [ 0, %3 ]
ret i32 %11
}
__typeof__(strncpy(1, 1, (void *)1)) test_strncpy_173(void) {
  return strncpy(1, 1, (void *)1);
}


x86 assembly (clang, -O0):
<test_strncpy_173>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
call   1030 <strncpy@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strncpy_173>:
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
define i8* @test_strncpy_173() {
%1 = call i8* @strncpy(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i64 1)
ret i8* %1
}

LLVM IR (-O2):
define i8* @test_strncpy_173() {
%1 = tail call i8* @strncpy(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i64 1)
ret i8* inttoptr (i64 1 to i8*)
}
__typeof__(strncat(1, 1, 1)) test_strncat_166(void) { return strncat(1, 1, 1); }


x86 assembly (clang, -O0):
<test_strncat_166>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
call   1030 <strncat@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strncat_166>:
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
jmp    1030 <strncat@plt>

LLVM IR (-O0):
define i8* @test_strncat_166() {
%1 = call i8* @strncat(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i64 1)
ret i8* %1
}

LLVM IR (-O2):
define i8* @test_strncat_166() {
%1 = tail call i8* @strncat(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i64 1)
ret i8* inttoptr (i64 1 to i8*)
}
/* Variables and functions */
scalar_t__ atoi(char *);
int /*<<< orphan*/ delete_function(unsigned int);
void remove_plot(char *cmd) { delete_function((unsigned int)atoi(cmd)); }


x86 assembly (clang, -O0):
<remove_plot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,%edi
call   1040 <delete_function@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_plot>:
push   %rax
call   1030 <atoi@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <delete_function@plt>

LLVM IR (-O0):
define void @remove_plot(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @atoi(i8* %3)
%5 = trunc i64 %4 to i32
%6 = call i32 @delete_function(i32 %5)
ret void
}

LLVM IR (-O2):
define void @remove_plot(i8* nocapture %0) {
%2 = tail call i64 @atoi(i8* %0)
%3 = trunc i64 %2 to i32
%4 = tail call i32 @delete_function(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: bt [-D \"foodb -arg\"] [core-or-program-name]\n", stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"Usage: bt [-D \22foodb -arg\22] [core-or-program-name]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [52 x i8] c"Usage: bt [-D \22foodb -arg\22] [core-or-program-name]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int element_header_size(void *);
void *skip_elem_header(void *element_surface) {
  return element_header_size(element_surface) + (void *)element_surface;
}


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

x86 assembly (clang, -O2):
<skip_elem_header>:
push   %rbx
mov    %rdi,%rbx
call   1030 <element_header_size@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skip_elem_header(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @element_header_size(i8* %3)
%5 = load i8*, i8** %2
%6 = sext i32 %4 to i64
%7 = getelementptr i8, i8* %5, i64 %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @skip_elem_header(i8* %0) {
%2 = tail call i32 @element_header_size(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr i8, i8* %0, i64 %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: ./rw <input file> <output file>\n");
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"usage: ./rw <input file> <output file>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 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 = [40 x i8] c"usage: ./rw <input file> <output file>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
__attribute__((no, noclone)) char *f1(char *p) { return p + 1; }


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

x86 assembly (clang, -O2):
<f1>:
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @f1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
ret i8* %4
}

LLVM IR (-O2):
define i8* @f1(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR89_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR89_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

LLVM IR (-O0):
define void @U_WMR89_swap(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 @U_WMRNOTIMPLEMENTED_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMR89_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void fyl2x() {
  db(0xD9);
  db(0xF1);
}


x86 assembly (clang, -O0):
<fyl2x>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd9,%edi
call   1030 <db@plt>
mov    $0xf1,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fyl2x>:
push   %rax
mov    $0xd9,%edi
call   1030 <db@plt>
mov    $0xf1,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @fyl2x() {
%1 = call i32 @db(i32 217)
%2 = call i32 @db(i32 241)
ret void
}

LLVM IR (-O2):
define void @fyl2x() {
%1 = tail call i32 @db(i32 217)
%2 = tail call i32 @db(i32 241)
ret void
}
int letter(c)
register c;
{ return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_'); }


x86 assembly (clang, -O0):
<letter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1120 <letter+0x20>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1143 <letter+0x43>
cmpl   $0x41,-0x4(%rbp)
jl     1139 <letter+0x39>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1143 <letter+0x43>
cmpl   $0x5f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<letter>:
mov    %edi,%eax
and    $0xffffffdf,%eax
add    $0xffffffbf,%eax
cmp    $0x1a,%eax
setb   %al
cmp    $0x5f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @letter(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %17, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br i1 %13, label %17, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 95
br label %17
17: ; preds = %14, %11, %5
%18 = phi i1 [ true, %11 ], [ true, %5 ], [ %16, %14 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @letter(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = icmp eq i32 %0, 95
%6 = or i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
int reverse_order(int a, int b) { return a - b; }


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

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

LLVM IR (-O0):
define i32 @reverse_order(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @reverse_order(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ISandBox_print_wcs(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int ISandBox_print_wcs_ln(FILE *fp, wchar_t *str) {
  int result;
  result = ISandBox_print_wcs(fp, str);
  fprintf(fp, "\n");
  return result;
}


x86 assembly (clang, -O0):
<ISandBox_print_wcs_ln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <ISandBox_print_wcs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISandBox_print_wcs_ln>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <ISandBox_print_wcs@plt>
mov    %eax,%ebp
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ISandBox_print_wcs_ln(i32* %0, i32* %1) {
%3 = tail call i32 @ISandBox_print_wcs(i32* %0, i32* %1)
%4 = tail call i32 @fputc(i32 10, i32* %0)
ret i32 %3
}
/* Variables and functions */
int input_eth_rx();
unsigned get_eth() { return input_eth_rx(); }


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

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

LLVM IR (-O0):
define i32 @get_eth() {
%1 = call i32 (...) @input_eth_rx()
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_eth() {
%1 = tail call i32 (...) @input_eth_rx()
ret i32 %1
}
void INT_Excep_SCI6_TXI6(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI6_TXI6() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
int get_key(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ prepare_key(int);
char const *smaunch_fs_has_database();
int smaunch_fs_context_add(const char *key) {
  int keyi;
  assert(key);
  assert(smaunch_fs_has_database());
  keyi = get_key(key, 0);
  if (keyi < 0)
    return keyi;
  prepare_key(keyi);
  return 0;
}


x86 assembly (clang, -O0):
<smaunch_fs_context_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    $0x0,%al
call   1060 <smaunch_fs_has_database@plt>
mov    %rax,%rdi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1050 <get_key@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1187 <smaunch_fs_context_add+0x47>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1196 <smaunch_fs_context_add+0x56>
mov    -0x14(%rbp),%edi
call   1030 <prepare_key@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smaunch_fs_context_add>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <assert@plt>
xor    %ebp,%ebp
xor    %eax,%eax
call   1060 <smaunch_fs_has_database@plt>
mov    %rax,%rdi
call   1040 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <get_key@plt>
test   %eax,%eax
js     1173 <smaunch_fs_context_add+0x33>
mov    %eax,%edi
call   1030 <prepare_key@plt>
jmp    1175 <smaunch_fs_context_add+0x35>
mov    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @smaunch_fs_context_add(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @assert(i8* %5)
%7 = call i8* (...) @smaunch_fs_has_database()
%8 = call i32 @assert(i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @get_key(i8* %9, i32 0)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = load i32, i32* %4
store i32 %14, i32* %2
br label %18
15: ; preds = %1
%16 = load i32, i32* %4
%17 = call i32 @prepare_key(i32 %16)
store i32 0, i32* %2
br label %18
18: ; preds = %15, %13
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @smaunch_fs_context_add(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i8* (...) @smaunch_fs_has_database()
%4 = tail call i32 @assert(i8* %3)
%5 = tail call i32 @get_key(i8* %0, i32 0)
%6 = icmp slt i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @prepare_key(i32 %5)
br label %9
9: ; preds = %1, %7
%10 = phi i32 [ 0, %7 ], [ %5, %1 ]
ret i32 %10
}
int test_imm_A9uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xA9 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A9uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 169
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
float CLOCKS_PER_SEC;
float sec(clock_t clocks) { return (float)clocks / CLOCKS_PER_SEC; }


x86 assembly (clang, -O0):
<sec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
divss  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sec>:
cvtsi2ss %rdi,%xmm0
mov    0x2edc(%rip),%rax
divss  (%rax),%xmm0
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global float 0.000000e+00
define float @sec(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to float
%5 = load float, float* @CLOCKS_PER_SEC
%6 = fdiv float %4, %5
ret float %6
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global float 0.000000e+00
define float @sec(i64 %0) {
%2 = sitofp i64 %0 to float
%3 = load float, float* @CLOCKS_PER_SEC
%4 = fdiv float %2, %3
ret float %4
}