xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int pthread_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int pthread_self();
void *thr_func(void *arg) {
  pthread_t TID = pthread_self();
  printf("     Nuovo thread: %u\n", TID);
}


x86 assembly (clang, -O0):
<thr_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr_func>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c" Nuovo thread: %u\0A\00"
define i8* @thr_func(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = call i32 (...) @pthread_self()
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [23 x i8] c" Nuovo thread: %u\0A\00"
define noalias i8* @thr_func(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i8* undef
}
long Memory_unfreed_bytes(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @Memory_unfreed_bytes() {
ret i64 0
}

LLVM IR (-O2):
define i64 @Memory_unfreed_bytes() {
ret i64 0
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ __SYSCALL_LL_E(int /*<<< orphan*/);
int syscall(int, int, unsigned int, int /*<<< orphan*/, int /*<<< orphan*/);
int sync_file_range(int fd, off_t pos, off_t len, unsigned flags) {
  return syscall(341, fd, flags, __SYSCALL_LL_E(pos), __SYSCALL_LL_E(len));
}


x86 assembly (clang, -O0):
<sync_file_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <__SYSCALL_LL_E@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <__SYSCALL_LL_E@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    %eax,%r8d
mov    $0x155,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_file_range>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %edi,%r15d
mov    %esi,%edi
call   1040 <__SYSCALL_LL_E@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1040 <__SYSCALL_LL_E@plt>
mov    $0x155,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @sync_file_range(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = call i32 @__SYSCALL_LL_E(i32 %11)
%13 = load i32, i32* %7
%14 = call i32 @__SYSCALL_LL_E(i32 %13)
%15 = call i32 @syscall(i32 341, i32 %9, i32 %10, i32 %12, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @sync_file_range(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @__SYSCALL_LL_E(i32 %1)
%6 = tail call i32 @__SYSCALL_LL_E(i32 %2)
%7 = tail call i32 @syscall(i32 341, i32 %0, i32 %3, i32 %5, i32 %6)
ret i32 %7
}
int _all_sound_off(struct MIDIController *controller) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.MIDIController = type opaque
define i32 @_all_sound_off(%struct.MIDIController* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_bad() { printf("Nope!\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"Nope!\00"
define void @print_bad() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int test_function_inner(char **, int);
int test_function_outer(char **arr, int size) {
  return test_function_inner(arr, size);
}


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

x86 assembly (clang, -O2):
<test_function_outer>:
jmp    1030 <test_function_inner@plt>

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

LLVM IR (-O2):
define i32 @test_function_outer(i8** %0, i32 %1) {
%3 = tail call i32 @test_function_inner(i8** %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *kAltReverseHelper(struct node *, int, int);
struct node *kAltReverse(struct node *head, int k) {
  return kAltReverseHelper(head, k, true);
}


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

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

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

LLVM IR (-O2):
%struct.node = type { i32 }
define %struct.node* @kAltReverse(%struct.node* %0, i32 %1) {
%3 = tail call %struct.node* @kAltReverseHelper(%struct.node* %0, i32 %1, i32 1)
ret %struct.node* %3
}
int blargg_min(int x, int y) {
  if (y < x)
    x = y;
  return x;
}


x86 assembly (clang, -O0):
<blargg_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    111c <blargg_min+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blargg_min>:
mov    %edi,%eax
cmp    %edi,%esi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @blargg_min(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ damain();
int main() { damain(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @damain()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned short *, int, int, int /*<<< orphan*/ *);
void tiffWriteWord(FILE *fp, unsigned short w) { fwrite(&w, 1, 2, fp); }


x86 assembly (clang, -O0):
<tiffWriteWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xa(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tiffWriteWord>:
push   %rax
mov    %rdi,%rcx
mov    %si,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @tiffWriteWord(i32* %0, i16 zeroext %1) {
%3 = alloca i32*
%4 = alloca i16
store i32* %0, i32** %3
store i16 %1, i16* %4
%5 = load i32*, i32** %3
%6 = call i32 @fwrite(i16* %4, i32 1, i32 2, i32* %5)
ret void
}

LLVM IR (-O2):
define void @tiffWriteWord(i32* nocapture %0, i16 zeroext %1) {
%3 = alloca i16
store i16 %1, i16* %3
%4 = call i32 @fwrite(i16* %3, i32 1, i32 2, i32* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
unsigned char __VERIFIER_nondet_uchar() {
  unsigned char initialValue;
  int byteOffset = 0;
  uint8_t *initialValueAsByte = (uint8_t *)&initialValue;
  for (; byteOffset < sizeof(unsigned char); ++byteOffset) {
    initialValueAsByte[byteOffset] = 0;
  }
  return initialValue;
}


x86 assembly (clang, -O0):
<__VERIFIER_nondet_uchar>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
lea    -0x1(%rbp),%rax
mov    %rax,-0x10(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x1,%rax
jae    113f <__VERIFIER_nondet_uchar+0x3f>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1113 <__VERIFIER_nondet_uchar+0x13>
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @__VERIFIER_nondet_uchar() {
ret i8 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ calculate_sec(int, int *, int *, int *);
void test5(void) {
  int input_sec = 3661;
  int sec, min, hr;
  calculate_sec(input_sec, &sec, &min, &hr);
  assert(hr == 1);
  assert(min == 1);
  assert(sec == 1);
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xe4d,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1030 <calculate_sec@plt>
cmpl   $0x1,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x1,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    $0xe4d,%edi
call   1030 <calculate_sec@plt>
xor    %edi,%edi
cmpl   $0x1,0xc(%rsp)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x1,0x10(%rsp)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x1,0x14(%rsp)
sete   %dil
call   1040 <assert@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @test5() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 3661, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @calculate_sec(i32 %5, i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 1
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 1
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret void
}

LLVM IR (-O2):
define void @test5() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @calculate_sec(i32 3661, i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 1
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32, i32* %1
%17 = icmp eq i32 %16, 1
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
ret void
}
double cdflib_fifdint(double a) { return (double)((int)a); }


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

x86 assembly (clang, -O2):
<cdflib_fifdint>:
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @cdflib_fifdint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
%5 = sitofp i32 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @cdflib_fifdint(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ Output_byte(int);
int /*<<< orphan*/ near_branch(int);
void group_std_branches(int opcode) {
  Output_byte(opcode);
  near_branch(2);
}


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

x86 assembly (clang, -O2):
<group_std_branches>:
push   %rax
call   1040 <Output_byte@plt>
mov    $0x2,%edi
pop    %rax
jmp    1030 <near_branch@plt>

LLVM IR (-O0):
define void @group_std_branches(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @Output_byte(i32 %3)
%5 = call i32 @near_branch(i32 2)
ret void
}

LLVM IR (-O2):
define void @group_std_branches(i32 %0) {
%2 = tail call i32 @Output_byte(i32 %0)
%3 = tail call i32 @near_branch(i32 2)
ret void
}
int isNum(const char *op) { return (op[0] <= '9') && (op[0] >= '0'); }


x86 assembly (clang, -O0):
<isNum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x39,%ecx
mov    %al,-0x9(%rbp)
jg     112d <isNum+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
setge  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNum>:
mov    (%rdi),%cl
add    $0xd0,%cl
xor    %eax,%eax
cmp    $0xa,%cl
setb   %al
ret

LLVM IR (-O0):
define i32 @isNum(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp sle i32 %6, 57
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 48
br label %14
14: ; preds = %8, %1
%15 = phi i1 [ false, %1 ], [ %13, %8 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @isNum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
%5 = zext i1 %4 to i32
ret i32 %5
}
void INT_Excep_CTSU_CTSURD(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_CTSU_CTSURD() {
ret void
}
/* Variables and functions */
bool nrf51_errata_75(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_75() {
ret i32 0
}
int test_imm_13uint32_mem(unsigned int *val) {
  return ((*val) & (0x13 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_13uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 19
%6 = icmp ne i32 %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_13uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 19
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ drv_generic_serial_write(char const *, int);
int /*<<< orphan*/ usleep(int);
void drv_Pertelian_send(const char *data, const unsigned int len) {
  unsigned int i;
  for (i = 0; i < len; i++) {
    drv_generic_serial_write(&data[i], 1);
    usleep(100);
  }
}


x86 assembly (clang, -O0):
<drv_Pertelian_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    116e <drv_Pertelian_send+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%eax
add    %rax,%rdi
mov    $0x1,%esi
call   1030 <drv_generic_serial_write@plt>
mov    $0x64,%edi
call   1040 <usleep@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <drv_Pertelian_send+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_Pertelian_send>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
je     1151 <drv_Pertelian_send+0x31>
mov    %rdi,%rbx
mov    %esi,%r14d
xchg   %ax,%ax
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <drv_generic_serial_write@plt>
mov    $0x64,%edi
call   1040 <usleep@plt>
add    $0x1,%rbx
add    $0xffffffffffffffff,%r14
jne    1130 <drv_Pertelian_send+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @drv_Pertelian_send(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = call i32 @drv_generic_serial_write(i8* %14, i32 1)
%16 = call i32 @usleep(i32 100)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @drv_Pertelian_send(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = tail call i32 @drv_generic_serial_write(i8* %8, i32 1)
%10 = tail call i32 @usleep(i32 100)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_PSLLW_imm(int dst_reg, int amount) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x71);
  addbyte(0xc0 | dst_reg | 0x30);
  addbyte(amount);
}


x86 assembly (clang, -O0):
<MMX_PSLLW_imm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x71,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
or     $0xc0,%edi
or     $0x30,%edi
call   1030 <addbyte@plt>
mov    -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_PSLLW_imm>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x71,%edi
call   1030 <addbyte@plt>
or     $0xf0,%ebp
mov    %ebp,%edi
call   1030 <addbyte@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_PSLLW_imm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 113)
%8 = load i32, i32* %3
%9 = or i32 192, %8
%10 = or i32 %9, 48
%11 = call i32 @addbyte(i32 %10)
%12 = load i32, i32* %4
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @MMX_PSLLW_imm(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 113)
%6 = or i32 %0, 240
%7 = tail call i32 @addbyte(i32 %6)
%8 = tail call i32 @addbyte(i32 %1)
ret void
}
/* Variables and functions */
float ANTweenTimingFunctionQuartInOut(float, int /*<<< orphan*/, int, float);
float ANTweenProgressTimingFunctionQuartInOut(float time, float duration) {
  return ANTweenTimingFunctionQuartInOut(time, 0, 1, duration);
}


x86 assembly (clang, -O0):
<ANTweenProgressTimingFunctionQuartInOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <ANTweenTimingFunctionQuartInOut@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANTweenProgressTimingFunctionQuartInOut>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <ANTweenTimingFunctionQuartInOut@plt>

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

LLVM IR (-O2):
define float @ANTweenProgressTimingFunctionQuartInOut(float %0, float %1) {
%3 = tail call float @ANTweenTimingFunctionQuartInOut(float %0, i32 0, i32 1, float %1)
ret float %3
}
/* Variables and functions */
int network_prefix(int, int, int /*<<< orphan*/, unsigned char const *,
                   int /*<<< orphan*/ *, unsigned int, unsigned char *);
int network_address(int ae, const unsigned char *a, unsigned int len,
                    unsigned char *a_r) {
  return network_prefix(ae, -1, 0, a, NULL, len, a_r);
}


x86 assembly (clang, -O0):
<network_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r9d
mov    -0x20(%rbp),%rax
mov    $0xffffffff,%esi
xor    %edx,%edx
xor    %r8d,%r8d
mov    %rax,(%rsp)
call   1030 <network_prefix@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<network_address>:
push   %rax
mov    %edx,%r9d
mov    %rsi,%rax
mov    %rcx,(%rsp)
mov    $0xffffffff,%esi
xor    %edx,%edx
mov    %rax,%rcx
xor    %r8d,%r8d
call   1030 <network_prefix@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @network_address(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @network_prefix(i32 %0, i32 -1, i32 0, i8* %1, i32* null, i32 %2, i8* %3)
ret i32 %5
}
int my_max(int a, int b) {
  if (a > b)
    return (a);
  else
    return (b);
}


x86 assembly (clang, -O0):
<my_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <my_max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <my_max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @my_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int empty_function(int i) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @empty_function(i32 %0) {
ret i32 0
}
int __getpagesize() { return 4096; }


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

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

LLVM IR (-O0):
define i32 @__getpagesize() {
ret i32 4096
}

LLVM IR (-O2):
define i32 @__getpagesize() {
ret i32 4096
}
int g(int c, int d) {
  if (c == 0) {
    return d;
  } else {
    return g(c - 1, 1 + d);
  }
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <g+0x23>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <g+0x37>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
call   1030 <g@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1) {
%3 = add i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int _pico_little_long(int src) { return src; }


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

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

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

LLVM IR (-O2):
define i32 @_pico_little_long(i32 returned %0) {
ret i32 %0
}
void free_array(char **arr) {
  char **tmp = arr;
  if (!arr)
    return;
  while (*tmp) {
    free(*tmp);
    tmp++;
  }
  free(arr);
}


x86 assembly (clang, -O0):
<free_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1134 <free_array+0x24>
jmp    116d <free_array+0x5d>
jmp    1139 <free_array+0x29>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1164 <free_array+0x54>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1139 <free_array+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_array>:
test   %rdi,%rdi
je     1150 <free_array+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <free_array+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <free_array+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @free_array(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %12, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %10, %6 ], [ %4, %3 ]
%8 = phi i8** [ %9, %6 ], [ %0, %3 ]
tail call void @free(i8* %7)
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %6
12: ; preds = %6, %3
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
br label %14
14: ; preds = %1, %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_panic__();
void exit(int exitcode) { __coverity_panic__(); }


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__coverity_panic__@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rax
xor    %eax,%eax
call   1030 <__coverity_panic__@plt>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @__coverity_panic__()
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 (...) @__coverity_panic__()
unreachable
}
/* Variables and functions */
int maze_width(char *);
char *maze_node(char *maze, int x, int y) {
  return maze + y * maze_width(maze) + x;
}


x86 assembly (clang, -O0):
<maze_node>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <maze_width@plt>
mov    -0x1c(%rbp),%ecx
mov    %eax,%edx
mov    -0x18(%rbp),%rax
imul   %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maze_node>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%rbp
call   1030 <maze_width@plt>
imul   %ebx,%eax
movslq %eax,%rcx
add    %rbp,%rcx
movslq %r14d,%rax
add    %rcx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @maze_node(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* %6
%9 = load i8*, i8** %4
%10 = call i32 @maze_width(i8* %9)
%11 = mul nsw i32 %8, %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %7, i64 %12
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
ret i8* %16
}

LLVM IR (-O2):
define i8* @maze_node(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @maze_width(i8* %0)
%5 = mul nsw i32 %4, %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void eeprom_update_word(uint16_t *__p, uint16_t __value) {}


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

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

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

LLVM IR (-O2):
define void @eeprom_update_word(i32* nocapture %0, i32 %1) {
ret void
}
int pms_set_wakeup_timers(unsigned long long second) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pms_set_wakeup_timers(i64 %0) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
void LCDIDDDataWrite(uint32_t ui32Base, uint32_t ui32CS, uint16_t ui16Data) {
  uint32_t ui32Reg;
  ;
  ;
  ui32Reg = ui32CS ? 0x00000024 : 0x00000018;
  (*((volatile uint32_t *)(ui32Base + ui32Reg))) = ui16Data;
}


x86 assembly (clang, -O0):
<LCDIDDDataWrite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edx
mov    $0x18,%eax
mov    $0x24,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    -0x10(%rbp),%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDIDDDataWrite>:
test   %esi,%esi
mov    $0x18,%eax
mov    $0x24,%ecx
cmove  %eax,%ecx
movslq %edi,%rax
mov    %edx,(%rcx,%rax,1)
ret

LLVM IR (-O0):
define void @LCDIDDDataWrite(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 36, i32 24
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = load i32, i32* %4
%14 = load i32, i32* %7
%15 = add nsw i32 %13, %14
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
store volatile i32 %12, i32* %17
ret void
}

LLVM IR (-O2):
define void @LCDIDDDataWrite(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i32 24, i32 36
%6 = add nsw i32 %5, %0
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %2, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *argument) {
  printf("Usage: %s [options] <input> <output>\n\n", argument);
  printf("Options:\n");
  printf("\t\t-d\t\t- Decrypt.\n");
  printf("\t\t-e\t\t- Encrypt.\n");
  printf("\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xede(%rip),%rdi
call   1040 <puts@plt>
lea    0xedb(%rip),%rdi
call   1040 <puts@plt>
lea    0xee0(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Usage: %s [options] <input> <output>\0A\0A\00"
@.str.1 = [10 x i8] c"Options:\0A\00"
@.str.2 = [18 x i8] c"\09\09-d\09\09- Decrypt.\0A\00"
@.str.3 = [18 x i8] c"\09\09-e\09\09- Encrypt.\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Usage: %s [options] <input> <output>\0A\0A\00"
@str = [9 x i8] c"Options:\00"
@str.5 = [17 x i8] c"\09\09-d\09\09- Decrypt.\00"
@str.6 = [17 x i8] c"\09\09-e\09\09- Encrypt.\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.5, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.6, i64 0, i64 0))
%6 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __pthread_initialize();
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ main();
void _start(uint32_t *info) {
  __pthread_initialize();
  _exit(main());
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__pthread_initialize@plt>
mov    $0x0,%al
call   1050 <main@plt>
mov    %eax,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_start>:
push   %rax
xor    %eax,%eax
call   1040 <__pthread_initialize@plt>
xor    %eax,%eax
call   1050 <main@plt>
mov    %eax,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @_start(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @__pthread_initialize()
%4 = call i32 (...) @main()
%5 = call i32 @_exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @_start(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @__pthread_initialize()
%3 = tail call i32 (...) @main()
%4 = tail call i32 @_exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, res;
  scanf("%d", &n);
  res = (n * (n + 1)) / 2;
  printf("%d", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%ecx
imul   %eax,%ecx
mov    %ecx,%esi
shr    $0x1f,%esi
add    %ecx,%esi
sar    %esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = mul nsw i32 %5, %7
%9 = sdiv i32 %8, 2
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
%6 = mul nsw i32 %5, %4
%7 = sdiv i32 %6, 2
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int my_strlen(char *);
int /*<<< orphan*/ print_fatal_error(int);
void check_base(char *b) {
  if (my_strlen(b) < 2)
    print_fatal_error(1);
}


x86 assembly (clang, -O0):
<check_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <my_strlen@plt>
cmp    $0x2,%eax
jge    1148 <check_base+0x28>
mov    $0x1,%edi
call   1040 <print_fatal_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_base>:
push   %rax
call   1030 <my_strlen@plt>
cmp    $0x1,%eax
jg     1136 <check_base+0x16>
mov    $0x1,%edi
pop    %rax
jmp    1040 <print_fatal_error@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @check_base(i8* %0) {
%2 = tail call i32 @my_strlen(i8* %0)
%3 = icmp slt i32 %2, 2
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @print_fatal_error(i32 1)
br label %6
6: ; preds = %4, %1
ret void
}
reg0imm1_set(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ r0 = 33; }


x86 assembly (clang, -O0):
<reg0imm1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movb   $0x21,-0x5(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @reg0imm1_set(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
ret i32 undef
}
/* Type definitions */
struct t_dfa {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct t_dfa *);
void free_dfa(struct t_dfa *pd) { free(pd); }


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

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

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

LLVM IR (-O2):
%struct.t_dfa = type { i32 }
define void @free_dfa(%struct.t_dfa* nocapture %0) {
%2 = tail call i32 @free(%struct.t_dfa* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printopt(char *, char);
void nprintopt(char *s, char opt) {
  if (opt == 1)
    opt = 0;
  else if (opt == 0)
    opt = 1;
  printopt(s, opt);
}


x86 assembly (clang, -O0):
<nprintopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x1,%eax
jne    1138 <nprintopt+0x28>
movb   $0x0,-0x9(%rbp)
jmp    114e <nprintopt+0x3e>
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    1149 <nprintopt+0x39>
movb   $0x1,-0x9(%rbp)
jmp    114e <nprintopt+0x3e>
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <printopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nprintopt>:
test   %sil,%sil
mov    $0x1,%ecx
mov    %esi,%eax
cmove  %ecx,%eax
xor    %ecx,%ecx
cmp    $0x1,%sil
cmove  %ecx,%eax
mov    %eax,%esi
jmp    1030 <printopt@plt>

LLVM IR (-O0):
define void @nprintopt(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
store i8 0, i8* %4
br label %15
9: ; preds = %2
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i8 1, i8* %4
br label %14
14: ; preds = %13, %9
br label %15
15: ; preds = %14, %8
%16 = load i8*, i8** %3
%17 = load i8, i8* %4
%18 = call i32 @printopt(i8* %16, i8 signext %17)
ret void
}

LLVM IR (-O2):
define void @nprintopt(i8* %0, i8 signext %1) {
%3 = icmp eq i8 %1, 1
%4 = icmp eq i8 %1, 0
%5 = select i1 %4, i8 1, i8 %1
%6 = select i1 %3, i8 0, i8 %5
%7 = tail call i32 @printopt(i8* %0, i8 signext %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void HelloWorld() { printf("Hello World from c-lib\n"); }


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

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

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

LLVM IR (-O2):
@str = [23 x i8] c"Hello World from c-lib\00"
define void @HelloWorld() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ voidpf;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
void my_free(voidpf opaque, voidpf address) { free(address); }


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

x86 assembly (clang, -O2):
<my_free>:
mov    %esi,%edi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @my_free(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @free(i32 %5)
ret void
}

LLVM IR (-O2):
define void @my_free(i32 %0, i32 %1) {
%3 = tail call i32 @free(i32 %1)
ret void
}