xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strlen(char *);
int compare(const void *a, const void *b) {
  return (int)strlen((char *)b) - (int)strlen((char *)a);
}


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

x86 assembly (clang, -O2):
<compare>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
sub    %eax,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i64 @strlen(i8* %5)
%7 = trunc i64 %6 to i32
%8 = load i8*, i8** %3
%9 = call i64 @strlen(i8* %8)
%10 = trunc i64 %9 to i32
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = trunc i64 %3 to i32
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = trunc i64 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int is_digit(c)
int c;
{ return ((c) >= '0' && (c) <= '9'); }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <is_digit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_digit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void zero_memory(void *block) {
  int i;
  for (i = 0; i < 128; i++) {
    *(unsigned char *)(block + i) = 0x0000;
  }
}


x86 assembly (clang, -O0):
<zero_memory>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x80,-0xc(%rbp)
jge    1136 <zero_memory+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <zero_memory+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_memory>:
xorps  %xmm0,%xmm0
movups %xmm0,0x70(%rdi)
movups %xmm0,0x60(%rdi)
movups %xmm0,0x50(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @zero_memory(i8* nocapture writeonly %0) {
ret void
}
void gdk_screen_height() {}


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

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

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

LLVM IR (-O2):
define void @gdk_screen_height() {
ret void
}
/* Variables and functions */
scalar_t__ kmemmem(char const *, int, char const *, int /*<<< orphan*/, int **);
int /*<<< orphan*/ strlen(char const *);
char *kstrnstr(const char *str, const char *pat, int n, int **_prep) {
  return (char *)kmemmem(str, n, pat, strlen(pat), _prep);
}


x86 assembly (clang, -O0):
<kstrnstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x28(%rbp),%rdx
mov    %eax,%ecx
mov    -0x20(%rbp),%r8
call   1040 <kmemmem@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kstrnstr>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
mov    %r14,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <kmemmem@plt>

LLVM IR (-O0):
define i8* @kstrnstr(i8* %0, i8* %1, i32 %2, i32** %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32**
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32** %3, i32*** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %7
%11 = load i8*, i8** %6
%12 = load i8*, i8** %6
%13 = call i32 @strlen(i8* %12)
%14 = load i32**, i32*** %8
%15 = call i64 @kmemmem(i8* %9, i32 %10, i8* %11, i32 %13, i32** %14)
%16 = inttoptr i64 %15 to i8*
ret i8* %16
}

LLVM IR (-O2):
define i8* @kstrnstr(i8* %0, i8* %1, i32 %2, i32** %3) {
%5 = tail call i32 @strlen(i8* %1)
%6 = tail call i64 @kmemmem(i8* %0, i32 %2, i8* %1, i32 %5, i32** %3)
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
void crit_enter(void) {}


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

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

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

LLVM IR (-O2):
define void @crit_enter() {
ret void
}
void GB_LOR_f_FP32(float *z, const float *x, const float *y) {
  (*z) = (((*x) != 0) || ((*y) != 0));
}


x86 assembly (clang, -O0):
<GB_LOR_f_FP32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    $0x1,%al
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
mov    %al,-0x19(%rbp)
jne    1148 <GB_LOR_f_FP32+0x48>
jp     1148 <GB_LOR_f_FP32+0x48>
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2ss %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GB_LOR_f_FP32>:
movss  (%rsi),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    110e <GB_LOR_f_FP32+0xe>
jnp    111b <GB_LOR_f_FP32+0x1b>
movss  0xeea(%rip),%xmm0
movss  %xmm0,(%rdi)
ret
cmpneqss (%rdx),%xmm1
movss  0xed8(%rip),%xmm0
andps  %xmm1,%xmm0
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @GB_LOR_f_FP32(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %5
%8 = load float, float* %7
%9 = fcmp une float %8, 0.000000e+00
br i1 %9, label %14, label %10
10: ; preds = %3
%11 = load float*, float** %6
%12 = load float, float* %11
%13 = fcmp une float %12, 0.000000e+00
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ true, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = sitofp i32 %16 to float
%18 = load float*, float** %4
store float %17, float* %18
ret void
}

LLVM IR (-O2):
define void @GB_LOR_f_FP32(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = fcmp une float %4, 0.000000e+00
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = load float, float* %2
%8 = fcmp une float %7, 0.000000e+00
%9 = uitofp i1 %8 to float
br label %10
10: ; preds = %6, %3
%11 = phi float [ 1.000000e+00, %3 ], [ %9, %6 ]
store float %11, float* %0
ret void
}
int negative(int x) { return x > 0 ? -1 * x : x; }


x86 assembly (clang, -O0):
<negative>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1120 <negative+0x20>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <negative+0x26>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @negative(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 false)
%3 = sub i32 0, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void sj_free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @sj_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void usage(int exitval) {
  fprintf(exitval ? stderr : stdout,
          "Usage: crc16-concat FILE\n"
          "Calculate a CRC16 of FILE and concatenate it to FILE.\n\n");
  exit(exitval);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <usage+0x26>
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <usage+0x32>
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jne    1130 <usage+0x10>
mov    0x2eaa(%rip),%rax
jmp    1137 <usage+0x17>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@stdout = global i32 0
@.str = [81 x i8] c"Usage: crc16-concat FILE\0ACalculate a CRC16 of FILE and concatenate it to FILE.\0A\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* @stderr
br label %9
7: ; preds = %1
%8 = load i32, i32* @stdout
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %2
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@stdout = global i32 0
@.str = [81 x i8] c"Usage: crc16-concat FILE\0ACalculate a CRC16 of FILE and concatenate it to FILE.\0A\0A\00"
define void @usage(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32, i32* @stderr
%4 = load i32, i32* @stdout
%5 = select i1 %2, i32 %4, i32 %3
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ PTHREAD_CANCEL_ENABLE;
int pthread_setcancelstate(int /*<<< orphan*/, void *);
int _pthread_enableCancel() {
  return pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, ((void *)0));
}


x86 assembly (clang, -O0):
<_pthread_enableCancel>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pthread_setcancelstate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pthread_enableCancel>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
jmp    1030 <pthread_setcancelstate@plt>

LLVM IR (-O0):
@PTHREAD_CANCEL_ENABLE = global i32 0
define i32 @_pthread_enableCancel() {
%1 = load i32, i32* @PTHREAD_CANCEL_ENABLE
%2 = call i32 @pthread_setcancelstate(i32 %1, i8* null)
ret i32 %2
}

LLVM IR (-O2):
@PTHREAD_CANCEL_ENABLE = global i32 0
define i32 @_pthread_enableCancel() {
%1 = load i32, i32* @PTHREAD_CANCEL_ENABLE
%2 = tail call i32 @pthread_setcancelstate(i32 %1, i8* null)
ret i32 %2
}
/* Variables and functions */
char chomp_at(char *, scalar_t__);
scalar_t__ strlen(char *);
char chomp(char *str) { return chomp_at(str, strlen(str) - 1); }


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rsi
sub    $0x1,%rsi
call   1040 <chomp_at@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    -0x1(%rax),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <chomp_at@plt>

LLVM IR (-O0):
define signext i8 @chomp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = sub nsw i64 %5, 1
%7 = call signext i8 @chomp_at(i8* %3, i64 %6)
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @chomp(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, -1
%4 = tail call signext i8 @chomp_at(i8* %0, i64 %3)
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
bool char_is_in_range(char c, char lower, char upper) {
  assert(lower < upper);
  return (lower <= c && c <= upper);
}


x86 assembly (clang, -O0):
<char_is_in_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x2(%rbp),%eax
movsbl -0x3(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsbl -0x2(%rbp),%ecx
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x4(%rbp)
jg     1165 <char_is_in_range+0x55>
movsbl -0x1(%rbp),%eax
movsbl -0x3(%rbp),%ecx
cmp    %ecx,%eax
setle  %al
mov    %al,-0x4(%rbp)
mov    -0x4(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_is_in_range>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %edi,%edi
cmp    %r14b,%bpl
setl   %dil
call   1030 <assert@plt>
cmp    %bl,%bpl
setle  %al
cmp    %r14b,%bl
setle  %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @char_is_in_range(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = icmp slt i8 %1, %2
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = icmp sle i8 %1, %0
%8 = icmp sle i8 %0, %2
%9 = and i1 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
char *reserved_flash_area_start(void) { return (char *)0x00007000; }


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

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

LLVM IR (-O0):
define i8* @reserved_flash_area_start() {
ret i8* inttoptr (i64 28672 to i8*)
}

LLVM IR (-O2):
define i8* @reserved_flash_area_start() {
ret i8* inttoptr (i64 28672 to i8*)
}
int xiscntrl(int c) { return (c < (int)' '); }


x86 assembly (clang, -O0):
<xiscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xiscntrl>:
xor    %eax,%eax
cmp    $0x20,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @xiscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 32
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @xiscntrl(i32 %0) {
%2 = icmp slt i32 %0, 32
%3 = zext i1 %2 to i32
ret i32 %3
}
int ld_bge_mm1(long double *a1, long double *a2) {
  return (__builtin_isgreaterequal(*a1, *a2));
}


x86 assembly (clang, -O0):
<ld_bge_mm1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    -0x10(%rbp),%rax
fldt   (%rax)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_bge_mm1>:
fldt   (%rdi)
fldt   (%rsi)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
ret

LLVM IR (-O0):
define i32 @ld_bge_mm1(x86_fp80* %0, x86_fp80* %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80*, x86_fp80** %4
%8 = load x86_fp80, x86_fp80* %7
%9 = fcmp oge x86_fp80 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ld_bge_mm1(x86_fp80* nocapture %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = load x86_fp80, x86_fp80* %1
%5 = fcmp oge x86_fp80 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
long tolower(int a, int b) { return (long)(a + b); }


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

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

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

LLVM IR (-O2):
define i64 @tolower(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sext i32 %3 to i64
ret i64 %4
}
void TimerCleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @TimerCleanup() {
ret void
}
char *strcpy(char *dest, const char *src) {
  char *result = dest;
  char c;
  do {
    c = *(src++);
    *(dest++) = c;
  } while (c);
  return result;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
cmpb   $0x0,-0x19(%rbp)
jne    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_shm_create_rw() {
  printf("NOT IMPLEMENTED:"
         "pa_shm_create_rw"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_shm_create_rw\0A\00"
define i32 @pa_shm_create_rw() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_shm_create_rw\00"
define i32 @pa_shm_create_rw() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ StopSoundExt(int, int);
void StopSound(int nr) { StopSoundExt(nr, ((1 << 3))); }


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

x86 assembly (clang, -O2):
<StopSound>:
mov    $0x8,%esi
jmp    1030 <StopSoundExt@plt>

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

LLVM IR (-O2):
define void @StopSound(i32 %0) {
%2 = tail call i32 @StopSoundExt(i32 %0, i32 8)
ret void
}
/* Variables and functions */
double acos(double);
double Acos(double a, double b) { return acos(a); }


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

x86 assembly (clang, -O2):
<Acos>:
jmp    1030 <acos@plt>

LLVM IR (-O0):
define double @Acos(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @acos(double %5)
ret double %6
}

LLVM IR (-O2):
define double @Acos(double %0, double %1) {
%3 = tail call double @acos(double %0)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int squareSum();
int sumSquare();
int main() {
  int x = squareSum() - sumSquare();
  printf("%i", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <squareSum@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <sumSquare@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <squareSum@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <sumSquare@plt>
sub    %eax,%ebx
lea    0xeb6(%rip),%rdi
mov    %ebx,%esi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @squareSum()
%4 = call i32 (...) @sumSquare()
%5 = sub nsw i32 %3, %4
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @main() {
%1 = tail call i32 (...) @squareSum()
%2 = tail call i32 (...) @sumSquare()
%3 = sub nsw i32 %1, %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
char *strdup(char *);
char *strrchr(char *, char);
char *file_name(char *path) {
  char *p = strrchr(path, '/');
  if (p == NULL)
    return strdup(path);
  else
    return strdup(++p);
}


x86 assembly (clang, -O0):
<file_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115b <file_name+0x3b>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    1170 <file_name+0x50>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x18(%rbp)
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_name>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1140 <file_name+0x20>
add    $0x1,%rax
mov    %rax,%rdi
pop    %rbx
jmp    1040 <strdup@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strdup@plt>

LLVM IR (-O0):
define i8* @file_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i8* @strdup(i8* %10)
store i8* %11, i8** %2
br label %16
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %4
%15 = call i8* @strdup(i8* %14)
store i8* %15, i8** %2
br label %16
16: ; preds = %12, %9
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
define noalias i8* @file_name(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @strdup(i8* %0)
br label %9
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %2, i64 1
%8 = tail call i8* @strdup(i8* %7)
br label %9
9: ; preds = %6, %4
%10 = phi i8* [ %5, %4 ], [ %8, %6 ]
ret i8* %10
}
void callSelf() { callSelf(); }


x86 assembly (clang, -O0):
<callSelf>:
push   %rbp
mov    %rsp,%rbp
call   1030 <callSelf@plt>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @callSelf() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fatal_error_with_errno(char *);
scalar_t__ fclose(int /*<<< orphan*/ *);
void xfclose(void *fp) {
  if (fp && fclose((FILE *)fp) != 0)
    fatal_error_with_errno("Failed to close output file");
}


x86 assembly (clang, -O0):
<xfclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1156 <xfclose+0x36>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
cmp    $0x0,%rax
je     1156 <xfclose+0x36>
lea    0xeaf(%rip),%rdi
call   1040 <fatal_error_with_errno@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfclose>:
test   %rdi,%rdi
je     1141 <xfclose+0x21>
push   %rax
call   1030 <fclose@plt>
test   %rax,%rax
lea    0x8(%rsp),%rsp
je     1141 <xfclose+0x21>
lea    0xec4(%rip),%rdi
jmp    1040 <fatal_error_with_errno@plt>
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Failed to close output file\00"
define void @xfclose(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
%8 = call i64 @fclose(i32* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = call i32 @fatal_error_with_errno(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %5, %1
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Failed to close output file\00"
define void @xfclose(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i32*
%5 = tail call i64 @fclose(i32* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @fatal_error_with_errno(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %3, %1
ret void
}
int mIsAustraliaState(int ccode) { return (ccode >= 306 && ccode <= 314); }


x86 assembly (clang, -O0):
<mIsAustraliaState>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x132,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <mIsAustraliaState+0x26>
cmpl   $0x13a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mIsAustraliaState>:
add    $0xfffffece,%edi
xor    %eax,%eax
cmp    $0x9,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @mIsAustraliaState(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 306
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 314
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mIsAustraliaState(i32 %0) {
%2 = add i32 %0, -306
%3 = icmp ult i32 %2, 9
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
#define F_GETLK 130
#define F_SETLK 129
#define F_SETLKW 128
int fuserl_lock_cmd_canonicalize(int cmd) {
  switch (cmd) {
  case F_GETLK:
    return 0;
  case F_SETLK:
    return 1;
  case F_SETLKW:
    return 2;
  default:
    return 3;
  }
}


x86 assembly (clang, -O0):
<fuserl_lock_cmd_canonicalize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x80,%eax
je     115b <fuserl_lock_cmd_canonicalize+0x5b>
jmp    111d <fuserl_lock_cmd_canonicalize+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x81,%eax
je     114f <fuserl_lock_cmd_canonicalize+0x4f>
jmp    1130 <fuserl_lock_cmd_canonicalize+0x30>
mov    -0xc(%rbp),%eax
sub    $0x82,%eax
jne    1167 <fuserl_lock_cmd_canonicalize+0x67>
jmp    1143 <fuserl_lock_cmd_canonicalize+0x43>
movl   $0x0,-0x4(%rbp)
jmp    116e <fuserl_lock_cmd_canonicalize+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    116e <fuserl_lock_cmd_canonicalize+0x6e>
movl   $0x2,-0x4(%rbp)
jmp    116e <fuserl_lock_cmd_canonicalize+0x6e>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuserl_lock_cmd_canonicalize>:
mov    $0x82,%ecx
sub    %edi,%ecx
add    $0xffffff80,%edi
cmp    $0x3,%edi
mov    $0x3,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fuserl_lock_cmd_canonicalize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 130, label %5
i32 129, label %6
i32 128, label %7
]
5: ; preds = %1
store i32 0, i32* %2
br label %9
6: ; preds = %1
store i32 1, i32* %2
br label %9
7: ; preds = %1
store i32 2, i32* %2
br label %9
8: ; preds = %1
store i32 3, i32* %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @fuserl_lock_cmd_canonicalize(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 3
%4 = sub i32 130, %0
%5 = select i1 %3, i32 %4, i32 3
ret i32 %5
}
int test_006(int a, int b, int c) {
  int x = a > 0;
  int y = b + x;
  return y - c;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
xor    %eax,%eax
test   %edi,%edi
setg   %al
add    %esi,%eax
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @test_006(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 0
%11 = zext i1 %10 to i32
store i32 %11, i32* %7
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = add nsw i32 %12, %13
store i32 %14, i32* %8
%15 = load i32, i32* %8
%16 = load i32, i32* %6
%17 = sub nsw i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @test_006(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, 0
%5 = zext i1 %4 to i32
%6 = add nsw i32 %5, %1
%7 = sub i32 %6, %2
ret i32 %7
}
void RTAssertMsg1Weak(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAssertMsg1Weak() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("C: Hello World!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%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 = [17 x i8] c"C: Hello World!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"C: Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ AUTHORITY_INFO_ACCESS;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ AUTHORITY_INFO_ACCESS_it;
int i2d_AUTHORITY_INFO_ACCESS(AUTHORITY_INFO_ACCESS *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &AUTHORITY_INFO_ACCESS_it);
}


x86 assembly (clang, -O0):
<i2d_AUTHORITY_INFO_ACCESS>:
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    0x2eb9(%rip),%rdx
call   1030 <ASN1_item_i2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_AUTHORITY_INFO_ACCESS>:
mov    0x2ed1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

LLVM IR (-O0):
@AUTHORITY_INFO_ACCESS_it = global i32 0
define i32 @i2d_AUTHORITY_INFO_ACCESS(i32* %0, i8** %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 @ASN1_item_i2d(i32* %5, i8** %6, i32* @AUTHORITY_INFO_ACCESS_it)
ret i32 %7
}

LLVM IR (-O2):
@AUTHORITY_INFO_ACCESS_it = global i32 0
define i32 @i2d_AUTHORITY_INFO_ACCESS(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @AUTHORITY_INFO_ACCESS_it)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void call_this() { printf("Hello Python!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello Python!\00"
define void @call_this() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void atexit2(void) { printf("atexit2\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"atexit2\00"
define void @atexit2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
void zeros(double *A, int n) {
  int i;
  for (i = 0; i < n; i++)
    A[i] = 0;
}


x86 assembly (clang, -O0):
<zeros>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <zeros+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <zeros+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeros>:
test   %esi,%esi
jle    1126 <zeros+0x16>
push   %rax
mov    %esi,%edx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @zeros(double* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast double* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 3
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TestFindOrInsert();
int /*<<< orphan*/ TestInsert();
int main(int argc, char **argv) {
  TestInsert();
  TestFindOrInsert();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <TestInsert@plt>
mov    $0x0,%al
call   1040 <TestFindOrInsert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @TestInsert()
%7 = call i32 (...) @TestFindOrInsert()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @TestInsert()
%4 = tail call i32 (...) @TestFindOrInsert()
ret i32 0
}
/* Variables and functions */
double rc_adc_volt(int);
float rc_dc_jack_voltage() {
  float v = (rc_adc_volt(5) * 11.0) + -0.15;
  if (v < 0.3)
    v = 0.0;
  return v;
}


x86 assembly (clang, -O0):
<rc_dc_jack_voltage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
call   1030 <rc_adc_volt@plt>
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeac(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1166 <rc_dc_jack_voltage+0x56>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc_dc_jack_voltage>:
push   %rax
mov    $0x5,%edi
call   1030 <rc_adc_volt@plt>
mulsd  0xedd(%rip),%xmm0
addsd  0xedd(%rip),%xmm0
cvtsd2ss %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  0xed2(%rip),%xmm2
ucomisd %xmm0,%xmm2
xorps  %xmm0,%xmm0
ja     114a <rc_dc_jack_voltage+0x3a>
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @rc_dc_jack_voltage() {
%1 = alloca float
%2 = call double @rc_adc_volt(i32 5)
%3 = call double @llvm.fmuladd.f64(double %2, double 1.100000e+01, double -1.500000e-01)
%4 = fptrunc double %3 to float
store float %4, float* %1
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fcmp olt double %6, 3.000000e-01
br i1 %7, label %8, label %9
8: ; preds = %0
store float 0.000000e+00, float* %1
br label %9
9: ; preds = %8, %0
%10 = load float, float* %1
ret float %10
}

LLVM IR (-O2):
define float @rc_dc_jack_voltage() {
%1 = tail call double @rc_adc_volt(i32 5)
%2 = tail call double @llvm.fmuladd.f64(double %1, double 1.100000e+01, double -1.500000e-01)
%3 = fptrunc double %2 to float
%4 = fpext float %3 to double
%5 = fcmp olt double %4, 3.000000e-01
%6 = select i1 %5, float 0.000000e+00, float %3
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ android_compiler_barrier();
extern __attribute__((always_)) void android_memory_store_barrier(void) {
  android_compiler_barrier();
}


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

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

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

LLVM IR (-O2):
define void @android_memory_store_barrier() {
%1 = tail call i32 (...) @android_compiler_barrier()
ret void
}
/* Variables and functions */
int ea_mode(int);
int ea_address(int opcode) {
  int mode = ea_mode(opcode);
  return (mode != 0) && (mode != 1) && (mode != 11);
}


x86 assembly (clang, -O0):
<ea_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ea_mode@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     114e <ea_address+0x3e>
xor    %eax,%eax
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     114e <ea_address+0x3e>
cmpl   $0xb,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ea_address>:
push   %rax
call   1030 <ea_mode@plt>
cmp    $0x2,%eax
setae  %cl
cmp    $0xb,%eax
setne  %al
and    %cl,%al
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ea_address(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @ea_mode(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 1
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 11
br label %14
14: ; preds = %11, %8, %1
%15 = phi i1 [ false, %8 ], [ false, %1 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @ea_address(i32 %0) {
%2 = tail call i32 @ea_mode(i32 %0)
%3 = icmp ugt i32 %2, 1
%4 = icmp ne i32 %2, 11
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned char Cube_GetAxis(unsigned char prev) {
  return (prev >> 4) + (prev & 0x07) << 3;
}


x86 assembly (clang, -O0):
<Cube_GetAxis>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
movzbl -0x1(%rbp),%ecx
and    $0x7,%ecx
add    %ecx,%eax
shl    $0x3,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cube_GetAxis>:
mov    %edi,%eax
shr    $0x4,%al
and    $0x7,%dil
add    %dil,%al
shl    $0x3,%al
ret

LLVM IR (-O0):
define zeroext i8 @Cube_GetAxis(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = and i32 %7, 7
%9 = add nsw i32 %5, %8
%10 = shl i32 %9, 3
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @Cube_GetAxis(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = and i8 %0, 7
%4 = add nuw nsw i8 %2, %3
%5 = shl nuw i8 %4, 3
ret i8 %5
}
float maxvalue(float a, float b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<maxvalue>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <maxvalue+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <maxvalue+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxvalue>:
maxss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @maxvalue(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}