xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ print(char *);
main() {
  print("첫");
  print("두");
  print("세");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <print@plt>
lea    0xedd(%rip),%rdi
call   1030 <print@plt>
lea    0xed5(%rip),%rdi
call   1030 <print@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"\EC\B2\AB\00"
@.str.1 = [4 x i8] c"\EB\91\90\00"
@.str.2 = [4 x i8] c"\EC\84\B8\00"
define i32 @main() {
%1 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"\EC\B2\AB\00"
@.str.1 = [4 x i8] c"\EB\91\90\00"
@.str.2 = [4 x i8] c"\EC\84\B8\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
double d2ll2d(double d) { return (double)(long long)d; }


x86 assembly (clang, -O0):
<d2ll2d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2ll2d>:
cvttsd2si %xmm0,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
ret

LLVM IR (-O0):
define double @d2ll2d(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i64
%5 = sitofp i64 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @d2ll2d(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
ret double %3
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void SHA2IntClear(uint32_t intFlags) {

  ;
  (*((volatile unsigned long *)(0x40024000 + 0x00000788))) = intFlags;
}


x86 assembly (clang, -O0):
<SHA2IntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x40024788,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA2IntClear>:
mov    %rdi,0x40024788
40
ret

LLVM IR (-O0):
define void @SHA2IntClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1073891208 to i64*)
ret void
}

LLVM IR (-O2):
define void @SHA2IntClear(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1073891208 to i64*)
ret void
}
void initdisplay(void) {}


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

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

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

LLVM IR (-O2):
define void @initdisplay() {
ret void
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *, int *);
int main() {
  int a, b;
  while (scanf("%d%d", &a, &b) != EOF) {
    printf("%d\n", a + b);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%rax
je     116a <main+0x4a>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x2e9e(%rip),%r13
cmp    0x0(%r13),%rax
je     1194 <main+0x74>
lea    0xeae(%rip),%r14
lea    0xea2(%rip),%r15
lea    0xc(%rsp),%r12
lea    0x8(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsp),%esi
add    0xc(%rsp),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
cmp    0x0(%r13),%rax
jne    1170 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %16, label %8
8: ; preds = %0, %8
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %9
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%14 = load i64, i64* @EOF
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %8
16: ; preds = %8, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ loop();
int /*<<< orphan*/ platform_init();
int /*<<< orphan*/ setup();
void main() {
  platform_init();
  setup();
  while (1) {
    loop();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <platform_init@plt>
mov    $0x0,%al
call   1050 <setup@plt>
mov    $0x0,%al
call   1040 <loop@plt>
jmp    1142 <main+0x12>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <platform_init@plt>
xor    %eax,%eax
call   1050 <setup@plt>
nop
xor    %eax,%eax
call   1040 <loop@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @platform_init()
%2 = call i32 (...) @setup()
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @loop()
br label %3
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @platform_init()
%2 = tail call i32 (...) @setup()
br label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @loop()
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ file_to_string(char const *);
int process_program(int /*<<< orphan*/);
int main(int argc, const char *argv[]) {
  return process_program(file_to_string(argv[1]));
}


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   1040 <file_to_string@plt>
mov    %eax,%edi
call   1030 <process_program@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <file_to_string@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <process_program@plt>

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 @file_to_string(i8* %8)
%10 = call i32 @process_program(i32 %9)
ret i32 %10
}

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 @file_to_string(i8* %4)
%6 = tail call i32 @process_program(i32 %5)
ret i32 %6
}
void foo697() {}


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

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

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

LLVM IR (-O2):
define void @foo697() {
ret void
}
/* Variables and functions */
int cd_reset_selector(int /*<<< orphan*/, int);
int cd_reset_selector_one(int sel_num) { return cd_reset_selector(0, sel_num); }


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

x86 assembly (clang, -O2):
<cd_reset_selector_one>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <cd_reset_selector@plt>

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

LLVM IR (-O2):
define i32 @cd_reset_selector_one(i32 %0) {
%2 = tail call i32 @cd_reset_selector(i32 0, i32 %0)
ret i32 %2
}
/* Type definitions */
struct target_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct target_data *);
void target_data_free(struct target_data *td) { free(td); }


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

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

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

LLVM IR (-O2):
%struct.target_data = type { i32 }
define void @target_data_free(%struct.target_data* nocapture %0) {
%2 = tail call i32 @free(%struct.target_data* %0)
ret void
}
/* Variables and functions */
bool isName(char c) {
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_';
}


x86 assembly (clang, -O0):
<isName>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <isName+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    1155 <isName+0x55>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1148 <isName+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    1155 <isName+0x55>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isName>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
cmp    $0x5f,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isName(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %22, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br i1 %17, label %22, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 95
br label %22
22: ; preds = %18, %14, %6
%23 = phi i1 [ true, %14 ], [ true, %6 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isName(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = icmp eq i8 %0, 95
%6 = or i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
__attribute__((no, noclone)) unsigned long long f1(int x) {
  return ((unsigned long long)x) << 4;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
movslq %edi,%rax
shl    $0x4,%rax
ret

LLVM IR (-O0):
define i64 @f1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = shl i64 %4, 4
ret i64 %5
}

LLVM IR (-O2):
define i64 @f1(i32 %0) {
%2 = sext i32 %0 to i64
%3 = shl nsw i64 %2, 4
ret i64 %3
}
int collatz(int x) {
  if (x <= 1) {
    return 0;
  }
  if (x % 2 == 0) {
    return collatz(x / 2) + 1;
  } else {
    return collatz(3 * x + 1) + 1;
  }
}


x86 assembly (clang, -O0):
<collatz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1131 <collatz+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1174 <collatz+0x64>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1162 <collatz+0x52>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <collatz@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <collatz+0x64>
imul   $0x3,-0x8(%rbp),%edi
add    $0x1,%edi
call   1030 <collatz@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<collatz>:
push   %rbx
xor    %ebx,%ebx
cmp    $0x2,%edi
jl     1146 <collatz+0x36>
mov    $0x1,%ebx
nopl   (%rax)
test   $0x1,%dil
jne    1139 <collatz+0x29>
mov    %edi,%eax
shr    %eax
add    $0x1,%ebx
cmp    $0x3,%edi
mov    %eax,%edi
ja     1120 <collatz+0x10>
add    $0xffffffff,%ebx
jmp    1146 <collatz+0x36>
lea    (%rdi,%rdi,2),%edi
add    $0x1,%edi
call   1030 <collatz@plt>
add    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @collatz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %22
7: ; preds = %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i32, i32* %3
%13 = sdiv i32 %12, 2
%14 = call i32 @collatz(i32 %13)
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %22
16: ; preds = %7
%17 = load i32, i32* %3
%18 = mul nsw i32 3, %17
%19 = add nsw i32 %18, 1
%20 = call i32 @collatz(i32 %19)
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %22
22: ; preds = %16, %11, %6
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @collatz(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %12, label %3
3: ; preds = %1, %8
%4 = phi i32 [ %9, %8 ], [ %0, %1 ]
%5 = phi i32 [ %10, %8 ], [ 0, %1 ]
%6 = and i32 %4, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = lshr i32 %4, 1
%10 = add nuw nsw i32 %5, 1
%11 = icmp ult i32 %4, 4
br i1 %11, label %12, label %3
12: ; preds = %8, %1, %14
%13 = phi i32 [ %19, %14 ], [ 0, %1 ], [ %10, %8 ]
ret i32 %13
14: ; preds = %3
%15 = mul nsw i32 %4, 3
%16 = add nsw i32 %15, 1
%17 = tail call i32 @collatz(i32 %16)
%18 = add nuw i32 %5, 1
%19 = add i32 %18, %17
br label %12
}
__attribute__((warning("call to default open_r"))) int
_undef_open_r(struct _reent *r, const char *path, int flags, int mode) {
  return -1;
}


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

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

LLVM IR (-O0):
%struct._reent = type opaque
define i32 @_undef_open_r(%struct._reent* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca %struct._reent*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store %struct._reent* %0, %struct._reent** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 -1
}

LLVM IR (-O2):
%struct._reent = type opaque
define i32 @_undef_open_r(%struct._reent* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
void CopyFile(FILE *infile, FILE *outfile) {
  int ch;
  while ((ch = getc(infile)) != EOF) {
    putc(ch, outfile);
  }
}


x86 assembly (clang, -O0):
<CopyFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    0x2ea5(%rip),%rcx
cmp    (%rcx),%eax
je     115c <CopyFile+0x3c>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
jmp    1130 <CopyFile+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyFile>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <getc@plt>
mov    0x2eb1(%rip),%r15
cmp    (%r15),%eax
je     1157 <CopyFile+0x37>
nopl   0x0(%rax)
mov    %eax,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %rbx,%rdi
call   1040 <getc@plt>
cmp    (%r15),%eax
jne    1140 <CopyFile+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @CopyFile(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 = %11, %2
%7 = load i32*, i32** %3
%8 = call i32 @getc(i32* %7)
store i32 %8, i32* %5
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = load i32, i32* %5
%13 = load i32*, i32** %4
%14 = call i32 @putc(i32 %12, i32* %13)
br label %6
15: ; preds = %6
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @CopyFile(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @getc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %3, %2 ]
%8 = tail call i32 @putc(i32 %7, i32* %1)
%9 = tail call i32 @getc(i32* %0)
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ key;

/* Variables and functions */
scalar_t__ ini_getstr(char **, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
int ini_getstr_default(char **value, char *param) {
  char key[256];
  snprintf(key, (sizeof(key)), "%s:%s", "default", param);
  if (ini_getstr(value, key))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ini_getstr_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x18(%rbp),%r8
mov    $0x100,%esi
lea    0xeb6(%rip),%rdx
lea    0xeb5(%rip),%rcx
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x120(%rbp),%rsi
call   1040 <ini_getstr@plt>
cmp    $0x0,%rax
je     117c <ini_getstr_default+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1183 <ini_getstr_default+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ini_getstr_default>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rsi,%r8
mov    %rdi,%rbx
lea    0xec9(%rip),%rdx
lea    0xec8(%rip),%rcx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x100,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <ini_getstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s:%s\00"
@.str.1 = [8 x i8] c"default\00"
define i32 @ini_getstr_default(i8** %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca [256 x i8]
store i8** %0, i8*** %4
store i8* %1, i8** %5
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%8 = load i8*, i8** %5
%9 = call i32 @snprintf(i8* %7, i32 256, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%12 = call i64 @ini_getstr(i8** %10, i8* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s:%s\00"
@.str.1 = [8 x i8] c"default\00"
define i32 @ini_getstr_default(i8** %0, i8* %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 256, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%6 = call i64 @ini_getstr(i8** %0, i8* %4)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int GetCP0(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i;
  printf("SecMain\n");
  for (i = 0; i < 31; i++) {
    printf("CP0 $%02d = 0x%x\n", i, GetCP0(i));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1f,-0x8(%rbp)
jge    117d <main+0x5d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <GetCP0@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <main+0x24>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeba(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1050 <GetCP0@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x1f,%ebp
jne    1150 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [18 x i8] c"CP0 $%02d = 0x%x\0A\00"
@str = [8 x i8] c"SecMain\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %6, %2 ]
%4 = tail call i32 @GetCP0(i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %4)
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 31
br i1 %7, label %8, label %2
8: ; preds = %2
ret i32 0
}
void simplesocket_unit() {}


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

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

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

LLVM IR (-O2):
define void @simplesocket_unit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int connect_monitor(char *);
int fping_monitor(int);
int ping_monitor(char *devname) {
  int sfd = connect_monitor(devname);
  int err;
  if (sfd >= 0) {
    err = fping_monitor(sfd);
    close(sfd);
  } else
    err = -1;
  return err;
}


x86 assembly (clang, -O0):
<ping_monitor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <connect_monitor@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     116a <ping_monitor+0x3a>
mov    -0xc(%rbp),%edi
call   1040 <fping_monitor@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
jmp    1171 <ping_monitor+0x41>
movl   $0xffffffff,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ping_monitor>:
push   %rbp
push   %rbx
push   %rax
call   1050 <connect_monitor@plt>
test   %eax,%eax
js     1152 <ping_monitor+0x22>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <fping_monitor@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <close@plt>
mov    %ebp,%eax
jmp    1157 <ping_monitor+0x27>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ping_monitor(i8* %0) {
%2 = tail call i32 @connect_monitor(i8* %0)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @fping_monitor(i32 %2)
%6 = tail call i32 @close(i32 %2)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %5, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x8f() {
  Assert_real((isprint(143) == 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_isprint.c",
              720, ("isprint should be 0 for 0x8f"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x8f>:
push   %rax
mov    $0x8f,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2d0,%edx
pop    %rax
jmp    1040 <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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x8f\00"
define void @t_isprint_0x8f() {
%1 = call i64 @isprint(i32 143)
%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 720, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x8f\00"
define void @t_isprint_0x8f() {
%1 = tail call i64 @isprint(i32 143)
%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 720, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void abc1defghijklmnopqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @abc1defghijklmnopqrstuvwxzy() {
ret void
}
/* Variables and functions */
double *malloc(int);
void init_p(double **pp) {
  double *pd = malloc(sizeof(double) * 10);
  pd[0] = 42;
  *pp = pd;
}


x86 assembly (clang, -O0):
<init_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x50,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xeca(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_p>:
push   %rbx
mov    %rdi,%rbx
mov    $0x50,%edi
call   1030 <malloc@plt>
movabs $0x4045000000000000,%rcx
mov    %rcx,(%rax)
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @init_p(double** %0) {
%2 = alloca double**
%3 = alloca double*
store double** %0, double*** %2
%4 = call double* @malloc(i32 80)
store double* %4, double** %3
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
store double 4.200000e+01, double* %6
%7 = load double*, double** %3
%8 = load double**, double*** %2
store double* %7, double** %8
ret void
}

LLVM IR (-O2):
define void @init_p(double** nocapture writeonly %0) {
%2 = tail call double* @malloc(i32 80)
store double 4.200000e+01, double* %2
store double* %2, double** %0
ret void
}
int Problem059(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @Problem059() {
ret i32 1
}

LLVM IR (-O2):
define i32 @Problem059() {
ret i32 1
}
int test_imm_B1int64_highword_reg(long long val) {
  return ((val >> 32) & (0xB1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B1int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0xb1,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B1int64_highword_reg>:
movabs $0xb100000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B1int64_highword_reg(i64 %0) {
%2 = and i64 %0, 760209211392
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, int *, int /*<<< orphan*/, int /*<<< orphan*/);
int ireadk() {
  int ch;
  syscall(0x4963, &ch, 0, 0);
  return ch;
}


x86 assembly (clang, -O0):
<ireadk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4963,%edi
lea    -0x4(%rbp),%rsi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <syscall@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ireadk>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0x4963,%edi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <syscall@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ireadk() {
%1 = alloca i32
%2 = call i32 @syscall(i32 18787, i32* %1, i32 0, i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @ireadk() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @syscall(i32 18787, i32* %1, i32 0, i32 0)
%4 = load i32, i32* %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void *malloc(int /*<<< orphan*/);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int /*<<< orphan*/);
void *xBuffer_cAlloc(uint32_t u32Size) {
  void *pvAlloc = NULL;
  if ((pvAlloc = malloc(u32Size)) == NULL) {
    return NULL;
  }
  memset(pvAlloc, 0, u32Size);
  ;
  return pvAlloc;
}


x86 assembly (clang, -O0):
<xBuffer_cAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1156 <xBuffer_cAlloc+0x36>
movq   $0x0,-0x8(%rbp)
jmp    116c <xBuffer_cAlloc+0x4c>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xBuffer_cAlloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113e <xBuffer_cAlloc+0x1e>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @xBuffer_cAlloc(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* null, i8** %4
%5 = load i32, i32* %3
%6 = call i8* @malloc(i32 %5)
store i8* %6, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* null, i8** %2
br label %14
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = load i32, i32* %3
%12 = call i32 @memset(i8* %10, i32 0, i32 %11)
%13 = load i8*, i8** %4
store i8* %13, i8** %2
br label %14
14: ; preds = %9, %8
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @xBuffer_cAlloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i32 %0)
br label %6
6: ; preds = %1, %4
ret i8* %2
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int ssize_t;

/* Variables and functions */
ssize_t readv(int fd, const struct iovec *v, int veccount) { return -1; }


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

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

LLVM IR (-O0):
%struct.iovec = type { i32 }
define i32 @readv(i32 %0, %struct.iovec* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.iovec*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.iovec* %1, %struct.iovec** %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
define i32 @readv(i32 %0, %struct.iovec* nocapture readnone %1, i32 %2) {
ret i32 -1
}
unsigned char is_biton(unsigned char *bitarray, int item) {
  return ((unsigned char)((bitarray[item / 8] & (1 << (item % 8))) != 0));
}


x86 assembly (clang, -O0):
<is_biton>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
mov    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_biton>:
lea    0x7(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
cltq
movzbl (%rdi,%rax,1),%eax
and    $0x7,%sil
movzbl %sil,%ecx
bt     %ecx,%eax
setb   %al
ret

LLVM IR (-O0):
define zeroext i8 @is_biton(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 = sdiv i32 %6, 8
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i32, i32* %4
%13 = srem i32 %12, 8
%14 = shl i32 1, %13
%15 = and i32 %11, %14
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @is_biton(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %1, 7
%9 = shl nuw nsw i32 1, %8
%10 = and i32 %9, %7
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i8
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/
UpnpResponse_RemoteIOClient_RemoteInput_GetInputSetup(void *, char *);
void UpnpRemoteIOClient_RemoteInput_GetInputSetup(void *upnptoken) {
  UpnpResponse_RemoteIOClient_RemoteInput_GetInputSetup(upnptoken,
                                                        "intel.desktop");
}


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

x86 assembly (clang, -O2):
<UpnpRemoteIOClient_RemoteInput_GetInputSetup>:
lea    0xee9(%rip),%rsi
jmp    1030 <UpnpResponse_RemoteIOClient_RemoteInput_GetInputSetup@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"intel.desktop\00"
define void @UpnpRemoteIOClient_RemoteInput_GetInputSetup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @UpnpResponse_RemoteIOClient_RemoteInput_GetInputSetup(i8* %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"intel.desktop\00"
define void @UpnpRemoteIOClient_RemoteInput_GetInputSetup(i8* %0) {
%2 = tail call i32 @UpnpResponse_RemoteIOClient_RemoteInput_GetInputSetup(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
float multiply(float first, float second) { return first * second; }


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

x86 assembly (clang, -O2):
<multiply>:
mulss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @multiply(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
int is_palindrome_recursive(char *input, int length) {
  if (length <= 1)
    return (1);
  else if (input[0] != input[length - 1])
    return (0);
  else
    return (is_palindrome_recursive(input + 1, length - 2));
}


x86 assembly (clang, -O0):
<is_palindrome_recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jg     1135 <is_palindrome_recursive+0x25>
movl   $0x1,-0x4(%rbp)
jmp    1177 <is_palindrome_recursive+0x67>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1161 <is_palindrome_recursive+0x51>
movl   $0x0,-0x4(%rbp)
jmp    1177 <is_palindrome_recursive+0x67>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x14(%rbp),%esi
sub    $0x2,%esi
call   1030 <is_palindrome_recursive@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_palindrome_recursive>:
mov    $0x1,%eax
cmp    $0x2,%esi
jl     112b <is_palindrome_recursive+0x2b>
lea    0x2(%rsi),%ecx
add    $0xffffffff,%esi
mov    %esi,%r8d
movzbl (%rdi),%edx
cmp    (%rdi,%r8,1),%dl
jne    112c <is_palindrome_recursive+0x2c>
add    $0x1,%rdi
add    $0xfffffffe,%ecx
add    $0xfffffffe,%esi
cmp    $0x3,%ecx
jg     1110 <is_palindrome_recursive+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_palindrome_recursive(i8* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %17, label %4
4: ; preds = %2, %13
%5 = phi i32 [ %15, %13 ], [ %1, %2 ]
%6 = phi i8* [ %14, %13 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = add nsw i32 %5, -1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %7, %11
br i1 %12, label %13, label %17
13: ; preds = %4
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = add nsw i32 %5, -2
%16 = icmp slt i32 %5, 4
br i1 %16, label %17, label %4
17: ; preds = %13, %4, %2
%18 = phi i32 [ 1, %2 ], [ 0, %4 ], [ 1, %13 ]
ret i32 %18
}
/* Variables and functions */
double M_PI;
double deg2rad(double x) { return (x * (M_PI / 180.0)); }


x86 assembly (clang, -O0):
<deg2rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
movsd  (%rax),%xmm1
movsd  0xedf(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg2rad>:
mov    0x2ee1(%rip),%rax
movsd  (%rax),%xmm1
divsd  0xeed(%rip),%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @deg2rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @M_PI
%5 = fdiv double %4, 1.800000e+02
%6 = fmul double %3, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @deg2rad(double %0) {
%2 = load double, double* @M_PI
%3 = fdiv double %2, 1.800000e+02
%4 = fmul double %3, %0
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int insert_in_table(int, int);
int main(int argc, char **argv) {
  char input[80];
  FILE *fd = fopen(argv[1], "r");
  fgets(input, sizeof input, fd);
  int ret;
  int pos;
  pos = input[0];
  ret = insert_in_table(42, pos);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeab(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x68(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rdx
mov    $0x50,%esi
call   1030 <fgets@plt>
movsbl -0x60(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x70(%rbp),%esi
mov    $0x2a,%edi
call   1040 <insert_in_table@plt>
mov    %eax,-0x6c(%rbp)
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
mov    0x8(%rsi),%rdi
lea    0xec1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rsp,%rdi
mov    $0x50,%esi
mov    %rax,%rdx
call   1030 <fgets@plt>
movsbl (%rsp),%esi
mov    $0x2a,%edi
call   1040 <insert_in_table@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [80 x i8]
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32* @fopen(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %13, i32** %7
%14 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%15 = load i32*, i32** %7
%16 = call i32 @fgets(i8* %14, i32 80, i32* %15)
%17 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
store i32 %19, i32* %9
%20 = load i32, i32* %9
%21 = call i32 @insert_in_table(i32 42, i32 %20)
store i32 %21, i32* %8
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @fgets(i8* %4, i32 80, i32* %7)
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = call i32 @insert_in_table(i32 42, i32 %10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
scalar_t__ dbg_enabled_p();
int /*<<< orphan*/ dbg_internal(char const *, int /*<<< orphan*/);
void dbg_1v(const char *fmt, va_list args) {
  if (dbg_enabled_p())
    dbg_internal(fmt, args);
}


x86 assembly (clang, -O0):
<dbg_1v>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <dbg_enabled_p@plt>
cmp    $0x0,%rax
je     114c <dbg_1v+0x2c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <dbg_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_1v>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <dbg_enabled_p@plt>
test   %rax,%rax
je     1144 <dbg_1v+0x24>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <dbg_internal@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @dbg_1v(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i64 (...) @dbg_enabled_p()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @dbg_internal(i8* %8, i32 %9)
br label %11
11: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @dbg_1v(i8* %0, i32 %1) {
%3 = tail call i64 (...) @dbg_enabled_p()
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @dbg_internal(i8* %0, i32 %1)
br label %7
7: ; preds = %5, %2
ret void
}