xunge/DecIR huggingface dataset:
int multiplicacion(int a, int b) { return a * b; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fwrite(void *, size_t, size_t, int /*<<< orphan*/ *);
void uninitvar_fwrite(void) {
  void *ptr;
  size_t size;
  size_t nobj;
  FILE *stream;
  (void)fwrite(ptr, size, nobj, stream);
}


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

x86 assembly (clang, -O2):
<uninitvar_fwrite>:
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
define void @uninitvar_fwrite() {
%1 = alloca i8*
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32*
%5 = load i8*, i8** %1
%6 = load i64, i64* %2
%7 = load i64, i64* %3
%8 = load i32*, i32** %4
%9 = call i32 @fwrite(i8* %5, i64 %6, i64 %7, i32* %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_fwrite() {
%1 = tail call i32 @fwrite(i8* undef, i64 undef, i64 undef, i32* undef)
ret void
}
int g_DUMMY_menu_append_multipixbutton(int menu_id, char *pixinfo1[],
                                       char *pixinfo2[], char *pixinfo3[],
                                       char *pixinfo4[], int return_id) {
  menu_id = menu_id;
  pixinfo1 = pixinfo1;
  pixinfo2 = pixinfo2;
  pixinfo3 = pixinfo3;
  pixinfo4 = pixinfo4;
  return_id = return_id;
  return -1;
}


x86 assembly (clang, -O0):
<g_DUMMY_menu_append_multipixbutton>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @g_DUMMY_menu_append_multipixbutton(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2, i8** nocapture readnone %3, i8** nocapture readnone %4, i32 %5) {
ret i32 -1
}
long SINT_TO_LINT(short var) {
  long newvar;
  newvar = (long)var;
  return newvar;
}


x86 assembly (clang, -O0):
<SINT_TO_LINT>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswq -0x2(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SINT_TO_LINT>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @SINT_TO_LINT(i16 signext %0) {
%2 = alloca i16
%3 = alloca i64
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = sext i16 %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @SINT_TO_LINT(i16 signext %0) {
%2 = sext i16 %0 to i64
ret i64 %2
}
int isregi(char c) {
  if ((c >= '0') && (c <= '7'))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<isregi>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <isregi+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x37,%eax
jg     1130 <isregi+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1137 <isregi+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isregi>:
and    $0xf8,%dil
xor    %eax,%eax
cmp    $0x30,%dil
sete   %al
neg    %eax
ret

LLVM IR (-O0):
define i32 @isregi(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 55
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 -1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @isregi(i8 signext %0) {
%2 = and i8 %0, -8
%3 = icmp eq i8 %2, 48
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct bstree_node {
  int dummy;
};

/* Variables and functions */
struct bstree_node *__bstree_end(struct bstree_node *, int);
struct bstree_node *bstree_last(struct bstree_node *tree) {
  return __bstree_end(tree, 1);
}


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

x86 assembly (clang, -O2):
<bstree_last>:
mov    $0x1,%esi
jmp    1030 <__bstree_end@plt>

LLVM IR (-O0):
%struct.bstree_node = type { i32 }
define %struct.bstree_node* @bstree_last(%struct.bstree_node* %0) {
%2 = alloca %struct.bstree_node*
store %struct.bstree_node* %0, %struct.bstree_node** %2
%3 = load %struct.bstree_node*, %struct.bstree_node** %2
%4 = call %struct.bstree_node* @__bstree_end(%struct.bstree_node* %3, i32 1)
ret %struct.bstree_node* %4
}

LLVM IR (-O2):
%struct.bstree_node = type { i32 }
define %struct.bstree_node* @bstree_last(%struct.bstree_node* %0) {
%2 = tail call %struct.bstree_node* @__bstree_end(%struct.bstree_node* %0, i32 1)
ret %struct.bstree_node* %2
}
void foo544() {}


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

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

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

LLVM IR (-O2):
define void @foo544() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR4B_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


x86 assembly (clang, -O0):
<U_WMR4B_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_WMR4B_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

LLVM IR (-O0):
define void @U_WMR4B_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_WMR4B_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
double df_du(double u) { return u; }


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

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

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

LLVM IR (-O2):
define double @df_du(double returned %0) {
ret double %0
}
int frounddown(int x) { return x / 16384; }


x86 assembly (clang, -O0):
<frounddown>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4000,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<frounddown>:
lea    0x3fff(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0xe,%eax
ret

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

LLVM IR (-O2):
define i32 @frounddown(i32 %0) {
%2 = sdiv i32 %0, 16384
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p224_from_montgomery(uintptr_t, uintptr_t);
void fiat_p224_from_montgomery(uint32_t out1[7], const uint32_t arg1[7]) {
  internal_fiat_p224_from_montgomery((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_p224_from_montgomery>:
jmp    1030 <internal_fiat_p224_from_montgomery@plt>

LLVM IR (-O0):
define void @fiat_p224_from_montgomery(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p224_from_montgomery(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p224_from_montgomery(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p224_from_montgomery(i64 %3, i64 %4)
ret void
}
/* Variables and functions */
int ffun(int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int i;
  for (i = 1000; i < 10000; i++)
    if (ffun(i) == 9 * i)
      break;
  printf("%d", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3e8,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jge    1168 <main+0x48>
mov    -0x4(%rbp),%edi
call   1040 <ffun@plt>
imul   $0x9,-0x4(%rbp),%ecx
cmp    %ecx,%eax
jne    1155 <main+0x35>
jmp    1168 <main+0x48>
jmp    115a <main+0x3a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <main+0xf>
mov    -0x4(%rbp),%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x3e8,%ebx
mov    $0x231f,%ebp
nopl   (%rax)
mov    %ebx,%edi
call   1040 <ffun@plt>
add    $0x9,%ebp
cmp    %eax,%ebp
je     114e <main+0x2e>
add    $0x1,%ebx
cmp    $0x2710,%ebx
jne    1130 <main+0x10>
mov    $0x2710,%ebx
lea    0xeab(%rip),%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
store i32 1000, i32* %1
br label %2
2: ; preds = %13, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 10000
br i1 %4, label %5, label %16
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @ffun(i32 %6)
%8 = load i32, i32* %1
%9 = mul nsw i32 9, %8
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %5
br label %16
12: ; preds = %5
br label %13
13: ; preds = %12
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
br label %2
16: ; preds = %11, %2
%17 = load i32, i32* %1
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
br label %1
1: ; preds = %0, %6
%2 = phi i32 [ 1000, %0 ], [ %7, %6 ]
%3 = tail call i32 @ffun(i32 %2)
%4 = mul nuw nsw i32 %2, 9
%5 = icmp eq i32 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 10000
br i1 %8, label %9, label %1
9: ; preds = %1, %6
%10 = phi i32 [ %2, %1 ], [ 10000, %6 ]
%11 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}
/* Type definitions */
struct forf_env {
  int dummy;
};

/* Variables and functions */
long forf_pop_num(struct forf_env *);
int /*<<< orphan*/ forf_push_num(struct forf_env *, long);
void forf_proc_lshift(struct forf_env *env) {
  long a = forf_pop_num(env);
  long b = forf_pop_num(env);
  forf_push_num(env, b << a);
}


x86 assembly (clang, -O0):
<forf_proc_lshift>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <forf_pop_num@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <forf_pop_num@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rcx
shl    %cl,%rsi
call   1040 <forf_push_num@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forf_proc_lshift>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <forf_pop_num@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <forf_pop_num@plt>
mov    %r14d,%ecx
shl    %cl,%rax
mov    %rbx,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <forf_push_num@plt>

LLVM IR (-O0):
%struct.forf_env = type { i32 }
define void @forf_proc_lshift(%struct.forf_env* %0) {
%2 = alloca %struct.forf_env*
%3 = alloca i64
%4 = alloca i64
store %struct.forf_env* %0, %struct.forf_env** %2
%5 = load %struct.forf_env*, %struct.forf_env** %2
%6 = call i64 @forf_pop_num(%struct.forf_env* %5)
store i64 %6, i64* %3
%7 = load %struct.forf_env*, %struct.forf_env** %2
%8 = call i64 @forf_pop_num(%struct.forf_env* %7)
store i64 %8, i64* %4
%9 = load %struct.forf_env*, %struct.forf_env** %2
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = shl i64 %10, %11
%13 = call i32 @forf_push_num(%struct.forf_env* %9, i64 %12)
ret void
}

LLVM IR (-O2):
%struct.forf_env = type { i32 }
define void @forf_proc_lshift(%struct.forf_env* %0) {
%2 = tail call i64 @forf_pop_num(%struct.forf_env* %0)
%3 = tail call i64 @forf_pop_num(%struct.forf_env* %0)
%4 = shl i64 %3, %2
%5 = tail call i32 @forf_push_num(%struct.forf_env* %0, i64 %4)
ret void
}
int palindrome(int num) {
  int left = sizeof(unsigned int) * 8 - 1;
  int right = 0;
  while (left > right) {
    if (((num & (1 << left)) != 0) != ((num & (1 << right)) != 0))
      return 0;
    left--;
    right++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<palindrome>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1f,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1189 <palindrome+0x89>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%ecx
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x14(%rbp),%ecx
and    %edx,%ecx
cmp    $0x0,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     1172 <palindrome+0x72>
movl   $0x0,-0x4(%rbp)
jmp    1190 <palindrome+0x90>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <palindrome+0x15>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<palindrome>:
xor    %eax,%eax
mov    $0x1e,%r8d
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
lea    0x1(%r8),%ecx
mov    %edi,%r9d
shr    %cl,%r9d
mov    %edi,%esi
mov    %edx,%ecx
shr    %cl,%esi
xor    %r9d,%esi
test   $0x1,%sil
jne    113d <palindrome+0x3d>
add    $0x1,%edx
lea    -0x1(%r8),%ecx
cmp    %edx,%r8d
mov    %ecx,%r8d
jg     1110 <palindrome+0x10>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @palindrome(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 31, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %25, %1
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %30
10: ; preds = %6
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = shl i32 1, %12
%14 = and i32 %11, %13
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i32
%17 = load i32, i32* %3
%18 = load i32, i32* %5
%19 = shl i32 1, %18
%20 = and i32 %17, %19
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i32
%23 = icmp ne i32 %16, %22
br i1 %23, label %24, label %25
24: ; preds = %10
store i32 0, i32* %2
br label %31
25: ; preds = %10
%26 = load i32, i32* %4
%27 = add nsw i32 %26, -1
store i32 %27, i32* %4
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %6
30: ; preds = %6
store i32 1, i32* %2
br label %31
31: ; preds = %30, %24
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @palindrome(i32 %0) {
br label %2
2: ; preds = %1, %10
%3 = phi i32 [ 0, %1 ], [ %12, %10 ]
%4 = phi i32 [ 31, %1 ], [ %11, %10 ]
%5 = lshr i32 %0, %4
%6 = lshr i32 %0, %3
%7 = xor i32 %6, %5
%8 = and i32 %7, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = add nsw i32 %4, -1
%12 = add nuw nsw i32 %3, 1
%13 = icmp sgt i32 %11, %12
br i1 %13, label %2, label %14
14: ; preds = %10, %2
%15 = phi i32 [ 0, %2 ], [ 1, %10 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ UARTGetChar();
int /*<<< orphan*/ UARTTransmitEmpty();
int /*<<< orphan*/ UARTWriteByte(int /*<<< orphan*/);
void irq_handler() {
  while (!UARTTransmitEmpty())
    ;
  UARTWriteByte(UARTGetChar());
  *((int *)0xFFFFFFA8) = 0xffffffff;
}


x86 assembly (clang, -O0):
<irq_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1139 <irq_handler+0x9>
mov    $0x0,%al
call   1030 <UARTTransmitEmpty@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1155 <irq_handler+0x25>
jmp    115a <irq_handler+0x2a>
jmp    1139 <irq_handler+0x9>
mov    $0x0,%al
call   1050 <UARTGetChar@plt>
mov    %eax,%edi
call   1040 <UARTWriteByte@plt>
mov    $0xffffffa8,%eax
movl   $0xffffffff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_handler>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <UARTTransmitEmpty@plt>
test   %eax,%eax
je     1140 <irq_handler+0x10>
xor    %eax,%eax
call   1050 <UARTGetChar@plt>
mov    %eax,%edi
call   1040 <UARTWriteByte@plt>
mov    $0xffffffa8,%eax
movl   $0xffffffff,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @irq_handler() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @UARTTransmitEmpty()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = call i32 (...) @UARTGetChar()
%8 = call i32 @UARTWriteByte(i32 %7)
store i32 -1, i32* inttoptr (i64 4294967208 to i32*)
ret void
}

LLVM IR (-O2):
define void @irq_handler() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @UARTTransmitEmpty()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call i32 (...) @UARTGetChar()
%6 = tail call i32 @UARTWriteByte(i32 %5)
store i32 -1, i32* inttoptr (i64 4294967208 to i32*)
ret void
}
__attribute__((no)) void test2(char *p, int c, int len) {
  __builtin_memset(p, (char)c, len);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
movsbl %al,%eax
movslq -0x10(%rbp),%rdx
movzbl %al,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
movslq %edx,%rdx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @test2(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 = trunc i32 %8 to i8
%10 = sext i8 %9 to i32
%11 = trunc i32 %10 to i8
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
ret void
}

LLVM IR (-O2):
define void @test2(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = trunc i32 %1 to i8
%5 = sext i32 %2 to i64
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 %4, i64 %5, i1 false)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int ntoh32(int);
uint64_t ntoh64(uint64_t n) {
  return (((uint64_t)ntoh32(n)) << 32) + ntoh32(n >> 32);
}


x86 assembly (clang, -O0):
<ntoh64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ntoh32@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <ntoh32@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntoh64>:
push   %rax
call   1030 <ntoh32@plt>
pop    %rax
jmp    1030 <ntoh32@plt>

LLVM IR (-O0):
define i32 @ntoh64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ntoh32(i32 %3)
%5 = shl i32 %4, 32
%6 = load i32, i32* %2
%7 = ashr i32 %6, 32
%8 = call i32 @ntoh32(i32 %7)
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @ntoh64(i32 %0) {
%2 = tail call i32 @ntoh32(i32 %0)
%3 = tail call i32 @ntoh32(i32 poison)
ret i32 poison
}
void RTLdrRelocate(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLdrRelocate() {
ret void
}
int isNotComp(char *input, int len) {
  if (len >= 3 && input[0] == '1' && input[1] == '9' && input[2] == '0')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isNotComp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jl     1153 <isNotComp+0x53>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
jne    1153 <isNotComp+0x53>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x39,%eax
jne    1153 <isNotComp+0x53>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x30,%eax
jne    1153 <isNotComp+0x53>
movl   $0x1,-0x4(%rbp)
jmp    115a <isNotComp+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNotComp>:
cmp    $0x3,%esi
jl     111b <isNotComp+0x1b>
cmpb   $0x31,(%rdi)
jne    111b <isNotComp+0x1b>
cmpb   $0x39,0x1(%rdi)
jne    111b <isNotComp+0x1b>
mov    $0x1,%eax
cmpb   $0x30,0x2(%rdi)
je     111d <isNotComp+0x1d>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isNotComp(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp sge i32 %6, 3
br i1 %7, label %8, label %27
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 49
br i1 %13, label %14, label %27
14: ; preds = %8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 57
br i1 %19, label %20, label %27
20: ; preds = %14
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 2
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 48
br i1 %25, label %26, label %27
26: ; preds = %20
store i32 1, i32* %3
br label %28
27: ; preds = %20, %14, %8, %2
store i32 0, i32* %3
br label %28
28: ; preds = %27, %26
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @isNotComp(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 2
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 49
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 57
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = getelementptr inbounds i8, i8* %0, i64 2
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 48
br i1 %14, label %16, label %15
15: ; preds = %11, %7, %4, %2
br label %16
16: ; preds = %11, %15
%17 = phi i32 [ 0, %15 ], [ 1, %11 ]
ret i32 %17
}
void av_get_frame_filename() {}


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

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

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

LLVM IR (-O2):
define void @av_get_frame_filename() {
ret void
}
/* Variables and functions */
int strncmp(char const *, char const *, size_t);
int mutt_strncmp(const char *a, const char *b, size_t l) {
  return strncmp(a ? a : "", b ? b : "", l);
}


x86 assembly (clang, -O0):
<mutt_strncmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <mutt_strncmp+0x2c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    114c <mutt_strncmp+0x3c>
lea    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    114c <mutt_strncmp+0x3c>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116c <mutt_strncmp+0x5c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    117c <mutt_strncmp+0x6c>
lea    0xe8d(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    117c <mutt_strncmp+0x6c>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncmp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutt_strncmp>:
test   %rdi,%rdi
lea    0xee6(%rip),%rax
cmove  %rax,%rdi
test   %rsi,%rsi
cmove  %rax,%rsi
jmp    1030 <strncmp@plt>

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @mutt_strncmp(i8* %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %0, null
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
%6 = icmp eq i8* %1, null
%7 = select i1 %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %1
%8 = tail call i32 @strncmp(i8* %5, i8* %7, i64 %2)
ret i32 %8
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ function_causing_seg_fault();
int main(void) {
  function_causing_seg_fault();
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <function_causing_seg_fault@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @function_causing_seg_fault()
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @function_causing_seg_fault()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("hi\n");
  printf("hi\n");
}


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

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

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

LLVM IR (-O2):
@str.1 = [3 x i8] c"hi\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.1, i64 0, i64 0))
ret i32 0
}
void test59_InitTestM2_foo__E() {}


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

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

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

LLVM IR (-O2):
define void @test59_InitTestM2_foo__E() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ ranval(void *);
uint64_t __randnum(void *c) { return (uint64_t)ranval(c); }


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

x86 assembly (clang, -O2):
<__randnum>:
jmp    1030 <ranval@plt>

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

LLVM IR (-O2):
define i32 @__randnum(i8* %0) {
%2 = tail call i32 @ranval(i8* %0)
ret i32 %2
}
unsigned int getRootNode(unsigned int *arrLoc, unsigned int val) {
  unsigned int aPos, a;
  aPos = val;
  a = arrLoc[aPos];
  while (a != -1) {
    aPos = a;
    a = arrLoc[aPos];
  }
  return aPos;
}


x86 assembly (clang, -O0):
<getRootNode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1140 <getRootNode+0x40>
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
jmp    111e <getRootNode+0x1e>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRootNode>:
mov    %esi,%eax
mov    %esi,%ecx
mov    (%rdi,%rcx,4),%esi
cmp    $0xffffffff,%esi
jne    1100 <getRootNode>
ret

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

LLVM IR (-O2):
define i32 @getRootNode(i32* nocapture %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %1, %2 ], [ %7, %3 ]
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fn0800_01FF();
void fn0800_0222() {
  fn0800_01FF();
  fn0800_01FF();
  fn0800_01FF();
  fn0800_01FF();
  fn0800_01FF();
  fn0800_01FF();
  fn0800_01FF();
  fn0800_01FF();
  fn0800_01FF();
  fn0800_01FF();
  return;
}


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

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

LLVM IR (-O0):
define void @fn0800_0222() {
%1 = call i32 (...) @fn0800_01FF()
%2 = call i32 (...) @fn0800_01FF()
%3 = call i32 (...) @fn0800_01FF()
%4 = call i32 (...) @fn0800_01FF()
%5 = call i32 (...) @fn0800_01FF()
%6 = call i32 (...) @fn0800_01FF()
%7 = call i32 (...) @fn0800_01FF()
%8 = call i32 (...) @fn0800_01FF()
%9 = call i32 (...) @fn0800_01FF()
%10 = call i32 (...) @fn0800_01FF()
ret void
}

LLVM IR (-O2):
define void @fn0800_0222() {
%1 = tail call i32 (...) @fn0800_01FF()
%2 = tail call i32 (...) @fn0800_01FF()
%3 = tail call i32 (...) @fn0800_01FF()
%4 = tail call i32 (...) @fn0800_01FF()
%5 = tail call i32 (...) @fn0800_01FF()
%6 = tail call i32 (...) @fn0800_01FF()
%7 = tail call i32 (...) @fn0800_01FF()
%8 = tail call i32 (...) @fn0800_01FF()
%9 = tail call i32 (...) @fn0800_01FF()
%10 = tail call i32 (...) @fn0800_01FF()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int main() {
  char buffer[5];
  read(0, buffer, 4);
  if (buffer[0] == 'a') {
    puts("First letter good");
  } else {
    puts("First letter bad");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x9(%rbp),%rsi
xor    %edi,%edi
mov    $0x4,%edx
call   1040 <read@plt>
movsbl -0x9(%rbp),%eax
cmp    $0x61,%eax
jne    115d <main+0x3d>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
jmp    1169 <main+0x49>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x3(%rsp),%rsi
xor    %edi,%edi
mov    $0x4,%edx
call   1040 <read@plt>
cmpb   $0x61,0x3(%rsp)
lea    0xec2(%rip),%rax
lea    0xecd(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"First letter good\00"
@.str.1 = [17 x i8] c"First letter bad\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%4 = call i32 @read(i32 0, i8* %3, i32 4)
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 97
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"First letter good\00"
@.str.1 = [17 x i8] c"First letter bad\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i32 4)
%4 = load i8, i8* %2
%5 = icmp eq i8 %4, 97
%6 = select i1 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0)
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
ret i32 0
}
void msg2() {
  printf("I am in function %s\n", __func__);
  msg1();
}


x86 assembly (clang, -O0):
<msg2>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <msg1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg2>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee6(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <msg1@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"I am in function %s\0A\00"
@__func__.msg2 = [5 x i8] c"msg2\00"
define void @msg2() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.msg2, i64 0, i64 0))
%2 = call i32 (...) @msg1()
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"I am in function %s\0A\00"
@__func__.msg2 = [5 x i8] c"msg2\00"
define void @msg2() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.msg2, i64 0, i64 0))
%2 = tail call i32 (...) @msg1()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aes_cbc(unsigned char *, unsigned char *, unsigned char *,
                           size_t, unsigned char *, int, int /*<<< orphan*/);
void openssl_AES_dec192_CBC(unsigned char *in, unsigned char *out,
                            unsigned char *key, size_t num_blocks,
                            unsigned char *iv) {
  aes_cbc(in, out, key, num_blocks, iv, 192, 0);
}


x86 assembly (clang, -O0):
<openssl_AES_dec192_CBC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0xc0,%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <aes_cbc@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openssl_AES_dec192_CBC>:
push   %rax
movl   $0x0,(%rsp)
mov    $0xc0,%r9d
call   1030 <aes_cbc@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @openssl_AES_dec192_CBC(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i64, i64* %9
%15 = load i8*, i8** %10
%16 = call i32 @aes_cbc(i8* %11, i8* %12, i8* %13, i64 %14, i8* %15, i32 192, i32 0)
ret void
}

LLVM IR (-O2):
define void @openssl_AES_dec192_CBC(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4) {
%6 = tail call i32 @aes_cbc(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4, i32 192, i32 0)
ret void
}
/* Variables and functions */
double sqrt(double);
double my_sqrt(double *args) { return sqrt(args[0]); }


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

x86 assembly (clang, -O2):
<my_sqrt>:
movsd  (%rdi),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1123 <my_sqrt+0x13>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @my_sqrt(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @sqrt(double %2)
ret double %3
}
void ux500_ci_dbg_console_handle_ape_suspend(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @ux500_ci_dbg_console_handle_ape_suspend() {
ret void
}
void test2() { int num = 5; }


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

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

LLVM IR (-O0):
define void @test2() {
%1 = alloca i32
store i32 5, i32* %1
ret void
}

LLVM IR (-O2):
define void @test2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *ptr) {
  if (ptr != (void *)NULL) {
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <xfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
test   %rdi,%rdi
je     111a <xfree+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
scalar_t__ isdigit(int);
scalar_t__ isxdigit(int);
int toupper(int);
int digittoint(int c) {
  if (isxdigit(c)) {
    if (isdigit(c))
      return c - 0x30;
    else
      return toupper(c) - 0x37;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<digittoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <isxdigit@plt>
cmp    $0x0,%rax
je     1180 <digittoint+0x50>
mov    -0x8(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     116d <digittoint+0x3d>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1187 <digittoint+0x57>
mov    -0x8(%rbp),%edi
call   1040 <toupper@plt>
sub    $0x37,%eax
mov    %eax,-0x4(%rbp)
jmp    1187 <digittoint+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digittoint>:
push   %rbx
mov    %edi,%ebx
call   1050 <isxdigit@plt>
test   %rax,%rax
je     114e <digittoint+0x1e>
mov    %ebx,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1152 <digittoint+0x22>
add    $0xffffffd0,%ebx
jmp    115e <digittoint+0x2e>
xor    %ebx,%ebx
jmp    115e <digittoint+0x2e>
mov    %ebx,%edi
call   1040 <toupper@plt>
mov    %eax,%ebx
add    $0xffffffc9,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @digittoint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @isxdigit(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i64 @isdigit(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 48
store i32 %13, i32* %2
br label %19
14: ; preds = %7
%15 = load i32, i32* %3
%16 = call i32 @toupper(i32 %15)
%17 = sub nsw i32 %16, 55
store i32 %17, i32* %2
br label %19
18: ; preds = %1
store i32 0, i32* %2
br label %19
19: ; preds = %18, %14, %11
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @digittoint(i32 %0) {
%2 = tail call i64 @isxdigit(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = tail call i64 @isdigit(i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = add nsw i32 %0, -48
br label %12
9: ; preds = %4
%10 = tail call i32 @toupper(i32 %0)
%11 = add nsw i32 %10, -55
br label %12
12: ; preds = %1, %9, %7
%13 = phi i32 [ %8, %7 ], [ %11, %9 ], [ 0, %1 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, long);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void _E__pr_header(const char *f, long ln, const char *msg) {
  (void)fflush(stdout);
  (void)fprintf(stderr, "%s: \"%s\", line %ld: ", msg, f, ln);
}


x86 assembly (clang, -O0):
<_E__pr_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xea2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_E__pr_header>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
mov    %r14,%r8
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
@.str = [21 x i8] c"%s: \22%s\22, line %ld: \00"
define void @_E__pr_header(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %6
%11 = load i8*, i8** %4
%12 = load i64, i64* %5
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i64 %12)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@.str = [21 x i8] c"%s: \22%s\22, line %ld: \00"
define void @_E__pr_header(i8* %0, i64 %1, i8* %2) {
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %0, i64 %1)
ret void
}
double _I_4(void) { return 0.0; }


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

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

LLVM IR (-O0):
define double @_I_4() {
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @_I_4() {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ error(int, char *, char *, char *);
void illegal_tag(int lineno, char *line, char *cptr) {
  error(lineno, line, cptr, "illegal tag");
}


x86 assembly (clang, -O0):
<illegal_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xecb(%rip),%rcx
call   1030 <error@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"illegal tag\00"
define void @illegal_tag(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @error(i32 %0, i8* %1, i8* %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _irqack();
void irq2() { _irqack(); }


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

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

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

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