xunge/DecIR huggingface dataset:
int higher(int a, int b) { return (a > b) ? a : b; }


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

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

LLVM IR (-O0):
define i32 @higher(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @higher(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int _f(int, int /*<<< orphan*/, double const, double const *);
double _J_11(const double omega, const double vertices_omegas[4]) {
  return _f(1, 0, omega, vertices_omegas) / 4;
}


x86 assembly (clang, -O0):
<_J_11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <_f@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_J_11>:
push   %rax
mov    %rdi,%rdx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <_f@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x2,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @_J_11(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 = load double*, double** %4
%7 = call i32 @_f(i32 1, i32 0, double %5, double* %6)
%8 = sdiv i32 %7, 4
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @_J_11(double %0, double* %1) {
%3 = tail call i32 @_f(i32 1, i32 0, double %0, double* %1)
%4 = sdiv i32 %3, 4
%5 = sitofp i32 %4 to double
ret double %5
}
void XdmcpUnwrap(unsigned char *output, int k) {
  int i;
  unsigned char blocks[2][8];
  k = (k == 0) ? 1 : 0;
  for (i = 0; i < 8; i++)
    output[i] = blocks[k][i];
}


x86 assembly (clang, -O0):
<XdmcpUnwrap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    115e <XdmcpUnwrap+0x5e>
movslq -0xc(%rbp),%rcx
lea    -0x20(%rbp),%rax
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1125 <XdmcpUnwrap+0x25>
pop    %rbp
ret

x86 assembly (clang, -O2):
<XdmcpUnwrap>:
xor    %eax,%eax
test   %esi,%esi
sete   %al
mov    -0x18(%rsp,%rax,8),%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @XdmcpUnwrap(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca [2 x [8 x i8]]
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
store i32 %10, i32* %4
store i32 0, i32* %5
br label %11
11: ; preds = %26, %2
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 8
br i1 %13, label %14, label %29
14: ; preds = %11
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [2 x [8 x i8]], [2 x [8 x i8]]* %6, i64 0, i64 %16
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [8 x i8], [8 x i8]* %17, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = load i8*, i8** %3
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
store i8 %21, i8* %25
br label %26
26: ; preds = %14
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %11
29: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @XdmcpUnwrap(i8* nocapture writeonly %0, i32 %1) {
%3 = alloca [2 x [8 x i8]]
%4 = getelementptr inbounds [2 x [8 x i8]], [2 x [8 x i8]]* %3, i64 0, i64 0, i64 0
%5 = icmp eq i32 %1, 0
%6 = zext i1 %5 to i64
%7 = getelementptr [2 x [8 x i8]], [2 x [8 x i8]]* %3, i64 0, i64 %6, i64 0
%8 = bitcast i8* %7 to i64*
%9 = bitcast i8* %0 to i64*
%10 = load i64, i64* %8
store i64 %10, i64* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *integerToString(unsigned long);
int /*<<< orphan*/ replace(char **, char const *, char *);
void replaceWithInteger(char **where, const char *what,
                        unsigned long int with) {
  char *replacement = integerToString(with);
  replace(where, what, replacement);
  free(replacement);
}


x86 assembly (clang, -O0):
<replaceWithInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <integerToString@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1050 <replace@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replaceWithInteger>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1040 <integerToString@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1050 <replace@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @replaceWithInteger(i8** %0, i8* %1, i64 %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = call i8* @integerToString(i64 %8)
store i8* %9, i8** %7
%10 = load i8**, i8*** %4
%11 = load i8*, i8** %5
%12 = load i8*, i8** %7
%13 = call i32 @replace(i8** %10, i8* %11, i8* %12)
%14 = load i8*, i8** %7
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
define void @replaceWithInteger(i8** %0, i8* %1, i64 %2) {
%4 = tail call i8* @integerToString(i64 %2)
%5 = tail call i32 @replace(i8** %0, i8* %1, i8* %4)
%6 = tail call i32 @free(i8* %4)
ret void
}
void gtk_about_dialog_get_license() {}


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

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

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

LLVM IR (-O2):
define void @gtk_about_dialog_get_license() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int stringToInt(char *, int);
int main() {
  char *test = "FFFF";
  int base = 16;
  printf("The base %d conversion is %d\n", base, stringToInt(test, base));
  printf("The base %d conversion is %d\n", 2,
         stringToInt("1111111111111111", 2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x10,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <stringToInt@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
mov    $0x2,%esi
call   1040 <stringToInt@plt>
mov    %eax,%edx
lea    0xe87(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
mov    $0x10,%esi
call   1040 <stringToInt@plt>
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
mov    %eax,%edx
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x2,%esi
call   1040 <stringToInt@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"FFFF\00"
@.str.1 = [30 x i8] c"The base %d conversion is %d\0A\00"
@.str.2 = [17 x i8] c"1111111111111111\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
store i32 16, i32* %3
%4 = load i32, i32* %3
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = call i32 @stringToInt(i8* %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %7)
%9 = call i32 @stringToInt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 2)
%10 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"FFFF\00"
@.str.1 = [30 x i8] c"The base %d conversion is %d\0A\00"
@.str.2 = [17 x i8] c"1111111111111111\00"
define i32 @main() {
%1 = tail call i32 @stringToInt(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 16)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 16, i32 %1)
%3 = tail call i32 @stringToInt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 %3)
ret i32 0
}
void rop3_250_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = *D | T;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_250_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_250_0_0>:
or     %dl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_250_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %2
store i8 %5, i8* %0
ret void
}
/* Variables and functions */
int findComplement(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char **argv) {
  int number;
  printf("Give me a number: ");
  scanf("%d", &number);
  int complement = findComplement(number);
  printf("The complement is %d\n", complement);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1040 <findComplement@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <findComplement@plt>
lea    0xeb6(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Give me a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"The complement is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%10 = load i32, i32* %6
%11 = call i32 @findComplement(i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Give me a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"The complement is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @findComplement(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void write32_le(uint32_t v, uint8_t buf[4]) {
  *buf++ = v & 0xff;
  *buf++ = (v >> 8) & 0xff;
  *buf++ = (v >> 16) & 0xff;
  *buf = (v >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<write32_le>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write32_le>:
mov    %edi,%eax
movzbl %al,%ecx
mov    %ecx,(%rsi)
movzbl %ah,%ecx
mov    %ecx,0x4(%rsi)
mov    %edi,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %ecx,0x8(%rsi)
shr    $0x18,%eax
mov    %eax,0xc(%rsi)
ret

LLVM IR (-O0):
define void @write32_le(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 = and i32 %5, 255
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i32 1
store i32* %8, i32** %4
store i32 %6, i32* %7
%9 = load i32, i32* %3
%10 = ashr i32 %9, 8
%11 = and i32 %10, 255
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i32 1
store i32* %13, i32** %4
store i32 %11, i32* %12
%14 = load i32, i32* %3
%15 = ashr i32 %14, 16
%16 = and i32 %15, 255
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i32 1
store i32* %18, i32** %4
store i32 %16, i32* %17
%19 = load i32, i32* %3
%20 = ashr i32 %19, 24
%21 = and i32 %20, 255
%22 = load i32*, i32** %4
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @write32_le(i32 %0, i32* nocapture writeonly %1) {
%3 = and i32 %0, 255
%4 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %3, i32* %1
%5 = lshr i32 %0, 8
%6 = and i32 %5, 255
%7 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %6, i32* %4
%8 = lshr i32 %0, 16
%9 = and i32 %8, 255
%10 = getelementptr inbounds i32, i32* %1, i64 3
store i32 %9, i32* %7
%11 = lshr i32 %0, 24
store i32 %11, i32* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  fork();
  fork();
  puts("labas as krabas.");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    $0x0,%al
call   1040 <fork@plt>
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"labas as krabas.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @fork()
%6 = call i32 (...) @fork()
%7 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"labas as krabas.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @fork()
%4 = tail call i32 (...) @fork()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int af_fmt2bits(int format) {
  if ((((format) & (7 << 6)) == (4 << 6)))
    return 16;
  return (format & (7 << 3)) + 8;
  return -1;
}


x86 assembly (clang, -O0):
<af_fmt2bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1c0,%eax
cmp    $0x100,%eax
jne    1126 <af_fmt2bits+0x26>
movl   $0x10,-0x4(%rbp)
jmp    1132 <af_fmt2bits+0x32>
mov    -0x8(%rbp),%eax
and    $0x38,%eax
add    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<af_fmt2bits>:
mov    %edi,%eax
and    $0x1c0,%eax
and    $0x38,%edi
lea    0x8(%rdi),%ecx
cmp    $0x100,%eax
mov    $0x10,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @af_fmt2bits(i32 %0) {
%2 = and i32 %0, 448
%3 = icmp eq i32 %2, 256
%4 = and i32 %0, 56
%5 = add nuw nsw i32 %4, 8
%6 = select i1 %3, i32 16, i32 %5
ret i32 %6
}
int gcd(int x, int y) {
  int remainder;
  while (y != 0) {
    remainder = x % y;
    x = y;
    y = remainder;
  }
  return x;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <gcd+0x2f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
int isnan(x)
double x;
{ return (0); }


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

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

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

LLVM IR (-O2):
define i32 @isnan(double %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int test(int i, ...) {
  float f = (float)i;
  if (f != f)
    abort();
  return 2;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    113f <test+0x2f>
jp     113f <test+0x2f>
jmp    1146 <test+0x36>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x2,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test(i32 %0, ...) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to float
store float %5, float* %3
%6 = load float, float* %3
%7 = load float, float* %3
%8 = fcmp une float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %1
ret i32 2
}

LLVM IR (-O2):
define i32 @test(i32 %0, ...) {
ret i32 2
}
void inchalUnit2ASCII(char c) {}


x86 assembly (clang, -O0):
<inchalUnit2ASCII>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @inchalUnit2ASCII(i8 signext %0) {
ret void
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  int x;
  int r = rand();
  if (!(r < 0)) {
    x = 42;
  } else {
    x = 7;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     1146 <main+0x36>
movl   $0x2a,-0x14(%rbp)
jmp    114d <main+0x3d>
movl   $0x7,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
test   %eax,%eax
mov    $0x7,%ecx
mov    $0x2a,%eax
cmovs  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 7, i32 42
ret i32 %5
}
int loader_native_verify(const char *name, char *buffer, unsigned len) {
  return 2;
}


x86 assembly (clang, -O0):
<loader_native_verify>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x2,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @loader_native_verify(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 2
}
signed int rt_cond_destroy(union anon$42 *cvp) {
  signed int status = 0;
  status = pthread_cond_destroy(cvp);
  return status;
}


x86 assembly (clang, -O0):
<rt_cond_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <pthread_cond_destroy@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%"union.anon$42" = type opaque
define i32 @rt_cond_destroy(%"union.anon$42"* %0) {
%2 = alloca %"union.anon$42"*
%3 = alloca i32
store %"union.anon$42"* %0, %"union.anon$42"** %2
store i32 0, i32* %3
%4 = load %"union.anon$42"*, %"union.anon$42"** %2
%5 = call i32 (%"union.anon$42"*, ...) bitcast (i32 (...)* @pthread_cond_destroy to i32 (%"union.anon$42"*, ...)*)(%"union.anon$42"* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%"union.anon$42" = type opaque
define i32 @rt_cond_destroy(%"union.anon$42"* %0) {
%2 = tail call i32 (%"union.anon$42"*, ...) bitcast (i32 (...)* @pthread_cond_destroy to i32 (%"union.anon$42"*, ...)*)(%"union.anon$42"* %0)
ret i32 %2
}
int zserver_start() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @zserver_start() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ run_program();
int main(int argc, const char *argv[]) {
  run_program();
  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 <run_program@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @run_program()
ret i32 0
}
/* Type definitions */
struct hashMap {
  int dummy;
};

/* Variables and functions */
int capacity(struct hashMap *);
int size(struct hashMap *);
float tableLoad(struct hashMap *ht) {
  int numLinks = size(ht);
  int numBuckets = capacity(ht);
  if (numBuckets == 0)
    return 0;
  return ((float)numLinks / (float)numBuckets);
}


x86 assembly (clang, -O0):
<tableLoad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <size@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <capacity@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    115b <tableLoad+0x3b>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    116e <tableLoad+0x4e>
cvtsi2ssl -0x14(%rbp),%xmm0
cvtsi2ssl -0x18(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tableLoad>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <size@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <capacity@plt>
test   %eax,%eax
je     1147 <tableLoad+0x27>
cvtsi2ss %ebp,%xmm0
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
jmp    114a <tableLoad+0x2a>
xorps  %xmm0,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.hashMap = type { i32 }
define float @tableLoad(%struct.hashMap* %0) {
%2 = alloca float
%3 = alloca %struct.hashMap*
%4 = alloca i32
%5 = alloca i32
store %struct.hashMap* %0, %struct.hashMap** %3
%6 = load %struct.hashMap*, %struct.hashMap** %3
%7 = call i32 @size(%struct.hashMap* %6)
store i32 %7, i32* %4
%8 = load %struct.hashMap*, %struct.hashMap** %3
%9 = call i32 @capacity(%struct.hashMap* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %1
store float 0.000000e+00, float* %2
br label %19
13: ; preds = %1
%14 = load i32, i32* %4
%15 = sitofp i32 %14 to float
%16 = load i32, i32* %5
%17 = sitofp i32 %16 to float
%18 = fdiv float %15, %17
store float %18, float* %2
br label %19
19: ; preds = %13, %12
%20 = load float, float* %2
ret float %20
}

LLVM IR (-O2):
%struct.hashMap = type { i32 }
define float @tableLoad(%struct.hashMap* %0) {
%2 = tail call i32 @size(%struct.hashMap* %0)
%3 = tail call i32 @capacity(%struct.hashMap* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = sitofp i32 %2 to float
%7 = sitofp i32 %3 to float
%8 = fdiv float %6, %7
br label %9
9: ; preds = %1, %5
%10 = phi float [ %8, %5 ], [ 0.000000e+00, %1 ]
ret float %10
}
int write_xfd_file(char *fimage, char *file) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @write_xfd_file(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int get_ori(int i) {
  int val = 0;
  if (i < 0)
    val = (4 + i) % 4;
  else
    val = i % 4;
  return val;
}


x86 assembly (clang, -O0):
<get_ori>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112e <get_ori+0x2e>
mov    -0x4(%rbp),%eax
add    $0x4,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
jmp    113c <get_ori+0x3c>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ori>:
lea    0x4(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffffc,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_ori(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = add nsw i32 %0, 4
%4 = select i1 %2, i32 %3, i32 %0
%5 = srem i32 %4, 4
ret i32 %5
}
void do_ord(void) {}


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

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

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

LLVM IR (-O2):
define void @do_ord() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ printf(char *, char *);
void *my_malloc_2(size_t bytes, char *word) {
  void *ptr = malloc(bytes);
  if (ptr == NULL) {
    printf("Error: could not allocate memory for %s !\n", word);
    exit(1);
  } else {
    return ptr;
  }
}


x86 assembly (clang, -O0):
<my_malloc_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1172 <my_malloc_2+0x42>
mov    -0x10(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc_2>:
push   %rbx
mov    %rsi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <my_malloc_2+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Error: could not allocate memory for %s !\0A\00"
define i8* @my_malloc_2(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = load i64, i64* %3
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [43 x i8] c"Error: could not allocate memory for %s !\0A\00"
define noalias i8* @my_malloc_2(i64 %0, i8* %1) {
%3 = tail call i8* @malloc(i64 %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a = 4;
  printf("%6d%6d\n", a, a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xecd(%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
mov    $0x4,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%6d%6d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 4, i32 4)
ret i32 0
}
int test_imm_E5int8_mem(signed char *val) {
  return ((*val) & (-0xE5 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E5int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff1b,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E5int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -229
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ echo_test(char *);
int main(int argc, char *argv[]) {
  echo_test(argv[1]);
  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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <echo_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <echo_test@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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @echo_test(i8* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @echo_test(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void Fnc() {
  int i, j, k;
  int Sum = 0;
  for (i = 0; i < 10; i++) {
    Sum += i;
  }
  printf("%d\n", Sum);
}


x86 assembly (clang, -O0):
<Fnc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1147 <Fnc+0x37>
mov    -0x4(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <Fnc+0x16>
mov    -0x10(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fnc>:
lea    0xee9(%rip),%rdi
mov    $0x2d,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @Fnc() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 45)
ret void
}
void audio_close() {}


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

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

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

LLVM IR (-O2):
define void @audio_close() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PWM1_1_DriverIRQHandler();
__attribute__((weak)) void PWM1_1_IRQHandler(void) {
  PWM1_1_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @PWM1_1_IRQHandler() {
%1 = call i32 (...) @PWM1_1_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @PWM1_1_IRQHandler() {
%1 = tail call i32 (...) @PWM1_1_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *ft_strjoinnchar(char *, int, char);
char *ft_strfjoinnchar(char *s, int n, char c) {
  char *new;
  new = ft_strjoinnchar(s, n, c);
  free(s);
  return (new);
}


x86 assembly (clang, -O0):
<ft_strfjoinnchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movsbl -0xd(%rbp),%edx
call   1040 <ft_strjoinnchar@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strfjoinnchar>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <ft_strjoinnchar@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_strfjoinnchar(i8* %0, i32 %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i8, i8* %6
%11 = call i8* @ft_strjoinnchar(i8* %8, i32 %9, i8 signext %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %4
%13 = call i32 @free(i8* %12)
%14 = load i8*, i8** %7
ret i8* %14
}

LLVM IR (-O2):
define i8* @ft_strfjoinnchar(i8* %0, i32 %1, i8 signext %2) {
%4 = tail call i8* @ft_strjoinnchar(i8* %0, i32 %1, i8 signext %2)
%5 = tail call i32 @free(i8* %0)
ret i8* %4
}
int imparPar(int n1) {
  if (n1 % 2 == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imparPar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <imparPar+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <imparPar+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imparPar>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @imparPar(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Variables and functions */
double bilinear_interpolation(double, double);
double get_alphaN_table(double RPM, double load) {
  return bilinear_interpolation(RPM, load);
}


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

x86 assembly (clang, -O2):
<get_alphaN_table>:
jmp    1030 <bilinear_interpolation@plt>

LLVM IR (-O0):
define double @get_alphaN_table(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 = load double, double* %4
%7 = call double @bilinear_interpolation(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @get_alphaN_table(double %0, double %1) {
%3 = tail call double @bilinear_interpolation(double %0, double %1)
ret double %3
}
/* Type definitions */
struct bitstream {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct bitstream *);
void free_bitstream(struct bitstream *bs) { free(bs); }


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

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

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

LLVM IR (-O2):
%struct.bitstream = type { i32 }
define void @free_bitstream(%struct.bitstream* nocapture %0) {
%2 = tail call i32 @free(%struct.bitstream* %0)
ret void
}
void Interp10(unsigned char *pc, int c1, int c2, int c3) {
  c1 &= 0xf0f0f0;
  c2 &= 0xf0f0f0;
  c3 &= 0xf0f0f0;
  *((int *)pc) = (c1 * 14 + c2 + c3) >> 4;
}


x86 assembly (clang, -O0):
<Interp10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
and    $0xf0f0f0,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
and    $0xf0f0f0,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
and    $0xf0f0f0,%eax
mov    %eax,-0x14(%rbp)
imul   $0xe,-0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
add    -0x14(%rbp),%ecx
sar    $0x4,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp10>:
and    $0xf0f0f0,%esi
and    $0xf0f0f0,%edx
and    $0xf0f0f0,%ecx
mov    %esi,%eax
shl    $0x4,%eax
sub    %esi,%eax
sub    %esi,%eax
add    %edx,%eax
add    %ecx,%eax
shr    $0x4,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @Interp10(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = and i32 %9, 15790320
store i32 %10, i32* %6
%11 = load i32, i32* %7
%12 = and i32 %11, 15790320
store i32 %12, i32* %7
%13 = load i32, i32* %8
%14 = and i32 %13, 15790320
store i32 %14, i32* %8
%15 = load i32, i32* %6
%16 = mul nsw i32 %15, 14
%17 = load i32, i32* %7
%18 = add nsw i32 %16, %17
%19 = load i32, i32* %8
%20 = add nsw i32 %18, %19
%21 = ashr i32 %20, 4
%22 = load i8*, i8** %5
%23 = bitcast i8* %22 to i32*
store i32 %21, i32* %23
ret void
}

LLVM IR (-O2):
define void @Interp10(i8* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %1, 15790320
%6 = and i32 %2, 15790320
%7 = and i32 %3, 15790320
%8 = mul nuw nsw i32 %5, 14
%9 = add nuw nsw i32 %8, %6
%10 = add nuw nsw i32 %9, %7
%11 = lshr exact i32 %10, 4
%12 = bitcast i8* %0 to i32*
store i32 %11, i32* %12
ret void
}
int calc(int a, int b, char op) {
  int (*s_fp)(int, int) = s_calc_func(op);
  if (s_fp)
    return s_fp(a, b);
  else
    return -1;
}


x86 assembly (clang, -O0):
<calc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%edi
mov    $0x0,%al
call   1030 <s_calc_func@plt>
cltq
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1153 <calc+0x43>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   *%rax
mov    %eax,-0x4(%rbp)
jmp    115a <calc+0x4a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,%edi
xor    %eax,%eax
call   1030 <s_calc_func@plt>
test   %eax,%eax
je     1132 <calc+0x22>
cltq
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    *%rax
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @calc(i32 %0, i32 %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = alloca i32 (i32, i32)*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8 %2, i8* %7
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = call i32 (i32, ...) bitcast (i32 (...)* @s_calc_func to i32 (i32, ...)*)(i32 %10)
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32 (i32, i32)*
store i32 (i32, i32)* %13, i32 (i32, i32)** %8
%14 = load i32 (i32, i32)*, i32 (i32, i32)** %8
%15 = icmp ne i32 (i32, i32)* %14, null
br i1 %15, label %16, label %21
16: ; preds = %3
%17 = load i32 (i32, i32)*, i32 (i32, i32)** %8
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = call i32 %17(i32 %18, i32 %19)
store i32 %20, i32* %4
br label %22
21: ; preds = %3
store i32 -1, i32* %4
br label %22
22: ; preds = %21, %16
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @calc(i32 %0, i32 %1, i8 signext %2) {
%4 = sext i8 %2 to i32
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @s_calc_func to i32 (i32, ...)*)(i32 %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = sext i32 %5 to i64
%9 = inttoptr i64 %8 to i32 (i32, i32)*
%10 = tail call i32 %9(i32 %0, i32 %1)
br label %11
11: ; preds = %3, %7
%12 = phi i32 [ %10, %7 ], [ -1, %3 ]
ret i32 %12
}
unsigned short RdFwVr_lc898122(void) {
  unsigned short UsVerVal;
  UsVerVal = (unsigned short)((0x07 << 8) | 0x01);
  return (UsVerVal);
}


x86 assembly (clang, -O0):
<RdFwVr_lc898122>:
push   %rbp
mov    %rsp,%rbp
movw   $0x701,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RdFwVr_lc898122>:
mov    $0x701,%ax
ret

LLVM IR (-O0):
define zeroext i16 @RdFwVr_lc898122() {
%1 = alloca i16
store i16 1793, i16* %1
%2 = load i16, i16* %1
ret i16 %2
}

LLVM IR (-O2):
define zeroext i16 @RdFwVr_lc898122() {
ret i16 1793
}