xunge/DecIR huggingface dataset:
double cube(double x) { return x * x * x; }


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

x86 assembly (clang, -O2):
<cube>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @cube(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @cube(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ dh_putc(char);
int /*<<< orphan*/ putu16(int);
void puti16(int num) {
  if (num < 0) {
    dh_putc('-');
    putu16(-num);
  } else {
    putu16(num);
  }
}


x86 assembly (clang, -O0):
<puti16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    114e <puti16+0x2e>
mov    $0x2d,%edi
call   1040 <dh_putc@plt>
xor    %edi,%edi
sub    -0x4(%rbp),%edi
call   1030 <putu16@plt>
jmp    1156 <puti16+0x36>
mov    -0x4(%rbp),%edi
call   1030 <putu16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puti16>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jns    1133 <puti16+0x13>
mov    $0x2d,%edi
call   1040 <dh_putc@plt>
neg    %ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <putu16@plt>

LLVM IR (-O0):
define void @puti16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = call i32 @dh_putc(i8 signext 45)
%7 = load i32, i32* %2
%8 = sub nsw i32 0, %7
%9 = call i32 @putu16(i32 %8)
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i32 @putu16(i32 %11)
br label %13
13: ; preds = %10, %5
ret void
}

LLVM IR (-O2):
define void @puti16(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @dh_putc(i8 signext 45)
%5 = sub nsw i32 0, %0
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ %0, %1 ]
%8 = tail call i32 @putu16(i32 %7)
ret void
}
unsigned int t_sec(int bytes) { return bytes >> 9; }


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

x86 assembly (clang, -O2):
<t_sec>:
mov    %edi,%eax
sar    $0x9,%eax
ret

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

LLVM IR (-O2):
define i32 @t_sec(i32 %0) {
%2 = ashr i32 %0, 9
ret i32 %2
}
/* Variables and functions */
int getfields(char *, char **, int, int, char *);
int tokenize(char *str, char **args, int max) {
  return getfields(str, args, max, 1, " \t\n\r");
}


x86 assembly (clang, -O0):
<tokenize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x1,%ecx
lea    0xec6(%rip),%r8
call   1030 <getfields@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tokenize>:
lea    0xee9(%rip),%r8
mov    $0x1,%ecx
jmp    1030 <getfields@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c" \09\0A\0D\00"
define i32 @tokenize(i8* %0, i8** %1, i32 %2) {
%4 = tail call i32 @getfields(i8* %0, i8** %1, i32 %2, i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int16_t abs16(int16_t x) { return x < 0 ? -x : x; }


x86 assembly (clang, -O0):
<abs16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <abs16+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs16+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @abs16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %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 @abs16(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void poll_fsb_nothing(void) { return; }


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

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

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

LLVM IR (-O2):
define void @poll_fsb_nothing() {
ret void
}
void backbu_(n) int *n;
{ backbuffer(*n); }


x86 assembly (clang, -O0):
<backbu_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <backbuffer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backbu_>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <backbuffer@plt>

LLVM IR (-O0):
define void @backbu_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @backbuffer to i32 (i32, ...)*)(i32 %4)
ret void
}

LLVM IR (-O2):
define void @backbu_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @backbuffer to i32 (i32, ...)*)(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xmlError(int);
void xmlResponseWQ(int err) { xmlError((err) ? 3 : 0); }


x86 assembly (clang, -O0):
<xmlResponseWQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
xor    %edi,%edi
mov    $0x3,%eax
cmp    $0x0,%ecx
cmovne %eax,%edi
call   1030 <xmlError@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlResponseWQ>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
lea    (%rax,%rax,2),%edi
jmp    1030 <xmlError@plt>

LLVM IR (-O0):
define void @xmlResponseWQ(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 3, i32 0
%7 = call i32 @xmlError(i32 %6)
ret void
}

LLVM IR (-O2):
define void @xmlResponseWQ(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 0, i32 3
%4 = tail call i32 @xmlError(i32 %3)
ret void
}
const char *getRtInfo(int tp) { return ""; }


x86 assembly (clang, -O0):
<getRtInfo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @getRtInfo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @getRtInfo(i32 %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
const char *EAC_OBJ_nid2ln(int n) { return EAC_OBJ_nid2ln(n); }


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

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

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

LLVM IR (-O2):
define noalias i8* @EAC_OBJ_nid2ln(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
_prfnum(f) double f;
{
  char buffer[100];
  char *c;
  _asschn();
  c = buffer;
  _str(f, c);
  strcat(buffer, " ");
  _out(buffer);
}


x86 assembly (clang, -O0):
<_prfnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <_asschn@plt>
lea    -0x80(%rbp),%rax
mov    %rax,-0x88(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x88(%rbp),%rdi
mov    $0x1,%al
call   1060 <_str@plt>
lea    -0x80(%rbp),%rdi
lea    0xe80(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x80(%rbp),%rdi
mov    $0x0,%al
call   1030 <_out@plt>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_prfnum>:
push   %rbx
sub    $0x80,%rsp
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1050 <_asschn@plt>
lea    0x10(%rsp),%rbx
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <_str@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
movw   $0x20,0x10(%rsp,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <_out@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define i32 @_prfnum(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca [100 x i8]
%5 = alloca i8*
store double %0, double* %3
%6 = call i32 (...) @_asschn()
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
store i8* %7, i8** %5
%8 = load double, double* %3
%9 = load i8*, i8** %5
%10 = call i32 (double, i8*, ...) bitcast (i32 (...)* @_str to i32 (double, i8*, ...)*)(double %8, i8* %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%12 = call i8* @strcat(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @_out to i32 (i8*, ...)*)(i8* %13)
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @_prfnum(double %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = tail call i32 (...) @_asschn()
%5 = call i32 (double, i8*, ...) bitcast (i32 (...)* @_str to i32 (double, i8*, ...)*)(double %0, i8* %3)
%6 = call i64 @strlen(i8* %3)
%7 = getelementptr [100 x i8], [100 x i8]* %2, i64 0, i64 %6
%8 = bitcast i8* %7 to i16*
store i16 32, i16* %8
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @_out to i32 (i8*, ...)*)(i8* %3)
ret i32 undef
}
/* Variables and functions */
double exp(int);
double snaf(double const x) { return x > 0 ? exp(-1 / x) : 0; }


x86 assembly (clang, -O0):
<snaf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114f <snaf+0x3f>
movsd  0xec9(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    115c <snaf+0x4c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    115c <snaf+0x4c>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snaf>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112f <snaf+0x1f>
movsd  0xede(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
jmp    1030 <exp@plt>
xorpd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @snaf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load double, double* %2
%7 = fdiv double -1.000000e+00, %6
%8 = fptosi double %7 to i32
%9 = call double @exp(i32 %8)
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %5
%12 = phi double [ %9, %5 ], [ 0.000000e+00, %10 ]
ret double %12
}

LLVM IR (-O2):
define double @snaf(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fdiv double -1.000000e+00, %0
%5 = fptosi double %4 to i32
%6 = tail call double @exp(i32 %5)
br label %7
7: ; preds = %1, %3
%8 = phi double [ %6, %3 ], [ 0.000000e+00, %1 ]
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
__attribute__((gnu_)) void carmen_erase_structure(void *ptr,
                                                  int size_of_struture) {
  memset(ptr, 0, size_of_struture);
}


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

x86 assembly (clang, -O2):
<carmen_erase_structure>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @carmen_erase_structure(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
ret void
}
void INT_Excep_ICU_IRQ5(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_ICU_IRQ5() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int setuid(int /*<<< orphan*/);
void become_root(void) {
  int r = setuid(0);
  if (r == -1) {
    perror("setuid");
    exit(EXIT_FAILURE);
  };
}


x86 assembly (clang, -O0):
<become_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <setuid@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1166 <become_root+0x36>
lea    0xead(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<become_root>:
push   %rax
xor    %edi,%edi
call   1050 <setuid@plt>
cmp    $0xffffffff,%eax
je     113f <become_root+0xf>
pop    %rax
ret
lea    0xeba(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"setuid\00"
@EXIT_FAILURE = global i32 0
define void @become_root() {
%1 = alloca i32
%2 = call i32 @setuid(i32 0)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %0
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"setuid\00"
@EXIT_FAILURE = global i32 0
define void @become_root() {
%1 = tail call i32 @setuid(i32 0)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %0
ret void
}
void XSetIconName() {}


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

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

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

LLVM IR (-O2):
define void @XSetIconName() {
ret void
}
/* Variables and functions */
float ilogbf(float);
float __ocl_logb_float(float src) { return ilogbf(src); }


x86 assembly (clang, -O0):
<__ocl_logb_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <ilogbf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_logb_float>:
jmp    1030 <ilogbf@plt>

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

LLVM IR (-O2):
define float @__ocl_logb_float(float %0) {
%2 = tail call float @ilogbf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
int /*<<< orphan*/ match(char);
int /*<<< orphan*/ term();
void add() {
  match('+');
  term();
  emitln("pop\t%%ebx");
  emitln("add\t%%ebx,%%eax");
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2b,%edi
call   1050 <match@plt>
mov    $0x0,%al
call   1040 <term@plt>
lea    0xeb4(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb2(%rip),%rdi
call   1030 <emitln@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
push   %rax
mov    $0x2b,%edi
call   1050 <match@plt>
xor    %eax,%eax
call   1040 <term@plt>
lea    0xeb7(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb5(%rip),%rdi
pop    %rax
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"pop\09%%ebx\00"
@.str.1 = [16 x i8] c"add\09%%ebx,%%eax\00"
define void @add() {
%1 = call i32 @match(i8 signext 43)
%2 = call i32 (...) @term()
%3 = call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @emitln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"pop\09%%ebx\00"
@.str.1 = [16 x i8] c"add\09%%ebx,%%eax\00"
define void @add() {
%1 = tail call i32 @match(i8 signext 43)
%2 = tail call i32 (...) @term()
%3 = tail call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @emitln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int not_bar() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @not_bar() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x9d() {
  Assert_real((isgraph(157) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              790, ("isgraph should be 0 for 0x9d"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x9d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9d,%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x316,%edx
lea    0xf5b(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x9d>:
push   %rax
mov    $0x9d,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x316,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x9d\00"
define void @t_isgraph_0x9d() {
%1 = call i64 @isgraph(i32 157)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 790, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x9d\00"
define void @t_isgraph_0x9d() {
%1 = tail call i64 @isgraph(i32 157)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 790, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
const char *Thread_Name(void) { return "Thread"; }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"Thread\00"
define i8* @Thread_Name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ gen_tmp_file(char *);
int /*<<< orphan*/ test();
int main() {
  gen_tmp_file("lock.dat");
  test();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <gen_tmp_file@plt>
mov    $0x0,%al
call   1040 <test@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"lock.dat\00"
define i32 @main() {
%1 = call i32 @gen_tmp_file(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @test()
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"lock.dat\00"
define i32 @main() {
%1 = tail call i32 @gen_tmp_file(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void callback(void (*func_ptr)(int *), int *arg) {
  printf("Calling the function pointer\n");
  func_ptr(arg);
}


x86 assembly (clang, -O0):
<callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    *%rax

LLVM IR (-O0):
@.str = [30 x i8] c"Calling the function pointer\0A\00"
define void @callback(void (i32*)* %0, i32* %1) {
%3 = alloca void (i32*)*
%4 = alloca i32*
store void (i32*)* %0, void (i32*)** %3
store i32* %1, i32** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%6 = load void (i32*)*, void (i32*)** %3
%7 = load i32*, i32** %4
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"Calling the function pointer\00"
define void @callback(void (i32*)* nocapture %0, i32* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
tail call void %0(i32* %1)
ret void
}
/* Variables and functions */
void reverse(char *begin, char *end) {
  char *is = begin;
  char *ie = end - 1;
  while (is < ie) {
    char tmp = *ie;
    *ie = *is;
    *is = tmp;
    ++is;
    --ie;
  }
}


x86 assembly (clang, -O0):
<reverse>:
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
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1169 <reverse+0x69>
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x21(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x21(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    1120 <reverse+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
add    $0xffffffffffffffff,%rsi
cmp    %rdi,%rsi
jbe    112c <reverse+0x2c>
add    $0x1,%rdi
nopl   (%rax)
movzbl (%rsi),%eax
movzbl -0x1(%rdi),%ecx
mov    %cl,(%rsi)
mov    %al,-0x1(%rdi)
add    $0xffffffffffffffff,%rsi
lea    0x1(%rdi),%rax
cmp    %rsi,%rdi
mov    %rax,%rdi
jb     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define void @reverse(i8* %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 -1
%4 = icmp ugt i8* %3, %0
br i1 %4, label %5, label %13
5: ; preds = %2, %5
%6 = phi i8* [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = load i8, i8* %6
%9 = load i8, i8* %7
store i8 %9, i8* %6
store i8 %8, i8* %7
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = getelementptr inbounds i8, i8* %6, i64 -1
%12 = icmp ult i8* %10, %11
br i1 %12, label %5, label %13
13: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int char32_t;
typedef int char16_t;

/* Variables and functions */
char32_t utf16_surrogate_pair_to_unichar(char16_t lead, char16_t trail) {
  return ((lead - 0xd800) << 10) + (trail - 0xdc00) + 0x10000;
}


x86 assembly (clang, -O0):
<utf16_surrogate_pair_to_unichar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0xd800,%eax
shl    $0xa,%eax
mov    -0x8(%rbp),%ecx
sub    $0xdc00,%ecx
add    %ecx,%eax
add    $0x10000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf16_surrogate_pair_to_unichar>:
shl    $0xa,%edi
lea    (%rsi,%rdi,1),%eax
add    $0xfca02400,%eax
ret

LLVM IR (-O0):
define i32 @utf16_surrogate_pair_to_unichar(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 = sub nsw i32 %5, 55296
%7 = shl i32 %6, 10
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 56320
%10 = add nsw i32 %7, %9
%11 = add nsw i32 %10, 65536
ret i32 %11
}

LLVM IR (-O2):
define i32 @utf16_surrogate_pair_to_unichar(i32 %0, i32 %1) {
%3 = shl i32 %0, 10
%4 = add i32 %1, -56613888
%5 = add i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ finn_vec3_dot(float *, float *);
float sqrt(int /*<<< orphan*/);
float finn_vec3_mag(float *lhs) { return sqrt(finn_vec3_dot(lhs, lhs)); }


x86 assembly (clang, -O0):
<finn_vec3_mag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <finn_vec3_dot@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finn_vec3_mag>:
push   %rax
mov    %rdi,%rsi
call   1030 <finn_vec3_dot@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define float @finn_vec3_mag(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float*, float** %2
%5 = call i32 @finn_vec3_dot(float* %3, float* %4)
%6 = call float @sqrt(i32 %5)
ret float %6
}

LLVM IR (-O2):
define float @finn_vec3_mag(float* %0) {
%2 = tail call i32 @finn_vec3_dot(float* %0, float* %0)
%3 = tail call float @sqrt(i32 %2)
ret float %3
}
void ChkStack(void) {}


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

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

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

LLVM IR (-O2):
define void @ChkStack() {
ret void
}
/* Variables and functions */
unsigned int norm_shift_amt_U_and_non_U(int /*<<< orphan*/, int);
unsigned int _lmbd(unsigned int src1, unsigned int src2) {
  return norm_shift_amt_U_and_non_U(0, (((int)(src1 << 31)) >> 31) ^ (~src2));
}


x86 assembly (clang, -O0):
<_lmbd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
shl    $0x1f,%esi
sar    $0x1f,%esi
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
xor    %eax,%esi
xor    %edi,%edi
call   1030 <norm_shift_amt_U_and_non_U@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lmbd>:
and    $0x1,%edi
lea    -0x1(%rdi),%eax
xor    %eax,%esi
xor    %edi,%edi
jmp    1030 <norm_shift_amt_U_and_non_U@plt>

LLVM IR (-O0):
define i32 @_lmbd(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 = shl i32 %5, 31
%7 = ashr i32 %6, 31
%8 = load i32, i32* %4
%9 = xor i32 %8, -1
%10 = xor i32 %7, %9
%11 = call i32 @norm_shift_amt_U_and_non_U(i32 0, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @_lmbd(i32 %0, i32 %1) {
%3 = and i32 %0, 1
%4 = add nsw i32 %3, -1
%5 = xor i32 %4, %1
%6 = tail call i32 @norm_shift_amt_U_and_non_U(i32 0, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void gamepad_die(char *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<gamepad_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<gamepad_die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @gamepad_die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @gamepad_die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int sysapi_get_arch();
int sysapi_is_arch_32bit(void) { return (sysapi_get_arch() == 2); }


x86 assembly (clang, -O0):
<sysapi_is_arch_32bit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sysapi_get_arch@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sysapi_is_arch_32bit() {
%1 = call i32 (...) @sysapi_get_arch()
%2 = icmp eq i32 %1, 2
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @sysapi_is_arch_32bit() {
%1 = tail call i32 (...) @sysapi_get_arch()
%2 = icmp eq i32 %1, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int f184(int *);
int f185(int *p) { return f184(p); }


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

x86 assembly (clang, -O2):
<f185>:
jmp    1030 <f184@plt>

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

LLVM IR (-O2):
define i32 @f185(i32* %0) {
%2 = tail call i32 @f184(i32* %0)
ret i32 %2
}
/* Variables and functions */
int sin(int);
double d(double t, double y) { return 1 / t / t * (sin(2 * t) - 2 * t * y); }


x86 assembly (clang, -O0):
<d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xede(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xebf(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movsd  -0x18(%rbp),%xmm0
cvtsi2sd %eax,%xmm2
movsd  0xea0(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm3
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  0xede(%rip),%xmm1
divsd  %xmm0,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
addsd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  (%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
subsd  %xmm1,%xmm0
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @d(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 = fdiv double 1.000000e+00, %5
%7 = load double, double* %3
%8 = fdiv double %6, %7
%9 = load double, double* %3
%10 = fmul double 2.000000e+00, %9
%11 = fptosi double %10 to i32
%12 = call i32 @sin(i32 %11)
%13 = sitofp i32 %12 to double
%14 = load double, double* %3
%15 = fmul double 2.000000e+00, %14
%16 = load double, double* %4
%17 = fneg double %15
%18 = call double @llvm.fmuladd.f64(double %17, double %16, double %13)
%19 = fmul double %8, %18
ret double %19
}

LLVM IR (-O2):
define double @d(double %0, double %1) {
%3 = fdiv double 1.000000e+00, %0
%4 = fdiv double %3, %0
%5 = fmul double %0, 2.000000e+00
%6 = fptosi double %5 to i32
%7 = tail call i32 @sin(i32 %6)
%8 = sitofp i32 %7 to double
%9 = fneg double %5
%10 = tail call double @llvm.fmuladd.f64(double %9, double %1, double %8)
%11 = fmul double %4, %10
ret double %11
}
/* Type definitions */
struct p_lastlog {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ getllent();
struct p_lastlog *ll2p(int /*<<< orphan*/);
extern struct p_lastlog *p_getllent(void) { return ll2p(getllent()); }


x86 assembly (clang, -O0):
<p_getllent>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getllent@plt>
mov    %eax,%edi
call   1030 <ll2p@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_getllent>:
push   %rax
xor    %eax,%eax
call   1040 <getllent@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <ll2p@plt>

LLVM IR (-O0):
%struct.p_lastlog = type { i32 }
define %struct.p_lastlog* @p_getllent() {
%1 = call i32 (...) @getllent()
%2 = call %struct.p_lastlog* @ll2p(i32 %1)
ret %struct.p_lastlog* %2
}

LLVM IR (-O2):
%struct.p_lastlog = type { i32 }
define %struct.p_lastlog* @p_getllent() {
%1 = tail call i32 (...) @getllent()
%2 = tail call %struct.p_lastlog* @ll2p(i32 %1)
ret %struct.p_lastlog* %2
}
/* Variables and functions */
int strcmp(char *, char *);
int main(int argc, char **argv) {
  if (argc != 3)
    return 1;
  return strcmp(argv[1], argv[2]);
}


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)
cmpl   $0x3,-0x8(%rbp)
je     113c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1154 <main+0x44>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x3,%edi
jne    1122 <main+0x12>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
jmp    1030 <strcmp@plt>
mov    $0x1,%eax
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 = load i32, i32* %4
%7 = icmp ne i32 %6, 3
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %17
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 2
%15 = load i8*, i8** %14
%16 = call i32 @strcmp(i8* %12, i8* %15)
store i32 %16, i32* %3
br label %17
17: ; preds = %9, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(1) %8)
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ %9, %4 ], [ 1, %2 ]
ret i32 %11
}
int intCmp(const void *s1, const void *s2) {
  int *ip1 = (int *)s1;
  int *ip2 = (int *)s2;
  return *ip1 - *ip2;
}


x86 assembly (clang, -O0):
<intCmp>:
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,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intCmp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @intCmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @intCmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
void yy_1_BlockContent(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_BlockContent(i8* nocapture %0, i32 %1) {
ret void
}
void gp2x_setgamma(int gamma) {}


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

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

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

LLVM IR (-O2):
define void @gp2x_setgamma(i32 %0) {
ret void
}
int inside(float a, float lo, float hi) { return (lo < a) && (a < hi); }


x86 assembly (clang, -O0):
<inside>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
xor    %eax,%eax
ucomiss %xmm1,%xmm0
mov    %al,-0xd(%rbp)
jbe    113e <inside+0x3e>
movss  -0x4(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inside>:
ucomiss %xmm1,%xmm0
seta   %al
ucomiss %xmm0,%xmm2
seta   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @inside(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* %4
%9 = fcmp olt float %7, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load float, float* %4
%12 = load float, float* %6
%13 = fcmp olt float %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ false, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @inside(float %0, float %1, float %2) {
%4 = fcmp olt float %1, %0
%5 = fcmp olt float %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
void __attribute__((weak)) nacl_post_syscall_hook() {}


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

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

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

LLVM IR (-O2):
define weak void @nacl_post_syscall_hook() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ readFile(char *);
void showConditions(void) { readFile("LICENSE.md"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"LICENSE.md\00"
define void @showConditions() {
%1 = call i32 @readFile(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"LICENSE.md\00"
define void @showConditions() {
%1 = tail call i32 @readFile(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_N16_swap(char *, int, int);
void U_WMRSETSTRETCHBLTMODE_swap(char *record, int torev) {
  U_WMRCORE_N16_swap(record, 1, torev);
}


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

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

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

LLVM IR (-O2):
define void @U_WMRSETSTRETCHBLTMODE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_N16_swap(i8* %0, i32 1, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430TimerP__0__Timer__overflow();
void Msp430TimerP__0__Overflow__fired(void) {
  Msp430TimerP__0__Timer__overflow();
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @XtCvtStringToPixel() {
ret void
}
void TimerHalWaitForL3SClockBeingActive(void) {
  while (!((*((volatile unsigned int *)(((0x44E00000) + 0) + (0x4)))) &
           (0x00000008u)))
    ;
}


x86 assembly (clang, -O0):
<TimerHalWaitForL3SClockBeingActive>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <TimerHalWaitForL3SClockBeingActive+0x9>
mov    $0x44e00004,%eax
mov    (%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1128 <TimerHalWaitForL3SClockBeingActive+0x28>
jmp    112d <TimerHalWaitForL3SClockBeingActive+0x2d>
jmp    1109 <TimerHalWaitForL3SClockBeingActive+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerHalWaitForL3SClockBeingActive>:
testl  $0x8,0x44e00004
je     1100 <TimerHalWaitForL3SClockBeingActive>
ret

LLVM IR (-O0):
define void @TimerHalWaitForL3SClockBeingActive() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i32, i32* inttoptr (i64 1155530756 to i32*)
%3 = and i32 %2, 8
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @TimerHalWaitForL3SClockBeingActive() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 1155530756 to i32*)
%3 = and i32 %2, 8
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sections();
int /*<<< orphan*/ sections_static();
int main(int argc, char **argv) {
  sections();
  sections_static();
  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 <sections@plt>
mov    $0x0,%al
call   1040 <sections_static@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <sections@plt>
xor    %eax,%eax
call   1040 <sections_static@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 (...) @sections()
%7 = call i32 (...) @sections_static()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sections()
%4 = tail call i32 (...) @sections_static()
ret i32 0
}
/* Variables and functions */
int foo1();
int bar1() { return foo1(); }


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

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

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

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

/* Variables and functions */
int _footsize(uint8_t *ptr, int max) {
  (void)ptr;
  (void)max;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @_footsize(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
ret i32 0
}

LLVM IR (-O2):
define i32 @_footsize(i32* nocapture readnone %0, i32 %1) {
ret i32 0
}
void gdk_region_union() {}


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

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

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

LLVM IR (-O2):
define void @gdk_region_union() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rtnl_shlock_nowait();
int rtnl_trylock(void) { return !rtnl_shlock_nowait(); }


x86 assembly (clang, -O0):
<rtnl_trylock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rtnl_shlock_nowait@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtnl_trylock>:
push   %rax
xor    %eax,%eax
call   1030 <rtnl_shlock_nowait@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rtnl_trylock() {
%1 = call i32 (...) @rtnl_shlock_nowait()
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @rtnl_trylock() {
%1 = tail call i32 (...) @rtnl_shlock_nowait()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}