xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ TimerBaseValid(unsigned long);
void TimerLoadSet64(unsigned long ulBase, unsigned long long ullValue) {
  DEBUG_ASSERT(TimerBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x0000002C))) = ullValue >> 32;
  (*((volatile unsigned long *)(ulBase + 0x00000028))) = ullValue & 0xffffffff;
}


x86 assembly (clang, -O0):
<TimerLoadSet64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <TimerBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rcx
shr    $0x20,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x2c(%rax)
movabs $0xffffffff,%rcx
and    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x28(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerLoadSet64>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <TimerBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    %r14,%rax
shr    $0x20,%rax
mov    %rax,0x2c(%rbx)
mov    %r14d,%eax
mov    %rax,0x28(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @TimerLoadSet64(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 @TimerBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i64, i64* %4
%9 = lshr i64 %8, 32
%10 = load i64, i64* %3
%11 = add i64 %10, 44
%12 = inttoptr i64 %11 to i64*
store volatile i64 %9, i64* %12
%13 = load i64, i64* %4
%14 = and i64 %13, 4294967295
%15 = load i64, i64* %3
%16 = add i64 %15, 40
%17 = inttoptr i64 %16 to i64*
store volatile i64 %14, i64* %17
ret void
}

LLVM IR (-O2):
define void @TimerLoadSet64(i64 %0, i64 %1) {
%3 = tail call i32 @TimerBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = lshr i64 %1, 32
%6 = add i64 %0, 44
%7 = inttoptr i64 %6 to i64*
store volatile i64 %5, i64* %7
%8 = and i64 %1, 4294967295
%9 = add i64 %0, 40
%10 = inttoptr i64 %9 to i64*
store volatile i64 %8, i64* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void catch_urg(int sig) { printf("URG\n"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"URG\0A\00"
define void @catch_urg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [4 x i8] c"URG\00"
define void @catch_urg(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testAccessing();
int /*<<< orphan*/ testBitVector();
int /*<<< orphan*/ testRanking();
int /*<<< orphan*/ testReplace();
int /*<<< orphan*/ testSelecting();
int /*<<< orphan*/ testTreeBuilding();
void testAll() {
  testReplace();
  testBitVector();
  testTreeBuilding();
  testAccessing();
  testSelecting();
  testRanking();
}


x86 assembly (clang, -O0):
<testAll>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <testReplace@plt>
mov    $0x0,%al
call   1060 <testBitVector@plt>
mov    $0x0,%al
call   1040 <testTreeBuilding@plt>
mov    $0x0,%al
call   1050 <testAccessing@plt>
mov    $0x0,%al
call   1080 <testSelecting@plt>
mov    $0x0,%al
call   1030 <testRanking@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testAll>:
push   %rax
xor    %eax,%eax
call   1070 <testReplace@plt>
xor    %eax,%eax
call   1060 <testBitVector@plt>
xor    %eax,%eax
call   1040 <testTreeBuilding@plt>
xor    %eax,%eax
call   1050 <testAccessing@plt>
xor    %eax,%eax
call   1080 <testSelecting@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <testRanking@plt>

LLVM IR (-O0):
define void @testAll() {
%1 = call i32 (...) @testReplace()
%2 = call i32 (...) @testBitVector()
%3 = call i32 (...) @testTreeBuilding()
%4 = call i32 (...) @testAccessing()
%5 = call i32 (...) @testSelecting()
%6 = call i32 (...) @testRanking()
ret void
}

LLVM IR (-O2):
define void @testAll() {
%1 = tail call i32 (...) @testReplace()
%2 = tail call i32 (...) @testBitVector()
%3 = tail call i32 (...) @testTreeBuilding()
%4 = tail call i32 (...) @testAccessing()
%5 = tail call i32 (...) @testSelecting()
%6 = tail call i32 (...) @testRanking()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn3();
int fn2() { fn3(); }


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

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

LLVM IR (-O0):
define i32 @fn2() {
%1 = alloca i32
%2 = call i32 (...) @fn3()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @fn2() {
%1 = tail call i32 (...) @fn3()
ret i32 undef
}
/* Variables and functions */
int binCoeff(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("binCoeff(3, 1) = %d\n", binCoeff(3, 1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
mov    $0x1,%esi
call   1040 <binCoeff@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"binCoeff(3, 1) = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @binCoeff(i32 3, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
double dbl_cmp_le(double a, double b, double c, double d) {
  return (a <= b) ? c : d;
}


x86 assembly (clang, -O0):
<dbl_cmp_le>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     113b <dbl_cmp_le+0x3b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1145 <dbl_cmp_le+0x45>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbl_cmp_le>:
cmplesd %xmm1,%xmm0
andpd  %xmm0,%xmm2
andnpd %xmm3,%xmm0
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dbl_cmp_le(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = fcmp ole double %9, %10
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = load double, double* %7
br label %16
14: ; preds = %4
%15 = load double, double* %8
br label %16
16: ; preds = %14, %12
%17 = phi double [ %13, %12 ], [ %15, %14 ]
ret double %17
}

LLVM IR (-O2):
define double @dbl_cmp_le(double %0, double %1, double %2, double %3) {
%5 = fcmp ole double %0, %1
%6 = select i1 %5, double %2, double %3
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int print_usage() {
  fprintf(stderr, "Usage: milkcat [-m hmm_crf|crf|crf_seg] [-d "
                  "model_directory] [-i] [-t] [file]\n");
  return 0;
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [79 x i8] c"Usage: milkcat [-m hmm_crf|crf|crf_seg] [-d model_directory] [-i] [-t] [file]\0A\00"
define i32 @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [79 x i8] c"Usage: milkcat [-m hmm_crf|crf|crf_seg] [-d model_directory] [-i] [-t] [file]\0A\00"
define i32 @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int atoi(char const *);
char *om_sysfs_get(char *);
int om_screen_actual_brightness_get() {
  const char *res = om_sysfs_get("actual_brightness");
  if (res == NULL)
    return -1;
  return atoi(res);
}


x86 assembly (clang, -O0):
<om_screen_actual_brightness_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <om_sysfs_get@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114f <om_screen_actual_brightness_get+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <om_screen_actual_brightness_get+0x3b>
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<om_screen_actual_brightness_get>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <om_sysfs_get@plt>
test   %rax,%rax
je     113b <om_screen_actual_brightness_get+0x1b>
mov    %rax,%rdi
pop    %rax
jmp    1040 <atoi@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"actual_brightness\00"
define i32 @om_screen_actual_brightness_get() {
%1 = tail call i8* @om_sysfs_get(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @atoi(i8* %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ -1, %0 ]
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_getschedpolicy(int /*<<< orphan*/ *, int *);
int my_pthread_attr_getschedpolicy(pthread_attr_t const *__attr, int *policy) {
  pthread_attr_t *realattr = (pthread_attr_t *)*(int *)__attr;
  return pthread_attr_getschedpolicy(realattr, policy);
}


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

x86 assembly (clang, -O2):
<my_pthread_attr_getschedpolicy>:
movslq (%rdi),%rdi
jmp    1030 <pthread_attr_getschedpolicy@plt>

LLVM IR (-O0):
define i32 @my_pthread_attr_getschedpolicy(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = load i32*, i32** %4
%12 = call i32 @pthread_attr_getschedpolicy(i32* %10, i32* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @my_pthread_attr_getschedpolicy(i32* nocapture %0, i32* %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @pthread_attr_getschedpolicy(i32* %5, i32* %1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ writeC(char *, int);
int main() {
  char *buffer = "soy Dummy";
  int length = 3000;
  writeC(buffer, 9);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0xbb8,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x9,%esi
call   1030 <writeC@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"soy Dummy\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %2
store i32 3000, i32* %3
%4 = load i8*, i8** %2
%5 = call i32 @writeC(i8* %4, i32 9)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"soy Dummy\00"
define i32 @main() {
%1 = tail call i32 @writeC(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void funHello(void) {
  printf("hello");
  system("pause");
}


x86 assembly (clang, -O0):
<funHello>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<funHello>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"pause\00"
define void @funHello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"pause\00"
define void @funHello() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void hal_wdt_reset(void) {}


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

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

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

LLVM IR (-O2):
define void @hal_wdt_reset() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _talloc_set_name_const(void const *, char const *);
void talloc_set_name_const(const void *ptr, const char *name) {
  _talloc_set_name_const(ptr, name);
}


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

x86 assembly (clang, -O2):
<talloc_set_name_const>:
jmp    1030 <_talloc_set_name_const@plt>

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

LLVM IR (-O2):
define void @talloc_set_name_const(i8* %0, i8* %1) {
%3 = tail call i32 @_talloc_set_name_const(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *calloc(size_t nmemb, size_t size) {
  size = nmemb * size;
  void *res = malloc(size);
  memset(res, 0, size);
  return res;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i64, i64* %4
%13 = call i32 @memset(i8* %11, i32 0, i64 %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ nextstep_init();
int /*<<< orphan*/ nextstepaux_init();
pi_init() {
  nextstep_init();
  nextstepaux_init();
}


x86 assembly (clang, -O0):
<pi_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <nextstep_init@plt>
mov    $0x0,%al
call   1030 <nextstepaux_init@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pi_init() {
%1 = alloca i32
%2 = call i32 (...) @nextstep_init()
%3 = call i32 (...) @nextstepaux_init()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @pi_init() {
%1 = tail call i32 (...) @nextstep_init()
%2 = tail call i32 (...) @nextstepaux_init()
ret i32 undef
}
int lis3l02dq_configure_buffer(struct iio_dev *indio_dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @lis3l02dq_configure_buffer(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
void GPIOPortH_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<GPIOPortH_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <GPIOPortH_Handler+0x9>
jmp    1109 <GPIOPortH_Handler+0x9>

x86 assembly (clang, -O2):
<GPIOPortH_Handler>:
jmp    1100 <GPIOPortH_Handler>

LLVM IR (-O0):
define void @GPIOPortH_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @GPIOPortH_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: dbow [-xNmv][-t type][-h incfile][-o file] file\n");
  exit(2);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"Usage: dbow [-xNmv][-t type][-h incfile][-o file] file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"Usage: dbow [-xNmv][-t type][-h incfile][-o file] file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double tv_to_double(struct timeval *);
double get_time() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv_to_double(&tv);
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
lea    -0x8(%rbp),%rdi
call   1030 <tv_to_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    %rbx,%rdi
call   1030 <tv_to_double@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = call double @tv_to_double(%struct.timeval* %1)
ret double %3
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = call double @tv_to_double(%struct.timeval* %1)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  float number = 3.1;
  number -= 1.0;
  if (number == 2.1)
    printf("Number is equal 2.1!\n");
  else
    printf("Float Doesn't works!\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xee9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecb(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    117c <main+0x6c>
jp     117c <main+0x6c>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    1188 <main+0x78>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"Number is equal 2.1!\0A\00"
@.str.1 = [22 x i8] c"Float Doesn't works!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 0x4008CCCCC0000000, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double %4, 1.000000e+00
%6 = fptrunc double %5 to float
store float %6, float* %2
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fcmp oeq double %8, 2.100000e+00
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@str = [21 x i8] c"Float Doesn't works!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_imm_67int8_mem(signed char *val) {
  return ((*val) & (0x67 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_67int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 103
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct statx {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, char const *, unsigned int, unsigned int,
                           struct statx *);
__attribute__((unused)) ssize_t statx(int dfd, const char *filename,
                                      unsigned flags, unsigned int mask,
                                      struct statx *buffer) {
  return syscall(-1, dfd, filename, flags, mask, buffer);
}


x86 assembly (clang, -O0):
<statx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x20(%rbp),%r9
mov    $0xffffffff,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<statx>:
mov    %r8,%r9
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0xffffffff,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.statx = type { i32 }
define i32 @statx(i32 %0, i8* %1, i32 %2, i32 %3, %struct.statx* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.statx*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store %struct.statx* %4, %struct.statx** %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load %struct.statx*, %struct.statx** %10
%16 = call i32 @syscall(i32 -1, i32 %11, i8* %12, i32 %13, i32 %14, %struct.statx* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.statx = type { i32 }
define i32 @statx(i32 %0, i8* %1, i32 %2, i32 %3, %struct.statx* %4) {
%6 = tail call i32 @syscall(i32 -1, i32 %0, i8* %1, i32 %2, i32 %3, %struct.statx* %4)
ret i32 %6
}
char foo(const char *s) {
  char a[1];
  const char *ss = s;
  a[*++s] |= 1;
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbq 0x1(%rax),%rax
movsbl -0x9(%rbp,%rax,1),%ecx
or     $0x1,%ecx
mov    %cl,-0x9(%rbp,%rax,1)
xor    %eax,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @foo(i8* %0) {
%2 = alloca i8*
%3 = alloca [1 x i8]
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i64
%10 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = or i32 %12, 1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %10
ret i8 0
}

LLVM IR (-O2):
define signext i8 @foo(i8* nocapture readnone %0) {
ret i8 0
}
/* Variables and functions */
main() {}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct shmid_ds {
  int shm_nattch;
};

/* Variables and functions */
int /*<<< orphan*/ IPC_STAT;
scalar_t__ shmctl(int, int /*<<< orphan*/, struct shmid_ds *);
int get_shmem_attach(int shmid) {
  struct shmid_ds smem_ds;
  smem_ds.shm_nattch = 0;
  if (shmctl(shmid, IPC_STAT, &smem_ds) == 0)
    return smem_ds.shm_nattch - 1;
  return 0;
}


x86 assembly (clang, -O0):
<get_shmem_attach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <shmctl@plt>
cmp    $0x0,%rax
jne    114f <get_shmem_attach+0x3f>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <get_shmem_attach+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_shmem_attach>:
push   %rax
movl   $0x0,(%rsp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <shmctl@plt>
mov    (%rsp),%edx
add    $0xffffffff,%edx
xor    %ecx,%ecx
test   %rax,%rax
cmove  %edx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.shmid_ds = type { i32 }
@IPC_STAT = global i32 0
define i32 @get_shmem_attach(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.shmid_ds
store i32 %0, i32* %3
%5 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %4, i32 0, i32 0
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* @IPC_STAT
%8 = call i64 @shmctl(i32 %6, i32 %7, %struct.shmid_ds* %4)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %4, i32 0, i32 0
%12 = load i32, i32* %11
%13 = sub nsw i32 %12, 1
store i32 %13, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %10
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.shmid_ds = type { i32 }
@IPC_STAT = global i32 0
define i32 @get_shmem_attach(i32 %0) {
%2 = alloca %struct.shmid_ds
%3 = bitcast %struct.shmid_ds* %2 to i8*
%4 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %2, i64 0, i32 0
store i32 0, i32* %4
%5 = load i32, i32* @IPC_STAT
%6 = call i64 @shmctl(i32 %0, i32 %5, %struct.shmid_ds* %2)
%7 = icmp eq i64 %6, 0
%8 = load i32, i32* %4
%9 = add nsw i32 %8, -1
%10 = select i1 %7, i32 %9, i32 0
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putstr(char *);
int main(int argc, char **argv) {
  int index;
  index = argc - 1;
  while (index > 0) {
    ft_putstr(argv[index]);
    ft_putchar('\n');
    index--;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1172 <main+0x52>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    113f <main+0x1f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1160 <main+0x40>
mov    %rsi,%r14
mov    %edi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x2(%rbx),%eax
mov    (%r14,%rax,8),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x2,%rbx
ja     1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %6
br label %9
9: ; preds = %12, %2
%10 = load i32, i32* %6
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @ft_putstr(i8* %17)
%19 = call i32 @ft_putchar(i8 signext 10)
%20 = load i32, i32* %6
%21 = add nsw i32 %20, -1
store i32 %21, i32* %6
br label %9
22: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @ft_putstr(i8* %11)
%13 = tail call i32 @ft_putchar(i8 signext 10)
%14 = icmp ugt i64 %7, 2
br i1 %14, label %6, label %15
15: ; preds = %6, %2
ret i32 0
}
void gtk_table_get_row_spacing() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned char);
void BeginCaseNoBracket(FILE *fh, unsigned char Opcode) {
  fprintf(fh, "case 0x0%02x:\r\n", Opcode);
}


x86 assembly (clang, -O0):
<BeginCaseNoBracket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
movzbl -0x9(%rbp),%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BeginCaseNoBracket>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"case 0x0%02x:\0D\0A\00"
define void @BeginCaseNoBracket(i32* %0, i8 zeroext %1) {
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
%5 = load i32*, i32** %3
%6 = load i8, i8* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"case 0x0%02x:\0D\0A\00"
define void @BeginCaseNoBracket(i32* nocapture %0, i8 zeroext %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
ret void
}
int base64_decode_length(int codeInLength, int charsPerLine) {
  int codeLength = codeInLength;
  if (charsPerLine > 0)
    codeLength -= codeInLength / charsPerLine;
  int result = codeLength * 3 / 4;
  return result;
}


x86 assembly (clang, -O0):
<base64_decode_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    112b <base64_decode_length+0x2b>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
imul   $0x3,-0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_decode_length>:
test   %esi,%esi
jle    110b <base64_decode_length+0xb>
mov    %edi,%eax
cltd
idiv   %esi
sub    %eax,%edi
lea    (%rdi,%rdi,2),%ecx
lea    (%rdi,%rdi,2),%eax
add    $0x3,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @base64_decode_length(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = sdiv i32 %0, %1
%6 = sub nsw i32 %0, %5
br label %7
7: ; preds = %4, %2
%8 = phi i32 [ %6, %4 ], [ %0, %2 ]
%9 = mul nsw i32 %8, 3
%10 = sdiv i32 %9, 4
ret i32 %10
}
void wifi_rsp_dfu_flash_upload_finish(
    const struct wifi_msg_dfu_flash_upload_finish_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_dfu_flash_upload_finish_rsp_t = type opaque
define void @wifi_rsp_dfu_flash_upload_finish(%struct.wifi_msg_dfu_flash_upload_finish_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memcpy(void *, void const *, int);
void *xmemdup(const void *data, int len) {
  void *r = malloc(len + 1);
  if (r) {
    memcpy(r, data, len);
    ((char *)r)[len] = '\0';
  }
  return r;
}


x86 assembly (clang, -O0):
<xmemdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1165 <xmemdup+0x45>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmemdup>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%r15
lea    0x1(%r14),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1151 <xmemdup+0x31>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
call   1030 <memcpy@plt>
movslq %r14d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @xmemdup(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %1)
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i8, i8* %4, i64 %8
store i8 0, i8* %9
br label %10
10: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ putBoxTitlePicture(double, double, int /*<<< orphan*/,
                                      int /*<<< orphan*/, char *);
void putInnerText(double px, double py, char *text) {
  putBoxTitlePicture(px, py, 0, 0, text);
}


x86 assembly (clang, -O0):
<putInnerText>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
mov    %esi,%edi
call   1030 <putBoxTitlePicture@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putInnerText>:
mov    %rdi,%rdx
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <putBoxTitlePicture@plt>

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

LLVM IR (-O2):
define void @putInnerText(double %0, double %1, i8* %2) {
%4 = tail call i32 @putBoxTitlePicture(double %0, double %1, i32 0, i32 0, i8* %2)
ret void
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
int *malloc(int);
int /*<<< orphan*/ traversal(struct TreeNode *, int *, int *);
int *inorderTraversal(struct TreeNode *root, int *returnSize) {
  int *inorder = malloc(sizeof(int));
  int counter = 0;
  traversal(root, inorder, &counter);
  *returnSize = counter;
  return inorder;
}


x86 assembly (clang, -O0):
<inorderTraversal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <traversal@plt>
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inorderTraversal>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdx
mov    %r15,%rdi
mov    %rax,%rsi
call   1040 <traversal@plt>
mov    0xc(%rsp),%eax
mov    %eax,(%r14)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32* @inorderTraversal(%struct.TreeNode* %0, i32* %1) {
%3 = alloca %struct.TreeNode*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store %struct.TreeNode* %0, %struct.TreeNode** %3
store i32* %1, i32** %4
%7 = call i32* @malloc(i32 4)
store i32* %7, i32** %5
store i32 0, i32* %6
%8 = load %struct.TreeNode*, %struct.TreeNode** %3
%9 = load i32*, i32** %5
%10 = call i32 @traversal(%struct.TreeNode* %8, i32* %9, i32* %6)
%11 = load i32, i32* %6
%12 = load i32*, i32** %4
store i32 %11, i32* %12
%13 = load i32*, i32** %5
ret i32* %13
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32* @inorderTraversal(%struct.TreeNode* %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = tail call i32* @malloc(i32 4)
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = call i32 @traversal(%struct.TreeNode* %0, i32* %4, i32* %3)
%7 = load i32, i32* %3
store i32 %7, i32* %1
ret i32* %4
}
char *langDbgDevCrtc6845() { return "CRTC6845"; }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"CRTC6845\00"
define i8* @langDbgDevCrtc6845() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int f107(int *);
int f108(int *p) { return f107(p); }


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

x86 assembly (clang, -O2):
<f108>:
jmp    1030 <f107@plt>

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

LLVM IR (-O2):
define i32 @f108(i32* %0) {
%2 = tail call i32 @f107(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ crc_ccitt_byte(int /*<<< orphan*/, int /*<<< orphan*/);
uint16_t crc_ccitt(uint16_t crc, uint8_t const *buffer, size_t len) {
  while (len--)
    crc = crc_ccitt_byte(crc, *buffer++);
  return crc;
}


x86 assembly (clang, -O0):
<crc_ccitt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     115d <crc_ccitt+0x4d>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%esi
call   1030 <crc_ccitt_byte@plt>
mov    %eax,-0x4(%rbp)
jmp    1123 <crc_ccitt+0x13>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc_ccitt>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%eax
test   %rdx,%rdx
je     1144 <crc_ccitt+0x34>
mov    %rdx,%r15
mov    %rsi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r14,%rbx,4),%esi
mov    %eax,%edi
call   1030 <crc_ccitt_byte@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <crc_ccitt+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @crc_ccitt(i32 %0, i32* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %14, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %9, %5 ], [ %2, %3 ]
%7 = phi i32* [ %10, %5 ], [ %1, %3 ]
%8 = phi i32 [ %12, %5 ], [ %0, %3 ]
%9 = add i64 %6, -1
%10 = getelementptr inbounds i32, i32* %7, i64 1
%11 = load i32, i32* %7
%12 = tail call i32 @crc_ccitt_byte(i32 %8, i32 %11)
%13 = icmp eq i64 %9, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %3
%15 = phi i32 [ %0, %3 ], [ %12, %5 ]
ret i32 %15
}