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

/* Variables and functions */
int /*<<< orphan*/ fwrite(void const *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void out_fun(struct pngw_arg *p, const void *data, int len) {
  fwrite(data, len, 1, stdout);
}


x86 assembly (clang, -O0):
<out_fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_fun>:
mov    %rsi,%rdi
mov    0x2ec6(%rip),%rax
mov    (%rax),%ecx
mov    %edx,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
%struct.pngw_arg = type { i32 }
@stdout = global i32 0
define void @out_fun(%struct.pngw_arg* %0, i8* %1, i32 %2) {
%4 = alloca %struct.pngw_arg*
%5 = alloca i8*
%6 = alloca i32
store %struct.pngw_arg* %0, %struct.pngw_arg** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = load i32, i32* @stdout
%10 = call i32 @fwrite(i8* %7, i32 %8, i32 1, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.pngw_arg = type { i32 }
@stdout = global i32 0
define void @out_fun(%struct.pngw_arg* nocapture readnone %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stdout
%5 = tail call i32 @fwrite(i8* %1, i32 %2, i32 1, i32 %4)
ret void
}
void on_dialog_closed(int type, void *context) {}


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

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

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

LLVM IR (-O2):
define void @on_dialog_closed(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int ec_init();
int init_fans() { return ec_init(); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
uint64_t cmpxchg_64(uint64_t *p, uint64_t old, uint64_t new) {
  assert(!"not implemented");
}


x86 assembly (clang, -O0):
<cmpxchg_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpxchg_64>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"not implemented\00"
define i32 @cmpxchg_64(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = call i32 @assert(i32 0)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @cmpxchg_64(i32* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long long, unsigned long long);
int main() {
  int i = 0;
  unsigned long long f1 = 2;
  unsigned long long f2 = 1;
  while (i < 100) {
    printf("%llu\n%llu\n", f1, f2);
    f1 = f1 + f2;
    f2 = f1 + f2;
    i += 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movq   $0x2,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    117a <main+0x6a>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x26>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x2,%r14d
mov    $0x1,%ebx
mov    $0xfffffffe,%ebp
lea    0xed2(%rip),%r15
xchg   %ax,%ax
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
add    %rbx,%r14
add    %r14,%rbx
add    $0x2,%ebp
cmp    $0x62,%ebp
jb     1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"%llu\0A%llu\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 1, %0 ], [ %7, %1 ]
%3 = phi i64 [ 2, %0 ], [ %6, %1 ]
%4 = phi i32 [ 0, %0 ], [ %8, %1 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %3, i64 %2)
%6 = add i64 %2, %3
%7 = add i64 %6, %2
%8 = add nuw nsw i32 %4, 2
%9 = icmp ult i32 %4, 98
br i1 %9, label %1, label %10
10: ; preds = %1
ret i32 0
}
int summator(int i, float f) { return i + (int)(f); }


x86 assembly (clang, -O0):
<summator>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cvttss2si -0x8(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<summator>:
cvttss2si %xmm0,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @summator(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load i32, i32* %3
%6 = load float, float* %4
%7 = fptosi float %6 to i32
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @summator(i32 %0, float %1) {
%3 = fptosi float %1 to i32
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
void f2(int n) {
  if (n < 3)
    return;
  n--;
  f(n);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    112a <f2+0x1a>
jmp    113b <f2+0x2b>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
cmp    $0x3,%edi
jge    1116 <f2+0x6>
ret
add    $0xffffffff,%edi
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define void @f2(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @f(i32 %4)
br label %6
6: ; preds = %1, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ logwarn(char *, char const *);
scalar_t__ oml_lock(int /*<<< orphan*/ *, char const *);
int /*<<< orphan*/ sleep(int);
void oml_lock_persistent(pthread_mutex_t *mutexP, const char *mutexName) {
  while (oml_lock(mutexP, mutexName)) {
    logwarn("Cannot get lock in %s; will try again soon.\n", mutexName);
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<oml_lock_persistent>:
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   1040 <oml_lock@plt>
cmp    $0x0,%rax
je     1176 <oml_lock_persistent+0x46>
mov    -0x10(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <logwarn@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1140 <oml_lock_persistent+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oml_lock_persistent>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <oml_lock@plt>
test   %rax,%rax
je     1175 <oml_lock_persistent+0x45>
lea    0xeb4(%rip),%r15
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <logwarn@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <oml_lock@plt>
test   %rax,%rax
jne    1150 <oml_lock_persistent+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Cannot get lock in %s; will try again soon.\0A\00"
define void @oml_lock_persistent(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %10, %2
%6 = load i32*, i32** %3
%7 = load i8*, i8** %4
%8 = call i64 @oml_lock(i32* %6, i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = load i8*, i8** %4
%12 = call i32 @logwarn(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @sleep(i32 1)
br label %5
14: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"Cannot get lock in %s; will try again soon.\0A\00"
define void @oml_lock_persistent(i32* %0, i8* %1) {
%3 = tail call i64 @oml_lock(i32* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = tail call i32 @logwarn(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = tail call i32 @sleep(i32 1)
%8 = tail call i64 @oml_lock(i32* %0, i8* %1)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret void
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ decode_execve(struct tcb *, int /*<<< orphan*/);
int sys_execve(struct tcb *tcp) {
  decode_execve(tcp, 0);
  return 0100;
}


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

x86 assembly (clang, -O2):
<sys_execve>:
push   %rax
xor    %esi,%esi
call   1030 <decode_execve@plt>
mov    $0x40,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tcb = type { i32 }
define i32 @sys_execve(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i32 @decode_execve(%struct.tcb* %3, i32 0)
ret i32 64
}

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_execve(%struct.tcb* %0) {
%2 = tail call i32 @decode_execve(%struct.tcb* %0, i32 0)
ret i32 64
}
void kill_game() { ; }


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

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

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

LLVM IR (-O2):
define void @kill_game() {
ret void
}
/* Variables and functions */
int CHAR_BIT;
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int value = -378;
  int result = +1 | (value >> (sizeof(int) * CHAR_BIT - 1));
  printf("%d\n", result);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffe86,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2eb0(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
sub    $0x1,%rcx
sar    %cl,%eax
or     $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%cl
shl    $0x2,%cl
add    $0xff,%cl
mov    $0xfffffe86,%esi
sar    %cl,%esi
or     $0x1,%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 -378, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @CHAR_BIT
%6 = sext i32 %5 to i64
%7 = mul i64 4, %6
%8 = sub i64 %7, 1
%9 = trunc i64 %8 to i32
%10 = ashr i32 %4, %9
%11 = or i32 1, %10
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = load i32, i32* @CHAR_BIT
%2 = shl i32 %1, 2
%3 = add i32 %2, -1
%4 = ashr i32 -378, %3
%5 = or i32 %4, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
void str_escape_display(const char *str, int len) {
  const char *tmpPtr = str;
  unsigned int tmpLen = 0;
  while (len > 0) {
    tmpLen = strlen(tmpPtr) + 1;
    putchar('\t');
    puts(tmpPtr);
    len -= tmpLen;
    tmpPtr += tmpLen;
  }
}


x86 assembly (clang, -O0):
<str_escape_display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    119f <str_escape_display+0x6f>
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x1,%rax
mov    %eax,-0x1c(%rbp)
mov    $0x9,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <puts@plt>
mov    -0x1c(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    114e <str_escape_display+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_escape_display>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    116f <str_escape_display+0x3f>
mov    %esi,%r14d
mov    %rdi,%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %rax,%rbp
add    $0x1,%ebp
mov    $0x9,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <puts@plt>
sub    %ebp,%r14d
add    %rbp,%rbx
test   %r14d,%r14d
jg     1140 <str_escape_display+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @str_escape_display(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
store i32 0, i32* %6
br label %8
8: ; preds = %11, %2
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %26
11: ; preds = %8
%12 = load i8*, i8** %5
%13 = call i64 @strlen(i8* %12)
%14 = add i64 %13, 1
%15 = trunc i64 %14 to i32
store i32 %15, i32* %6
%16 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 9)
%17 = load i8*, i8** %5
%18 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %17)
%19 = load i32, i32* %6
%20 = load i32, i32* %4
%21 = sub i32 %20, %19
store i32 %21, i32* %4
%22 = load i32, i32* %6
%23 = load i8*, i8** %5
%24 = zext i32 %22 to i64
%25 = getelementptr inbounds i8, i8* %23, i64 %24
store i8* %25, i8** %5
br label %8
26: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @str_escape_display(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2, %4
%5 = phi i8* [ %14, %4 ], [ %0, %2 ]
%6 = phi i32 [ %12, %4 ], [ %1, %2 ]
%7 = tail call i64 @strlen(i8* dereferenceable(1) %5)
%8 = trunc i64 %7 to i32
%9 = add i32 %8, 1
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 9)
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %5)
%12 = sub i32 %6, %9
%13 = zext i32 %9 to i64
%14 = getelementptr inbounds i8, i8* %5, i64 %13
%15 = icmp sgt i32 %12, 0
br i1 %15, label %4, label %16
16: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tetris_cleanup_io();
void tetris_signal_quit(int s) { tetris_cleanup_io(); }


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

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

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

LLVM IR (-O2):
define void @tetris_signal_quit(i32 %0) {
%2 = tail call i32 (...) @tetris_cleanup_io()
ret void
}
void closeIO(void) {}


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

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

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

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

/* Variables and functions */
void clear_pins(volatile uint8_t *port, uint8_t bit_clear_mask) {
  *port &= ~bit_clear_mask;
}


x86 assembly (clang, -O0):
<clear_pins>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_pins>:
mov    %esi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
not    %eax
and    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @clear_pins(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store volatile i32 %1, i32* %4
%5 = load volatile i32, i32* %4
%6 = xor i32 %5, -1
%7 = load i32*, i32** %3
%8 = load volatile i32, i32* %7
%9 = and i32 %8, %6
store volatile i32 %9, i32* %7
ret void
}

LLVM IR (-O2):
define void @clear_pins(i32* %0, i32 %1) {
%3 = alloca i32
store volatile i32 %1, i32* %3
%4 = load volatile i32, i32* %3
%5 = xor i32 %4, -1
%6 = load volatile i32, i32* %0
%7 = and i32 %6, %5
store volatile i32 %7, i32* %0
ret void
}
void bfq_bfqq_move(struct bfq_data *bfqd, struct bfq_queue *bfqq,
                   struct bfq_entity *entity, struct bfq_group *bfqg) {}


x86 assembly (clang, -O0):
<bfq_bfqq_move>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.bfq_data = type opaque
%struct.bfq_queue = type opaque
%struct.bfq_entity = type opaque
%struct.bfq_group = type opaque
define void @bfq_bfqq_move(%struct.bfq_data* %0, %struct.bfq_queue* %1, %struct.bfq_entity* %2, %struct.bfq_group* %3) {
%5 = alloca %struct.bfq_data*
%6 = alloca %struct.bfq_queue*
%7 = alloca %struct.bfq_entity*
%8 = alloca %struct.bfq_group*
store %struct.bfq_data* %0, %struct.bfq_data** %5
store %struct.bfq_queue* %1, %struct.bfq_queue** %6
store %struct.bfq_entity* %2, %struct.bfq_entity** %7
store %struct.bfq_group* %3, %struct.bfq_group** %8
ret void
}

LLVM IR (-O2):
%struct.bfq_data = type opaque
%struct.bfq_queue = type opaque
%struct.bfq_entity = type opaque
%struct.bfq_group = type opaque
define void @bfq_bfqq_move(%struct.bfq_data* nocapture %0, %struct.bfq_queue* nocapture %1, %struct.bfq_entity* nocapture %2, %struct.bfq_group* nocapture %3) {
ret void
}
short cimag_fun_complexOf_short(unsigned a) { return a & 0x0000ffff; }


x86 assembly (clang, -O0):
<cimag_fun_complexOf_short>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
cwtl
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @cimag_fun_complexOf_short(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = trunc i32 %4 to i16
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @cimag_fun_complexOf_short(i32 %0) {
%2 = trunc i32 %0 to i16
ret i16 %2
}
int test_imm_3Auint32_mem(unsigned int *val) {
  return ((*val) & (0x3A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_3Auint32_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, 58
%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_3Auint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 58
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t read_i2c(uint8_t addr_i2c, uint8_t *data, uint8_t nb_byte) {}


x86 assembly (clang, -O0):
<read_i2c>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @read_i2c(i32 %0, i32* nocapture readnone %1, i32 %2) {
ret i32 undef
}
void verify_color_schemes() {}


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

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

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

LLVM IR (-O2):
define void @verify_color_schemes() {
ret void
}
puts(s, b) char *s;
int *b;
{
  while (*s)
    putc(*s++, b);
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <puts+0x3f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <putc@plt>
jmp    1120 <puts+0x10>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1148 <puts+0x38>
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <puts+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0, i32* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 (i32, i32*, ...) bitcast (i32 (...)* @putc to i32 (i32, i32*, ...)*)(i32 %9, i32* %1)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret i32 undef
}
/* Variables and functions */
int atoi(char *);
unsigned long factorial(int);
int /*<<< orphan*/ printf(char *, int, unsigned long);
int main(int argc, char *argv[]) {
  int num = atoi(argv[1]);
  unsigned long int calculado = factorial(num);
  printf("Factorial de %d \ es %llu \n", num, calculado);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <factorial@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <factorial@plt>
lea    0xeb6(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Factorial de %d es %llu \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i64
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @atoi(i8* %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = call i64 @factorial(i32 %11)
store i64 %12, i64* %6
%13 = load i32, i32* %5
%14 = load i64, i64* %6
%15 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %13, i64 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Factorial de %d es %llu \0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i64 @factorial(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %6)
ret i32 0
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void QEIVelocityConfigure(uint32_t ui32Base, uint32_t ui32PreDiv,
                          uint32_t ui32Period) {
  ;
  ;
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000000))) =
      (((*((volatile unsigned long *)(ui32Base + 0x00000000))) &
        ~(0x000001C0)) |
       ui32PreDiv);
  (*((volatile unsigned long *)(ui32Base + 0x00000010))) = ui32Period - 1;
}


x86 assembly (clang, -O0):
<QEIVelocityConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0xfffffffffffffe3f,%rcx
mov    -0x10(%rbp),%rax
or     %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIVelocityConfigure>:
mov    %rdi,-0x18(%rsp)
mov    %rsi,-0x8(%rsp)
mov    %rdx,-0x10(%rsp)
mov    -0x18(%rsp),%rax
mov    $0xfffffffffffffe3f,%rcx
and    (%rax),%rcx
or     -0x8(%rsp),%rcx
mov    -0x18(%rsp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rsp),%rax
add    $0xffffffffffffffff,%rax
mov    -0x18(%rsp),%rcx
mov    %rax,0x10(%rcx)
ret

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

LLVM IR (-O2):
define void @QEIVelocityConfigure(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store volatile i64 %0, i64* %4
store volatile i64 %1, i64* %5
store volatile i64 %2, i64* %6
%7 = load volatile i64, i64* %4
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, -449
%11 = load volatile i64, i64* %5
%12 = or i64 %10, %11
%13 = load volatile i64, i64* %4
%14 = inttoptr i64 %13 to i64*
store volatile i64 %12, i64* %14
%15 = load volatile i64, i64* %6
%16 = add i64 %15, -1
%17 = load volatile i64, i64* %4
%18 = add i64 %17, 16
%19 = inttoptr i64 %18 to i64*
store volatile i64 %16, i64* %19
ret void
}
/* Variables and functions */
double sqrt(double);
double estimatePi(int numCoprimePairs, int dataSize) {
  int numPairs = (dataSize * (dataSize - 1)) >> 1;
  return sqrt(6.0 * numPairs / numCoprimePairs);
}


x86 assembly (clang, -O0):
<estimatePi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
imul   %ecx,%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xec3(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estimatePi>:
lea    -0x1(%rsi),%eax
imul   %esi,%eax
sar    %eax
cvtsi2sd %eax,%xmm0
mulsd  0xedc(%rip),%xmm0
cvtsi2sd %edi,%xmm1
divsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     113b <estimatePi+0x2b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @estimatePi(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* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = mul nsw i32 %6, %8
%10 = ashr i32 %9, 1
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = sitofp i32 %11 to double
%13 = fmul double 6.000000e+00, %12
%14 = load i32, i32* %3
%15 = sitofp i32 %14 to double
%16 = fdiv double %13, %15
%17 = call double @sqrt(double %16)
ret double %17
}

LLVM IR (-O2):
define double @estimatePi(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = mul nsw i32 %3, %1
%5 = ashr i32 %4, 1
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 6.000000e+00
%8 = sitofp i32 %0 to double
%9 = fdiv double %7, %8
%10 = tail call double @sqrt(double %9)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ fillSoundEfect();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ view();
void run() {
  srand((unsigned int)time(NULL));
  while (1) {
    fillSoundEfect();
    view();
  }
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1040 <fillSoundEfect@plt>
mov    $0x0,%al
call   1060 <view@plt>
jmp    1154 <run+0x14>

x86 assembly (clang, -O2):
<run>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
nop
xor    %eax,%eax
call   1040 <fillSoundEfect@plt>
xor    %eax,%eax
call   1060 <view@plt>
jmp    1150 <run+0x10>

LLVM IR (-O0):
define void @run() {
%1 = call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = call i32 @srand(i32 %2)
br label %4
4: ; preds = %0, %4
%5 = call i32 (...) @fillSoundEfect()
%6 = call i32 (...) @view()
br label %4
}

LLVM IR (-O2):
define void @run() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
br label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @fillSoundEfect()
%6 = tail call i32 (...) @view()
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char Abc_TtPrintDigitLower(int Digit) {
  assert(Digit >= 0 && Digit < 16);
  if (Digit < 10)
    return '0' + Digit;
  return 'a' + Digit - 10;
}


x86 assembly (clang, -O0):
<Abc_TtPrintDigitLower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     1134 <Abc_TtPrintDigitLower+0x24>
cmpl   $0x10,-0x8(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0xa,-0x8(%rbp)
jge    1159 <Abc_TtPrintDigitLower+0x49>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1165 <Abc_TtPrintDigitLower+0x55>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
sub    $0xa,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Abc_TtPrintDigitLower>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x10,%ebx
setb   %dil
call   1030 <assert@plt>
cmp    $0xa,%ebx
mov    $0x30,%ecx
mov    $0x57,%eax
cmovl  %ecx,%eax
add    %bl,%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @Abc_TtPrintDigitLower(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 16
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ false, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 10
br i1 %14, label %15, label %19
15: ; preds = %9
%16 = load i32, i32* %3
%17 = add nsw i32 48, %16
%18 = trunc i32 %17 to i8
store i8 %18, i8* %2
br label %24
19: ; preds = %9
%20 = load i32, i32* %3
%21 = add nsw i32 97, %20
%22 = sub nsw i32 %21, 10
%23 = trunc i32 %22 to i8
store i8 %23, i8* %2
br label %24
24: ; preds = %19, %15
%25 = load i8, i8* %2
ret i8 %25
}

LLVM IR (-O2):
define signext i8 @Abc_TtPrintDigitLower(i32 %0) {
%2 = icmp ult i32 %0, 16
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = icmp slt i32 %0, 10
%6 = trunc i32 %0 to i8
%7 = select i1 %5, i8 48, i8 87
%8 = add i8 %7, %6
ret i8 %8
}
/* Type definitions */
struct avl_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *avl_delete(struct avl_table *, void *);
void *(avl_assert_delete)(struct avl_table *table, void *item) {
  void *p = avl_delete(table, item);
  assert(p != NULL);
  return p;
}


x86 assembly (clang, -O0):
<avl_assert_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <avl_delete@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avl_assert_delete>:
push   %rbx
call   1040 <avl_delete@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.avl_table = type { i32 }
define i8* @avl_assert_delete(%struct.avl_table* %0, i8* %1) {
%3 = alloca %struct.avl_table*
%4 = alloca i8*
%5 = alloca i8*
store %struct.avl_table* %0, %struct.avl_table** %3
store i8* %1, i8** %4
%6 = load %struct.avl_table*, %struct.avl_table** %3
%7 = load i8*, i8** %4
%8 = call i8* @avl_delete(%struct.avl_table* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
%struct.avl_table = type { i32 }
define i8* @avl_assert_delete(%struct.avl_table* %0, i8* %1) {
%3 = tail call i8* @avl_delete(%struct.avl_table* %0, i8* %1)
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret i8* %3
}
/* Variables and functions */
int EmptyOrError(int, char **);
int Os9Sleep(int);
int atoi(char *);
int picolCommand9Sleep(int argc, char **argv, void *pd) {
  int ticks = atoi(argv[1]);
  int e = Os9Sleep(ticks);
  return EmptyOrError(e, argv);
}


x86 assembly (clang, -O0):
<picolCommand9Sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <Os9Sleep@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <EmptyOrError@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<picolCommand9Sleep>:
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <Os9Sleep@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <EmptyOrError@plt>

LLVM IR (-O0):
define i32 @picolCommand9Sleep(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = call i32 @Os9Sleep(i32 %13)
store i32 %14, i32* %8
%15 = load i32, i32* %8
%16 = load i8**, i8*** %5
%17 = call i32 @EmptyOrError(i32 %15, i8** %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @picolCommand9Sleep(i32 %0, i8** %1, i8* nocapture readnone %2) {
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @atoi(i8* %5)
%7 = tail call i32 @Os9Sleep(i32 %6)
%8 = tail call i32 @EmptyOrError(i32 %7, i8** %1)
ret i32 %8
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
int str2eq(char *s1, char *s2) { return strncmp(s1, s2, 2) == 0; }


x86 assembly (clang, -O0):
<str2eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2eq>:
push   %rax
mov    $0x2,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @str2eq(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 i64 @strncmp(i8* %5, i8* %6, i32 2)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @str2eq(i8* %0, i8* %1) {
%3 = tail call i64 @strncmp(i8* %0, i8* %1, i32 2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int __eqsf2(float a __attribute__((unused)), float b __attribute__((unused))) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @__eqsf2(float %0, float %1) {
ret i32 0
}
int *constructor(char **path, int test) { return ((int *)0); }


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

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

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

LLVM IR (-O2):
define noalias i32* @constructor(i8** nocapture readnone %0, i32 %1) {
ret i32* null
}
extern int foo() {}


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void puts(char *s) {
  char c;
  while ((c = *s++) != '\0') {
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     114a <puts+0x3a>
movsbl -0x9(%rbp),%edi
call   1030 <putchar@plt>
jmp    111c <puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
br label %4
4: ; preds = %10, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
store i8 %7, i8* %3
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i8, i8* %3
%12 = call i32 @putchar(i8 signext %11)
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @putchar(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
int get_le16s(void const *p) {
  return ((signed char const *)p)[1] * 0x100 + ((unsigned char const *)p)[0];
}


x86 assembly (clang, -O0):
<get_le16s>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_le16s>:
movsbl 0x1(%rdi),%ecx
shl    $0x8,%ecx
movzbl (%rdi),%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get_le16s(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = mul nsw i32 %6, 256
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = add nsw i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @get_le16s(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = shl nsw i32 %4, 8
%6 = load i8, i8* %0
%7 = zext i8 %6 to i32
%8 = or i32 %5, %7
ret i32 %8
}
/* Variables and functions */
char *pstrltrim(int /*<<< orphan*/);
int /*<<< orphan*/ pstrrtrim(char *);
char *pstrtrim(char *s) {
  if (!(s && *s))
    return s;
  return pstrltrim(pstrrtrim(s));
}


x86 assembly (clang, -O0):
<pstrtrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1147 <pstrtrim+0x27>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1154 <pstrtrim+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1168 <pstrtrim+0x48>
mov    -0x10(%rbp),%rdi
call   1040 <pstrrtrim@plt>
mov    %eax,%edi
call   1030 <pstrltrim@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pstrtrim>:
push   %rax
test   %rdi,%rdi
je     1138 <pstrtrim+0x18>
cmpb   $0x0,(%rdi)
je     113a <pstrtrim+0x1a>
call   1040 <pstrrtrim@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <pstrltrim@plt>
xor    %edi,%edi
mov    %rdi,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @pstrtrim(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @pstrrtrim(i8* %0)
%8 = tail call i8* @pstrltrim(i32 %7)
br label %9
9: ; preds = %1, %3, %6
%10 = phi i8* [ %8, %6 ], [ %0, %3 ], [ null, %1 ]
ret i8* %10
}
void omap_vout_calculate_vrfb_offset(struct omap_vout_device *vout) {}


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

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

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

LLVM IR (-O2):
%struct.omap_vout_device = type opaque
define void @omap_vout_calculate_vrfb_offset(%struct.omap_vout_device* nocapture %0) {
ret void
}
/* Variables and functions */
bool nrf52_errata_132(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_132() {
ret i32 0
}
any(c, s) register int c;
register char *s;
{
  while (*s)
    if (*s++ == c)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<any>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1144 <any+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    113f <any+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    114b <any+0x4b>
jmp    110b <any+0xb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any>:
movsbl (%rsi),%eax
test   %eax,%eax
je     1115 <any+0x15>
add    $0x1,%rsi
cmp    %edi,%eax
jne    1100 <any>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @any(i32 %0, i8* nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %1, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = sext i8 %5 to i32
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %7
%12 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %12
}