xunge/DecIR huggingface dataset:
/* Variables and functions */
bool relatively_prime(int A, int B) {
  for (;;) {
    if (!(A %= B)) {
      return B == 1;
    }
    if (!(B %= A)) {
      return A == 1;
    }
  }
}


x86 assembly (clang, -O0):
<relatively_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmp    $0x0,%edx
jne    1133 <relatively_prime+0x33>
cmpl   $0x1,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <relatively_prime+0x61>
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmp    $0x0,%edx
jne    115c <relatively_prime+0x5c>
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <relatively_prime+0x61>
jmp    110a <relatively_prime+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<relatively_prime>:
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1118 <relatively_prime+0x18>
mov    %edx,%edi
mov    %esi,%eax
cltd
idiv   %edi
mov    %edx,%esi
test   %edx,%edx
jne    1100 <relatively_prime>
jmp    111a <relatively_prime+0x1a>
mov    %esi,%edi
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @relatively_prime(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
br label %6
6: ; preds = %24, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = srem i32 %8, %7
store i32 %9, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 1
%14 = zext i1 %13 to i32
store i32 %14, i32* %3
br label %25
15: ; preds = %6
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = srem i32 %17, %16
store i32 %18, i32* %5
%19 = icmp ne i32 %18, 0
br i1 %19, label %24, label %20
20: ; preds = %15
%21 = load i32, i32* %4
%22 = icmp eq i32 %21, 1
%23 = zext i1 %22 to i32
store i32 %23, i32* %3
br label %25
24: ; preds = %15
br label %6
25: ; preds = %20, %11
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @relatively_prime(i32 %0, i32 %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i32 [ %0, %2 ], [ %6, %8 ]
%5 = phi i32 [ %1, %2 ], [ %9, %8 ]
%6 = srem i32 %4, %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = srem i32 %5, %6
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %8, %3
%12 = phi i32 [ %5, %3 ], [ %6, %8 ]
%13 = icmp eq i32 %12, 1
%14 = zext i1 %13 to i32
ret i32 %14
}
int quicktime_match_24(char *input, char *output) {
  if (input[0] == output[0] && input[1] == output[1] && input[2] == output[2])
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<quicktime_match_24>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115e <quicktime_match_24+0x5e>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
cmp    %ecx,%eax
jne    115e <quicktime_match_24+0x5e>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
cmp    %ecx,%eax
jne    115e <quicktime_match_24+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    1165 <quicktime_match_24+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicktime_match_24>:
mov    (%rdi),%al
cmp    (%rsi),%al
jne    111b <quicktime_match_24+0x1b>
mov    0x1(%rdi),%al
cmp    0x1(%rsi),%al
jne    111b <quicktime_match_24+0x1b>
mov    0x2(%rdi),%cl
mov    $0x1,%eax
cmp    0x2(%rsi),%cl
je     111d <quicktime_match_24+0x1d>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @quicktime_match_24(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %9, %13
br i1 %14, label %15, label %36
15: ; preds = %2
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %19, %23
br i1 %24, label %25, label %36
25: ; preds = %15
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i64 2
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = load i8*, i8** %5
%31 = getelementptr inbounds i8, i8* %30, i64 2
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %29, %33
br i1 %34, label %35, label %36
35: ; preds = %25
store i32 1, i32* %3
br label %37
36: ; preds = %25, %15, %2
store i32 0, i32* %3
br label %37
37: ; preds = %36, %35
%38 = load i32, i32* %3
ret i32 %38
}

LLVM IR (-O2):
define i32 @quicktime_match_24(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %18
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %1, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %8, %10
br i1 %11, label %12, label %18
12: ; preds = %6
%13 = getelementptr inbounds i8, i8* %0, i64 2
%14 = load i8, i8* %13
%15 = getelementptr inbounds i8, i8* %1, i64 2
%16 = load i8, i8* %15
%17 = icmp eq i8 %14, %16
br i1 %17, label %19, label %18
18: ; preds = %12, %6, %2
br label %19
19: ; preds = %12, %18
%20 = phi i32 [ 0, %18 ], [ 1, %12 ]
ret i32 %20
}
unsigned long rdtscp(unsigned int *aux) {
  unsigned int a, d, c;
  asm volatile("rdtscp" : "=a"(a), "=d"(d), "=c"(c));
  if (aux)
    *aux = c;
  return ((unsigned long)a) | (((unsigned long)d) << 32);
}


x86 assembly (clang, -O0):
<rdtscp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
rdtscp
mov    %eax,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1128 <rdtscp+0x28>
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x20,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtscp>:
rdtscp
test   %rdi,%rdi
je     110a <rdtscp+0xa>
mov    %ecx,(%rdi)
mov    %eax,%eax
shl    $0x20,%rdx
or     %rax,%rdx
mov    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @rdtscp(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
%6 = call { i32, i32, i32 } asm sideeffect "rdtscp", "={ax},={dx},={cx},~{dirflag},~{fpsr},~{flags}"()
%7 = extractvalue { i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32 } %6, 2
store i32 %7, i32* %3
store i32 %8, i32* %4
store i32 %9, i32* %5
%10 = load i32*, i32** %2
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i32, i32* %5
%14 = load i32*, i32** %2
store i32 %13, i32* %14
br label %15
15: ; preds = %12, %1
%16 = load i32, i32* %3
%17 = zext i32 %16 to i64
%18 = load i32, i32* %4
%19 = zext i32 %18 to i64
%20 = shl i64 %19, 32
%21 = or i64 %17, %20
ret i64 %21
}

LLVM IR (-O2):
define i64 @rdtscp(i32* writeonly %0) {
%2 = tail call { i32, i32, i32 } asm sideeffect "rdtscp", "={ax},={dx},={cx},~{dirflag},~{fpsr},~{flags}"()
%3 = icmp eq i32* %0, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = extractvalue { i32, i32, i32 } %2, 2
store i32 %5, i32* %0
br label %6
6: ; preds = %4, %1
%7 = extractvalue { i32, i32, i32 } %2, 1
%8 = extractvalue { i32, i32, i32 } %2, 0
%9 = zext i32 %8 to i64
%10 = zext i32 %7 to i64
%11 = shl nuw i64 %10, 32
%12 = or i64 %11, %9
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ fibonacci(int);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  printf("Enter a number: ");
  scanf("%i", &a);
  printf("Fibonacci series upto %i: \n", a);
  fibonacci(a);
  getch();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%edi
call   1040 <fibonacci@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [28 x i8] c"Fibonacci series upto %i: \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @fibonacci(i32 %7)
%9 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [28 x i8] c"Fibonacci series upto %i: \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @fibonacci(i32 %7)
%9 = call i32 (...) @getch()
ret i32 0
}
void mc_time_destroy(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SG_DXFER_TO_DEV;
int scsi_command(int, int /*<<< orphan*/, int const *, int,
                 int /*<<< orphan*/ *, int /*<<< orphan*/, int *,
                 int /*<<< orphan*/);
int kvss905c_stop(int fd, uint8_t *requestsense) {
  static const uint8_t command[] = {0xe1, 0, 0x8b, 0, 0, 0, 0, 0, 0, 0};
  return scsi_command(fd, SG_DXFER_TO_DEV, command, sizeof(command), NULL, 0,
                      requestsense, 0);
}


x86 assembly (clang, -O0):
<kvss905c_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
lea    0xeca(%rip),%rdx
mov    $0x28,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
mov    %rax,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <scsi_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kvss905c_stop>:
push   %rax
mov    %rsi,%rax
mov    0x2edd(%rip),%rcx
mov    (%rcx),%esi
lea    0xedc(%rip),%rdx
mov    $0x28,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   %rax
call   1030 <scsi_command@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
@kvss905c_stop.command = internal constant [10 x i32] [i32 225, i32 0, i32 139, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0]
@SG_DXFER_TO_DEV = global i32 0
define i32 @kvss905c_stop(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* @SG_DXFER_TO_DEV
%7 = load i32*, i32** %4
%8 = call i32 @scsi_command(i32 %5, i32 %6, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @kvss905c_stop.command, i64 0, i64 0), i32 40, i32* null, i32 0, i32* %7, i32 0)
ret i32 %8
}

LLVM IR (-O2):
@kvss905c_stop.command = internal constant [10 x i32] [i32 225, i32 0, i32 139, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0]
@SG_DXFER_TO_DEV = global i32 0
define i32 @kvss905c_stop(i32 %0, i32* %1) {
%3 = load i32, i32* @SG_DXFER_TO_DEV
%4 = tail call i32 @scsi_command(i32 %0, i32 %3, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @kvss905c_stop.command, i64 0, i64 0), i32 40, i32* null, i32 0, i32* %1, i32 0)
ret i32 %4
}
void g_hook_first_valid() {}


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

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

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

LLVM IR (-O2):
define void @g_hook_first_valid() {
ret void
}
/* Variables and functions */
int func_inputs_max();
size_t ports_count(void) { return 2 + func_inputs_max() * (18 * 6); }


x86 assembly (clang, -O0):
<ports_count>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <func_inputs_max@plt>
imul   $0x6c,%eax,%eax
add    $0x2,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<ports_count>:
push   %rax
xor    %eax,%eax
call   1030 <func_inputs_max@plt>
imul   $0x6c,%eax,%eax
or     $0x2,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @ports_count() {
%1 = call i32 (...) @func_inputs_max()
%2 = mul nsw i32 %1, 108
%3 = add nsw i32 2, %2
%4 = sext i32 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @ports_count() {
%1 = tail call i32 (...) @func_inputs_max()
%2 = mul nsw i32 %1, 108
%3 = or i32 %2, 2
%4 = sext i32 %3 to i64
ret i64 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long green_mask;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
void set_XImage_green_mask(void *_p, unsigned long _v) {
  ((XImage *)_p)->green_mask = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XImage_green_mask(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XImage_green_mask(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
unsigned int *_ZN3Log11my_priv_funEPi(struct l_class_OC_Log *llvm_cbe_this,
                                      unsigned int *llvm_cbe_pi) {
  unsigned int *llvm_cbe_retval;
  struct l_class_OC_Log *llvm_cbe_this_2e_addr;
  unsigned int *llvm_cbe_pi_2e_addr;
  struct l_class_OC_Log *llvm_cbe_this1;
  unsigned int *llvm_cbe_tmp__73;
  *(&llvm_cbe_this_2e_addr) = llvm_cbe_this;
  *(&llvm_cbe_pi_2e_addr) = llvm_cbe_pi;
  llvm_cbe_this1 = *(&llvm_cbe_this_2e_addr);
  *(&llvm_cbe_retval) = ((unsigned int *)0);
  llvm_cbe_tmp__73 = *(&llvm_cbe_retval);
  return llvm_cbe_tmp__73;
}


x86 assembly (clang, -O0):
<_ZN3Log11my_priv_funEPi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.l_class_OC_Log = type opaque
define i32* @_ZN3Log11my_priv_funEPi(%struct.l_class_OC_Log* %0, i32* %1) {
%3 = alloca %struct.l_class_OC_Log*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca %struct.l_class_OC_Log*
%7 = alloca i32*
%8 = alloca %struct.l_class_OC_Log*
%9 = alloca i32*
store %struct.l_class_OC_Log* %0, %struct.l_class_OC_Log** %3
store i32* %1, i32** %4
%10 = load %struct.l_class_OC_Log*, %struct.l_class_OC_Log** %3
store %struct.l_class_OC_Log* %10, %struct.l_class_OC_Log** %6
%11 = load i32*, i32** %4
store i32* %11, i32** %7
%12 = load %struct.l_class_OC_Log*, %struct.l_class_OC_Log** %6
store %struct.l_class_OC_Log* %12, %struct.l_class_OC_Log** %8
store i32* null, i32** %5
%13 = load i32*, i32** %5
store i32* %13, i32** %9
%14 = load i32*, i32** %9
ret i32* %14
}

LLVM IR (-O2):
%struct.l_class_OC_Log = type opaque
define noalias i32* @_ZN3Log11my_priv_funEPi(%struct.l_class_OC_Log* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32* null
}
int main() {
  char c[8] = "an error!";
  return c[0] - 'a' + c[7] - 'r';
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0xc(%rbp)
movsbl -0xc(%rbp),%eax
sub    $0x61,%eax
movsbl -0x5(%rbp),%ecx
add    %ecx,%eax
sub    $0x72,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.c = [8 x i8] c"an error"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
store i32 0, i32* %1
%3 = bitcast [8 x i8]* %2 to i8*
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 97
%8 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = add nsw i32 %7, %10
%12 = sub nsw i32 %11, 114
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
double __floatdidf(int64_t a) { return (double)a; }


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

x86 assembly (clang, -O2):
<__floatdidf>:
cvtsi2sd %rdi,%xmm0
ret

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

LLVM IR (-O2):
define double @__floatdidf(i64 %0) {
%2 = sitofp i64 %0 to double
ret double %2
}
int Cyc_Character_isspace(unsigned char c) {
  return ((((c == ' ' ? 1 : c == '\t') ? 1 : c == '\n') ? 1 : c == '\r')
              ? 1
              : c == '\f')
             ? 1
             : c == '\v';
}


x86 assembly (clang, -O0):
<Cyc_Character_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x20,%eax
jne    1126 <Cyc_Character_isspace+0x26>
mov    $0x1,%al
test   $0x1,%al
jne    1133 <Cyc_Character_isspace+0x33>
jmp    1142 <Cyc_Character_isspace+0x42>
movzbl -0x1(%rbp),%eax
cmp    $0x9,%eax
jne    1142 <Cyc_Character_isspace+0x42>
mov    $0x1,%al
test   $0x1,%al
jne    114f <Cyc_Character_isspace+0x4f>
jmp    115e <Cyc_Character_isspace+0x5e>
movzbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    115e <Cyc_Character_isspace+0x5e>
mov    $0x1,%al
test   $0x1,%al
jne    116b <Cyc_Character_isspace+0x6b>
jmp    117a <Cyc_Character_isspace+0x7a>
movzbl -0x1(%rbp),%eax
cmp    $0xd,%eax
jne    117a <Cyc_Character_isspace+0x7a>
mov    $0x1,%al
test   $0x1,%al
jne    1187 <Cyc_Character_isspace+0x87>
jmp    1194 <Cyc_Character_isspace+0x94>
movzbl -0x1(%rbp),%eax
cmp    $0xc,%eax
jne    1194 <Cyc_Character_isspace+0x94>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a6 <Cyc_Character_isspace+0xa6>
movzbl -0x1(%rbp),%eax
cmp    $0xb,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Character_isspace>:
cmp    $0x20,%dil
sete   %al
lea    -0x9(%rdi),%ecx
cmp    $0x2,%cl
setb   %cl
or     %al,%cl
mov    %edi,%eax
and    $0xfe,%al
cmp    $0xc,%al
sete   %al
cmp    $0xb,%dil
sete   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @Cyc_Character_isspace(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %6, label %7
6: ; preds = %1
br i1 true, label %11, label %12
7: ; preds = %1
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = icmp eq i32 %9, 9
br i1 %10, label %11, label %12
11: ; preds = %7, %6
br i1 true, label %16, label %17
12: ; preds = %7, %6
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = icmp eq i32 %14, 10
br i1 %15, label %16, label %17
16: ; preds = %12, %11
br i1 true, label %21, label %22
17: ; preds = %12, %11
%18 = load i8, i8* %2
%19 = zext i8 %18 to i32
%20 = icmp eq i32 %19, 13
br i1 %20, label %21, label %22
21: ; preds = %17, %16
br i1 true, label %26, label %27
22: ; preds = %17, %16
%23 = load i8, i8* %2
%24 = zext i8 %23 to i32
%25 = icmp eq i32 %24, 12
br i1 %25, label %26, label %27
26: ; preds = %22, %21
br label %32
27: ; preds = %22, %21
%28 = load i8, i8* %2
%29 = zext i8 %28 to i32
%30 = icmp eq i32 %29, 11
%31 = zext i1 %30 to i32
br label %32
32: ; preds = %27, %26
%33 = phi i32 [ 1, %26 ], [ %31, %27 ]
ret i32 %33
}

LLVM IR (-O2):
define i32 @Cyc_Character_isspace(i8 zeroext %0) {
%2 = icmp eq i8 %0, 32
%3 = add i8 %0, -9
%4 = icmp ult i8 %3, 2
%5 = or i1 %2, %4
%6 = and i8 %0, -2
%7 = icmp eq i8 %6, 12
%8 = or i1 %7, %5
%9 = icmp eq i8 %0, 11
%10 = or i1 %9, %8
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
pid_t waitpid(pid_t pid, int *status, int options) {
  fprintf(stderr, "\nAccess to dangerous function %s() denied.\n", "waitpid");
  assert(0);
  ;
}


x86 assembly (clang, -O0):
<waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
lea    0xebe(%rip),%rsi
lea    0xee3(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitpid>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xef4(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [8 x i8] c"waitpid\00"
define i32 @waitpid(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @assert(i32 0)
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [8 x i8] c"waitpid\00"
define i32 @waitpid(i32 %0, i32* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t Function1Int64(int64_t x) { return x + 42; }


x86 assembly (clang, -O0):
<Function1Int64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2a,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Function1Int64>:
lea    0x2a(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @Function1Int64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 42
ret i64 %4
}

LLVM IR (-O2):
define i64 @Function1Int64(i64 %0) {
%2 = add nsw i64 %0, 42
ret i64 %2
}
int main() {
  printf("Hello,\n");
  asm("0:"
      ".pushsection embed-breakpoints;"
      ".quad"
      " 0b;"
      ".popsection;");
  printf("world!\n");
  asm("0:"
      ".pushsection embed-breakpoints;"
      ".quad"
      " 0b;"
      ".popsection;");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [7 x i8] c"Hello,\00"
@str.2 = [7 x i8] c"world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
tail call void asm sideeffect "0:.pushsection embed-breakpoints;.quad 0b;.popsection;", "~{dirflag},~{fpsr},~{flags}"()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0))
tail call void asm sideeffect "0:.pushsection embed-breakpoints;.quad 0b;.popsection;", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Type definitions */
struct rlimit {
  void *rlim_max;
  void *rlim_cur;
};
typedef void *rlim_t;

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_CPU;
int /*<<< orphan*/ setrlimit(int /*<<< orphan*/, struct rlimit *);
void my_setrlimit(rlim_t cur, rlim_t max) {
  struct rlimit r;
  r.rlim_cur = cur;
  r.rlim_max = max;
  setrlimit(RLIMIT_CPU, &r);
}


x86 assembly (clang, -O0):
<my_setrlimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
call   1030 <setrlimit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_setrlimit>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
mov    %rsi,0x8(%rsp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <setrlimit@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.rlimit = type { i8*, i8* }
@RLIMIT_CPU = global i32 0
define void @my_setrlimit(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.rlimit
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %5, i32 0, i32 1
store i8* %6, i8** %7
%8 = load i8*, i8** %4
%9 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %5, i32 0, i32 0
store i8* %8, i8** %9
%10 = load i32, i32* @RLIMIT_CPU
%11 = call i32 @setrlimit(i32 %10, %struct.rlimit* %5)
ret void
}

LLVM IR (-O2):
%struct.rlimit = type { i8*, i8* }
@RLIMIT_CPU = global i32 0
define void @my_setrlimit(i8* %0, i8* %1) {
%3 = alloca %struct.rlimit
%4 = bitcast %struct.rlimit* %3 to i8*
%5 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %3, i64 0, i32 1
store i8* %0, i8** %5
%6 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %3, i64 0, i32 0
store i8* %1, i8** %6
%7 = load i32, i32* @RLIMIT_CPU
%8 = call i32 @setrlimit(i32 %7, %struct.rlimit* %3)
ret void
}
/* Variables and functions */
int inner_sint(int);
int outer_sint(int value) {
  int outer_value = 2 * inner_sint(value);
  return outer_value;
}


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

x86 assembly (clang, -O2):
<outer_sint>:
push   %rax
call   1030 <inner_sint@plt>
add    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @outer_sint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @inner_sint(i32 %4)
%6 = mul nsw i32 2, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @outer_sint(i32 %0) {
%2 = tail call i32 @inner_sint(i32 %0)
%3 = shl nsw i32 %2, 1
ret i32 %3
}
double Ft2M(double Ft) {
  double Mt;
  Mt = Ft / 3.2808;
  return Mt;
}


x86 assembly (clang, -O0):
<Ft2M>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ft2M>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @Ft2M(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 3.280800e+00
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @Ft2M(double %0) {
%2 = fdiv double %0, 3.280800e+00
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *wCharConcat(char *, char *);
char *wCharConcatInt(char *dst, int i) {
  char buffer[32];
  sprintf(buffer, "%d", i);
  return wCharConcat(dst, buffer);
}


x86 assembly (clang, -O0):
<wCharConcatInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <wCharConcat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wCharConcatInt>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xecd(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <wCharConcat@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @wCharConcatInt(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [32 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%11 = call i8* @wCharConcat(i8* %9, i8* %10)
ret i8* %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @wCharConcatInt(i8* %0, i32 %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i8* @wCharConcat(i8* %0, i8* %4)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void showhelp() {
  fprintf(stderr, "Usage: r2rc [-alh] [files] > file.S\n"
                  "  -s      use at&t syntax instead of intel\n"
                  "  -m      add 'call main prefix\n"
                  "  -h      display this help\n"
                  "  -A      show default architecture\n"
                  "  -a      list all supported architectures\n"
                  "  -ax86  use x86-32\n"
                  "  -ax64  use x86-64\n"
                  "  -aarm  use ARM\n");
}


x86 assembly (clang, -O0):
<showhelp>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<showhelp>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [276 x i8] c"Usage: r2rc [-alh] [files] > file.S\0A -s use at&t syntax instead of intel\0A -m add 'call main prefix\0A -h display this help\0A -A show default architecture\0A -a list all supported architectures\0A -ax86 use x86-32\0A -ax64 use x86-64\0A -aarm use ARM\0A\00"
define void @showhelp() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([276 x i8], [276 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [276 x i8] c"Usage: r2rc [-alh] [files] > file.S\0A -s use at&t syntax instead of intel\0A -m add 'call main prefix\0A -h display this help\0A -A show default architecture\0A -a list all supported architectures\0A -ax86 use x86-32\0A -ax64 use x86-64\0A -aarm use ARM\0A\00"
define void @showhelp() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([276 x i8], [276 x i8]* @.str, i64 0, i64 0))
ret void
}
float Sleef_fmaf(float x, float y, float z) { return __builtin_fmaf(x, y, z); }


x86 assembly (clang, -O0):
<Sleef_fmaf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <fmaf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_fmaf>:
jmp    1030 <fmaf@plt>

LLVM IR (-O0):
define float @Sleef_fmaf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @llvm.fma.f32(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @Sleef_fmaf(float %0, float %1, float %2) {
%4 = tail call float @llvm.fma.f32(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ __print_int(int);
int main() {
  int i = 0, j = 0;
  int a;
  int b;
  int c;
  int d = 4;
  while (i < 5) {
    j = 0;
    while (j < 5) {
      a = 5 * d;
      b = i * 5;
      c = i * j;
      j++;
    }
    i++;
  }
  __print_int(a);
  __print_int(b);
  __print_int(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x4,-0x1c(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1183 <main+0x73>
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1175 <main+0x65>
imul   $0x5,-0x1c(%rbp),%eax
mov    %eax,-0x10(%rbp)
imul   $0x5,-0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <main+0x35>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
mov    -0x10(%rbp),%edi
call   1030 <__print_int@plt>
mov    -0x14(%rbp),%edi
call   1030 <__print_int@plt>
mov    -0x18(%rbp),%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
call   1030 <__print_int@plt>
mov    $0x14,%edi
call   1030 <__print_int@plt>
mov    $0x10,%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 4, i32* %7
br label %8
8: ; preds = %25, %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 5
br i1 %10, label %11, label %28
11: ; preds = %8
store i32 0, i32* %3
br label %12
12: ; preds = %15, %11
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 5
br i1 %14, label %15, label %25
15: ; preds = %12
%16 = load i32, i32* %7
%17 = mul nsw i32 5, %16
store i32 %17, i32* %4
%18 = load i32, i32* %2
%19 = mul nsw i32 %18, 5
store i32 %19, i32* %5
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = mul nsw i32 %20, %21
store i32 %22, i32* %6
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %12
25: ; preds = %12
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %8
28: ; preds = %8
%29 = load i32, i32* %4
%30 = call i32 @__print_int(i32 %29)
%31 = load i32, i32* %5
%32 = call i32 @__print_int(i32 %31)
%33 = load i32, i32* %6
%34 = call i32 @__print_int(i32 %33)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 20)
%2 = tail call i32 @__print_int(i32 20)
%3 = tail call i32 @__print_int(i32 16)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[], char *envp[]) {
  printf("In pwd \n");
  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)
mov    %rdx,-0x18(%rbp)
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [8 x i8] c"In pwd \00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void say_good_fellow(void) { printf("For he's a jolly good fellow!\n"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"For he's a jolly good fellow!\0A\00"
define void @say_good_fellow() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"For he's a jolly good fellow!\00"
define void @say_good_fellow() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
void main() {
  int n;
  for (;;) {
    n++;
    return;
  }
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
br label %2
2: ; preds = %0
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
unsigned int sys_call(int, int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/);
unsigned int procid() { return sys_call(0x00, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<procid>:
push   %rbp
mov    %rsp,%rbp
xor    %r8d,%r8d
mov    %r8d,%edi
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <sys_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<procid>:
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <sys_call@plt>

LLVM IR (-O0):
define i32 @procid() {
%1 = call i32 @sys_call(i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @procid() {
%1 = tail call i32 @sys_call(i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("\"convert2c\" v. 0.1a\n");
  printf("Usage:\tconvert2c filename\n\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"\22convert2c\22 v. 0.1a\0A\00"
@.str.1 = [28 x i8] c"Usage:\09convert2c filename\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\22convert2c\22 v. 0.1a\00"
@str.2 = [27 x i8] c"Usage:\09convert2c filename\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.2, i64 0, i64 0))
ret void
}
int airkiss_discover_filter(const unsigned char *frame, int size) {
  int isvalid = 0;
  if (size < 50)
    goto invalid;
  isvalid = 1;
invalid:
  return isvalid;
}


x86 assembly (clang, -O0):
<airkiss_discover_filter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    1121 <airkiss_discover_filter+0x21>
jmp    1128 <airkiss_discover_filter+0x28>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<airkiss_discover_filter>:
xor    %eax,%eax
cmp    $0x32,%esi
setge  %al
ret

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

LLVM IR (-O2):
define i32 @airkiss_discover_filter(i8* nocapture readnone %0, i32 %1) {
%3 = icmp sgt i32 %1, 49
%4 = zext i1 %3 to i32
ret i32 %4
}
void foo323(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo323(i32 %0) {
ret void
}
float __ocl_max_float_float(float src1, float src2) {
  return (src1 > src2) ? src1 : src2;
}


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

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

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

LLVM IR (-O2):
define float @__ocl_max_float_float(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
void rop3_214_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = T & S;
  stk3 = *D | stk4;
  stk2 = S ^ stk3;
  stk1 = T ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_214_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xe(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_214_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = and i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %10
%17 = load i8*, i8** %4
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = load i8, i8* %10
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
%23 = trunc i32 %22 to i8
store i8 %23, i8* %9
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = load i8, i8* %9
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %8
%30 = load i8, i8* %6
%31 = zext i8 %30 to i32
%32 = load i8, i8* %8
%33 = zext i8 %32 to i32
%34 = xor i32 %31, %33
%35 = trunc i32 %34 to i8
store i8 %35, i8* %7
%36 = load i8, i8* %7
%37 = zext i8 %36 to i32
%38 = load i8, i8* %5
%39 = zext i8 %38 to i32
%40 = xor i32 %39, -1
%41 = and i32 %37, %40
%42 = load i8, i8* %6
%43 = zext i8 %42 to i32
%44 = xor i32 %43, -1
%45 = and i32 %41, %44
%46 = load i8*, i8** %4
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = load i8, i8* %5
%50 = zext i8 %49 to i32
%51 = and i32 %48, %50
%52 = or i32 %45, %51
%53 = load i8*, i8** %4
%54 = load i8, i8* %53
%55 = zext i8 %54 to i32
%56 = load i8, i8* %6
%57 = zext i8 %56 to i32
%58 = and i32 %55, %57
%59 = or i32 %52, %58
%60 = trunc i32 %59 to i8
%61 = load i8*, i8** %4
store i8 %60, i8* %61
ret void
}

LLVM IR (-O2):
define void @rop3_214_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Variables and functions */
char const *ulz_how_girl_get_pragnent();
const char *ulz_how_is_babby_formed(void) {
  return ulz_how_girl_get_pragnent();
}


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

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

LLVM IR (-O0):
define i8* @ulz_how_is_babby_formed() {
%1 = call i8* (...) @ulz_how_girl_get_pragnent()
ret i8* %1
}

LLVM IR (-O2):
define i8* @ulz_how_is_babby_formed() {
%1 = tail call i8* (...) @ulz_how_girl_get_pragnent()
ret i8* %1
}
void foo602() {}


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

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

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

LLVM IR (-O2):
define void @foo602() {
ret void
}
void tape_save(void) {}


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

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

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

LLVM IR (-O2):
define void @tape_save() {
ret void
}