xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
long getFileSize(FILE *fp) {
  long file_size;
  if (fp == NULL)
    return -1;
  rewind(fp);
  fseek(fp, 0, SEEK_END);
  file_size = ftell(fp);
  rewind(fp);
  return file_size;
}


x86 assembly (clang, -O0):
<getFileSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <getFileSize+0x24>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    118f <getFileSize+0x5f>
mov    -0x10(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x10(%rbp),%rdi
mov    0x2e80(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   1040 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFileSize>:
test   %rdi,%rdi
je     1172 <getFileSize+0x42>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <rewind@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <rewind@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
define i64 @getFileSize(i32* %0) {
%2 = alloca i64
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 -1, i64* %2
br label %19
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = call i32 @rewind(i32* %9)
%11 = load i32*, i32** %3
%12 = load i32, i32* @SEEK_END
%13 = call i32 @fseek(i32* %11, i32 0, i32 %12)
%14 = load i32*, i32** %3
%15 = call i64 @ftell(i32* %14)
store i64 %15, i64* %4
%16 = load i32*, i32** %3
%17 = call i32 @rewind(i32* %16)
%18 = load i64, i64* %4
store i64 %18, i64* %2
br label %19
19: ; preds = %8, %7
%20 = load i64, i64* %2
ret i64 %20
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i64 @getFileSize(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i32 @rewind(i32* %0)
%5 = load i32, i32* @SEEK_END
%6 = tail call i32 @fseek(i32* %0, i32 0, i32 %5)
%7 = tail call i64 @ftell(i32* %0)
%8 = tail call i32 @rewind(i32* %0)
br label %9
9: ; preds = %1, %3
%10 = phi i64 [ %7, %3 ], [ -1, %1 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ miniprintf(char *, char *);
int main(void) {
  miniprintf("fuck %d\n", "canglaoshi");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"fuck %d\0A\00"
@.str.1 = [11 x i8] c"canglaoshi\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @miniprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"fuck %d\0A\00"
@.str.1 = [11 x i8] c"canglaoshi\00"
define i32 @main() {
%1 = tail call i32 @miniprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, double, char, char, char, char *);
int main() {
  printf("%d / %d = %.1lf\n%c %c %c\n제 이름은 %s입니다\n", 10, 20, 0.5, 'a',
         'b', 'c', "홍길동");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
movsd  0xec8(%rip),%xmm0
mov    $0x61,%ecx
mov    $0x62,%r8d
mov    $0x63,%r9d
lea    0xeec(%rip),%rax
mov    %rax,(%rsp)
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf24(%rip),%rax
mov    %rax,(%rsp)
lea    0xee5(%rip),%rdi
movsd  0xed5(%rip),%xmm0
mov    $0xa,%esi
mov    $0x14,%edx
mov    $0x61,%ecx
mov    $0x62,%r8d
mov    $0x63,%r9d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"%d / %d = %.1lf\0A%c %c %c\0A\EC\A0\9C \EC\9D\B4\EB\A6\84\EC\9D\80 %s\EC\9E\85\EB\8B\88\EB\8B\A4\0A\00"
@.str.1 = [10 x i8] c"\ED\99\8D\EA\B8\B8\EB\8F\99\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 10, i32 20, double 5.000000e-01, i8 signext 97, i8 signext 98, i8 signext 99, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [52 x i8] c"%d / %d = %.1lf\0A%c %c %c\0A\EC\A0\9C \EC\9D\B4\EB\A6\84\EC\9D\80 %s\EC\9E\85\EB\8B\88\EB\8B\A4\0A\00"
@.str.1 = [10 x i8] c"\ED\99\8D\EA\B8\B8\EB\8F\99\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 10, i32 20, double 5.000000e-01, i8 signext 97, i8 signext 98, i8 signext 99, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
int log_exit(void) {
  closelog();
  return 0;
}


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

x86 assembly (clang, -O2):
<log_exit>:
push   %rax
xor    %eax,%eax
call   1030 <closelog@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @log_exit() {
%1 = call i32 (...) @closelog()
ret i32 0
}

LLVM IR (-O2):
define i32 @log_exit() {
%1 = tail call i32 (...) @closelog()
ret i32 0
}
unsigned int ft_collatz_conjecture(unsigned int base) {
  if (base <= 1)
    return (0);
  if (base % 2 == 0)
    return (ft_collatz_conjecture(base / 2) + 1);
  else
    return (ft_collatz_conjecture(base * 3 + 1) + 1);
}


x86 assembly (clang, -O0):
<ft_collatz_conjecture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
ja     1131 <ft_collatz_conjecture+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1168 <ft_collatz_conjecture+0x58>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1156 <ft_collatz_conjecture+0x46>
mov    -0x8(%rbp),%edi
shr    $0x1,%edi
call   1030 <ft_collatz_conjecture@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <ft_collatz_conjecture+0x58>
imul   $0x3,-0x8(%rbp),%edi
add    $0x1,%edi
call   1030 <ft_collatz_conjecture@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ft_collatz_conjecture(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ule 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 = urem 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 = udiv i32 %12, 2
%14 = call i32 @ft_collatz_conjecture(i32 %13)
%15 = add i32 %14, 1
store i32 %15, i32* %2
br label %22
16: ; preds = %7
%17 = load i32, i32* %3
%18 = mul i32 %17, 3
%19 = add i32 %18, 1
%20 = call i32 @ft_collatz_conjecture(i32 %19)
%21 = add 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 @ft_collatz_conjecture(i32 %0) {
%2 = icmp ult 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 i32 %4, 3
%16 = add i32 %15, 1
%17 = tail call i32 @ft_collatz_conjecture(i32 %16)
%18 = add nuw i32 %5, 1
%19 = add i32 %18, %17
br label %12
}
float testMe(unsigned int concept, unsigned int totalValue) {
  return ((float)concept / totalValue) * 100;
}


x86 assembly (clang, -O0):
<testMe>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm1
divss  %xmm1,%xmm0
movss  0xeda(%rip),%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<testMe>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
mov    %esi,%eax
cvtsi2ss %rax,%xmm1
divss  %xmm1,%xmm0
mulss  0xee6(%rip),%xmm0
ret

LLVM IR (-O0):
define float @testMe(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 = uitofp i32 %5 to float
%7 = load i32, i32* %4
%8 = uitofp i32 %7 to float
%9 = fdiv float %6, %8
%10 = fmul float %9, 1.000000e+02
ret float %10
}

LLVM IR (-O2):
define float @testMe(i32 %0, i32 %1) {
%3 = uitofp i32 %0 to float
%4 = uitofp i32 %1 to float
%5 = fdiv float %3, %4
%6 = fmul float %5, 1.000000e+02
ret float %6
}
int tNumber(int n) {
  int total = 0;
  for (int i = 1; i <= n; i++) {
    total += i;
  }
  return total;
}


x86 assembly (clang, -O0):
<tNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1138 <tNumber+0x38>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <tNumber+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tNumber>:
test   %edi,%edi
jle    1118 <tNumber+0x18>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,2),%eax
add    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @tNumber(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = shl nuw i32 %0, 1
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %4, %11
%13 = add i32 %12, -1
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ MyParentTid();
int /*<<< orphan*/ Send(int /*<<< orphan*/, char *, int, void *,
                        int /*<<< orphan*/);
void test_msglen_send2recv_sender(void) {
  Send(MyParentTid(), "foobar baz", 11, ((void *)0), 0);
}


x86 assembly (clang, -O0):
<test_msglen_send2recv_sender>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <MyParentTid@plt>
mov    %eax,%edi
lea    0xecc(%rip),%rsi
mov    $0xb,%edx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1040 <Send@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_msglen_send2recv_sender>:
push   %rax
xor    %eax,%eax
call   1030 <MyParentTid@plt>
lea    0xed1(%rip),%rsi
mov    %eax,%edi
mov    $0xb,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
pop    %rax
jmp    1040 <Send@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"foobar baz\00"
define void @test_msglen_send2recv_sender() {
%1 = call i32 (...) @MyParentTid()
%2 = call i32 @Send(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 11, i8* null, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"foobar baz\00"
define void @test_msglen_send2recv_sender() {
%1 = tail call i32 (...) @MyParentTid()
%2 = tail call i32 @Send(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 11, i8* null, i32 0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void EEPROMIntDisable(uint32_t ui32IntFlags) {
  ASSERT(ui32IntFlags == 0x00000004);
  (*((volatile uint32_t *)(0x400FD010))) &= ~0x00000004;
  (*((volatile uint32_t *)(0x400AF040))) &= ~0x00000001;
}


x86 assembly (clang, -O0):
<EEPROMIntDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    $0x400fd010,%eax
mov    (%rax),%ecx
and    $0xfffffffb,%ecx
mov    $0x400fd010,%eax
mov    %ecx,(%rax)
mov    $0x400af040,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    $0x400af040,%eax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EEPROMIntDisable>:
push   %rax
xor    %eax,%eax
cmp    $0x4,%edi
sete   %al
mov    %eax,%edi
call   1030 <ASSERT@plt>
andl   $0xfffffffb,0x400fd010
fb
andl   $0xfffffffe,0x400af040
fe
pop    %rax
ret

LLVM IR (-O0):
define void @EEPROMIntDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 4
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load volatile i32, i32* inttoptr (i64 1074778128 to i32*)
%8 = and i32 %7, -5
store volatile i32 %8, i32* inttoptr (i64 1074778128 to i32*)
%9 = load volatile i32, i32* inttoptr (i64 1074458688 to i32*)
%10 = and i32 %9, -2
store volatile i32 %10, i32* inttoptr (i64 1074458688 to i32*)
ret void
}

LLVM IR (-O2):
define void @EEPROMIntDisable(i32 %0) {
%2 = icmp eq i32 %0, 4
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = load volatile i32, i32* inttoptr (i64 1074778128 to i32*)
%6 = and i32 %5, -5
store volatile i32 %6, i32* inttoptr (i64 1074778128 to i32*)
%7 = load volatile i32, i32* inttoptr (i64 1074458688 to i32*)
%8 = and i32 %7, -2
store volatile i32 %8, i32* inttoptr (i64 1074458688 to i32*)
ret void
}
void write_rails_data_to_demo(struct entity_t *rails) { ; }


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

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

LLVM IR (-O0):
%struct.entity_t = type opaque
define void @write_rails_data_to_demo(%struct.entity_t* %0) {
%2 = alloca %struct.entity_t*
store %struct.entity_t* %0, %struct.entity_t** %2
ret void
}

LLVM IR (-O2):
%struct.entity_t = type opaque
define void @write_rails_data_to_demo(%struct.entity_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d", 1); }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @noInterrupts() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void test1(void) {
  int x = 3, y = 2;
  if ((x < y ? x++ : y++) != 2)
    abort();
  if (x != 3)
    abort();
  if (y != 3)
    abort();
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1145 <test1+0x35>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
mov    %eax,-0xc(%rbp)
jmp    1153 <test1+0x43>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x2,%eax
je     1166 <test1+0x56>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x3,-0x4(%rbp)
je     1177 <test1+0x67>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x3,-0x8(%rbp)
je     1188 <test1+0x78>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test1() {
%1 = alloca i32
%2 = alloca i32
store i32 3, i32* %1
store i32 2, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = icmp slt i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %12
9: ; preds = %0
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %6
%13 = phi i32 [ %7, %6 ], [ %10, %9 ]
%14 = icmp ne i32 %13, 2
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %12
%18 = load i32, i32* %1
%19 = icmp ne i32 %18, 3
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 (...) @abort()
unreachable
22: ; preds = %17
%23 = load i32, i32* %2
%24 = icmp ne i32 %23, 3
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 (...) @abort()
unreachable
27: ; preds = %22
ret void
}

LLVM IR (-O2):
define void @test1() {
ret void
}
__attribute__((used)) void abort(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <abort+0x9>
jmp    1109 <abort+0x9>

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @abort to i8*)], section "llvm.metadata"
define void @abort() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @abort to i8*)], section "llvm.metadata"
define void @abort() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
struct Edge {
  int dummy;
};

/* Variables and functions */
struct Edge *edge_invRot(int /*<<< orphan*/);
int /*<<< orphan*/ edge_oNext(int /*<<< orphan*/);
int /*<<< orphan*/ edge_rot(struct Edge *);
struct Edge *edge_rNext(struct Edge *edge) {
  return edge_invRot(edge_oNext(edge_rot(edge)));
}


x86 assembly (clang, -O0):
<edge_rNext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <edge_rot@plt>
mov    %eax,%edi
call   1050 <edge_oNext@plt>
mov    %eax,%edi
call   1030 <edge_invRot@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<edge_rNext>:
push   %rax
call   1040 <edge_rot@plt>
mov    %eax,%edi
call   1050 <edge_oNext@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <edge_invRot@plt>

LLVM IR (-O0):
%struct.Edge = type { i32 }
define %struct.Edge* @edge_rNext(%struct.Edge* %0) {
%2 = alloca %struct.Edge*
store %struct.Edge* %0, %struct.Edge** %2
%3 = load %struct.Edge*, %struct.Edge** %2
%4 = call i32 @edge_rot(%struct.Edge* %3)
%5 = call i32 @edge_oNext(i32 %4)
%6 = call %struct.Edge* @edge_invRot(i32 %5)
ret %struct.Edge* %6
}

LLVM IR (-O2):
%struct.Edge = type { i32 }
define %struct.Edge* @edge_rNext(%struct.Edge* %0) {
%2 = tail call i32 @edge_rot(%struct.Edge* %0)
%3 = tail call i32 @edge_oNext(i32 %2)
%4 = tail call %struct.Edge* @edge_invRot(i32 %3)
ret %struct.Edge* %4
}
int get_flag(int *flag) { return __atomic_load_n(flag, 2); }


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

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

LLVM IR (-O0):
define i32 @get_flag(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load atomic i32, i32* %4 acquire
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_flag(i32* nocapture %0) {
%2 = load atomic i32, i32* %0 acquire
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ result;

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ const *);
int /*<<< orphan*/ memcpy(struct tm *, struct tm *, int);
struct tm *gmtime_r(const time_t *timer, struct tm *result) {
  struct tm *local_result;
  local_result = gmtime(timer);
  if (local_result == NULL || result == NULL)
    return NULL;
  memcpy(result, local_result, sizeof(result));
  return result;
}


x86 assembly (clang, -O0):
<gmtime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <gmtime@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1153 <gmtime_r+0x33>
cmpq   $0x0,-0x18(%rbp)
jne    1160 <gmtime_r+0x40>
movq   $0x0,-0x8(%rbp)
jmp    117a <gmtime_r+0x5a>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmtime_r>:
push   %rbx
mov    %rsi,%rbx
call   1040 <gmtime@plt>
xor    %ecx,%ecx
test   %rbx,%rbx
je     1148 <gmtime_r+0x28>
test   %rax,%rax
je     1148 <gmtime_r+0x28>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @gmtime_r(i32* %0, %struct.tm* %1) {
%3 = alloca %struct.tm*
%4 = alloca i32*
%5 = alloca %struct.tm*
%6 = alloca %struct.tm*
store i32* %0, i32** %4
store %struct.tm* %1, %struct.tm** %5
%7 = load i32*, i32** %4
%8 = call %struct.tm* @gmtime(i32* %7)
store %struct.tm* %8, %struct.tm** %6
%9 = load %struct.tm*, %struct.tm** %6
%10 = icmp eq %struct.tm* %9, null
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load %struct.tm*, %struct.tm** %5
%13 = icmp eq %struct.tm* %12, null
br i1 %13, label %14, label %15
14: ; preds = %11, %2
store %struct.tm* null, %struct.tm** %3
br label %20
15: ; preds = %11
%16 = load %struct.tm*, %struct.tm** %5
%17 = load %struct.tm*, %struct.tm** %6
%18 = call i32 @memcpy(%struct.tm* %16, %struct.tm* %17, i32 8)
%19 = load %struct.tm*, %struct.tm** %5
store %struct.tm* %19, %struct.tm** %3
br label %20
20: ; preds = %15, %14
%21 = load %struct.tm*, %struct.tm** %3
ret %struct.tm* %21
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @gmtime_r(i32* %0, %struct.tm* %1) {
%3 = tail call %struct.tm* @gmtime(i32* %0)
%4 = icmp eq %struct.tm* %3, null
%5 = icmp eq %struct.tm* %1, null
%6 = or i1 %5, %4
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @memcpy(%struct.tm* %1, %struct.tm* %3, i32 8)
br label %9
9: ; preds = %2, %7
%10 = phi %struct.tm* [ %1, %7 ], [ null, %2 ]
ret %struct.tm* %10
}
void __attribute__((__no_instrument_function__))
__cyg_profile_func_enter(void *this_func, void *call_site) {
  printf("%s: func = %p, called by = %p\r\n", __FUNCTION__, this_func,
         call_site);
}


x86 assembly (clang, -O0):
<__cyg_profile_func_enter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xed1(%rip),%rdi
lea    0xeea(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cyg_profile_func_enter>:
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
lea    0xefc(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"%s: func = %p, called by = %p\0D\0A\00"
@__FUNCTION__.__cyg_profile_func_enter = [25 x i8] c"__cyg_profile_func_enter\00"
define void @__cyg_profile_func_enter(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__FUNCTION__.__cyg_profile_func_enter, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"%s: func = %p, called by = %p\0D\0A\00"
@__FUNCTION__.__cyg_profile_func_enter = [25 x i8] c"__cyg_profile_func_enter\00"
define void @__cyg_profile_func_enter(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__FUNCTION__.__cyg_profile_func_enter, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
uint8_t log2floor(uintptr_t num) {
  uint8_t l = 0;
  uintptr_t n;
  for (n = num; n > 1; n >>= 1, l++)
    ;
  return l;
}


x86 assembly (clang, -O0):
<log2floor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x1,-0x18(%rbp)
jbe    1145 <log2floor+0x45>
jmp    1128 <log2floor+0x28>
mov    -0x18(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <log2floor+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2floor>:
xor    %eax,%eax
cmp    $0x2,%rdi
jb     1120 <log2floor+0x20>
mov    %rdi,%rcx
nopl   0x0(%rax,%rax,1)
shr    %rcx
add    $0x1,%rax
cmp    $0x3,%rdi
mov    %rcx,%rdi
ja     1110 <log2floor+0x10>
ret

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

LLVM IR (-O2):
define i64 @log2floor(i64 %0) {
%2 = icmp ugt i64 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ %0, %1 ]
%5 = phi i64 [ %7, %3 ], [ 0, %1 ]
%6 = lshr i64 %4, 1
%7 = add nuw nsw i64 %5, 1
%8 = icmp ugt i64 %4, 3
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %7, %3 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ keyClip(unsigned char, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void menuClip(int item) { keyClip((unsigned char)item, 0, 0); }


x86 assembly (clang, -O0):
<menuClip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
movzbl %al,%edi
mov    %edx,%esi
call   1030 <keyClip@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menuClip>:
movzbl %dil,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <keyClip@plt>

LLVM IR (-O0):
define void @menuClip(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = call i32 @keyClip(i8 zeroext %4, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @menuClip(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i32 @keyClip(i8 zeroext %2, i32 0, i32 0)
ret void
}
int fb() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fb() {
ret i32 0
}
OP(fd, c2) {
  illegal_1();
  op_c2();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_c2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_c2@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_c2()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_c2()
ret i32 undef
}
void test_112(unsigned short *x, unsigned int *y) { y[0] = x[1] >> 13; }


x86 assembly (clang, -O0):
<test_112>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl 0x2(%rax),%ecx
sar    $0xd,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_112>:
movzwl 0x2(%rdi),%eax
shr    $0xd,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @test_112(i16* %0, i32* %1) {
%3 = alloca i16*
%4 = alloca i32*
store i16* %0, i16** %3
store i32* %1, i32** %4
%5 = load i16*, i16** %3
%6 = getelementptr inbounds i16, i16* %5, i64 1
%7 = load i16, i16* %6
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 13
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @test_112(i16* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i16, i16* %0, i64 1
%4 = load i16, i16* %3
%5 = lshr i16 %4, 13
%6 = zext i16 %5 to i32
store i32 %6, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prompts_2();
int main() {
  prompts_2();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @prompts_2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @prompts_2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ my_exit(int *);
void EGS_EXIT_(int *status) { my_exit(status); }


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

x86 assembly (clang, -O2):
<EGS_EXIT_>:
jmp    1030 <my_exit@plt>

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

LLVM IR (-O2):
define void @EGS_EXIT_(i32* %0) {
%2 = tail call i32 @my_exit(i32* %0)
ret void
}
void cam_glint_detach() {}


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

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

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

LLVM IR (-O2):
define void @cam_glint_detach() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Course: EG1302A - Spring 2014\n");
  printf("Name: Adriana Cortez-Jauregui\n");
  printf("Date Created: %d/%d/%d\n", 1, 28, 2014);
  printf("Assignment: Assignment05");
  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    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
mov    $0x1,%esi
mov    $0x1c,%edx
mov    $0x7de,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef7(%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    0xf09(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1b(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
mov    $0x1,%esi
mov    $0x1c,%edx
mov    $0x7de,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Course: EG1302A - Spring 2014\0A\00"
@.str.1 = [31 x i8] c"Name: Adriana Cortez-Jauregui\0A\00"
@.str.2 = [24 x i8] c"Date Created: %d/%d/%d\0A\00"
@.str.3 = [25 x i8] c"Assignment: Assignment05\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 28, i32 2014)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [24 x i8] c"Date Created: %d/%d/%d\0A\00"
@.str.3 = [25 x i8] c"Assignment: Assignment05\00"
@str = [30 x i8] c"Course: EG1302A - Spring 2014\00"
@str.4 = [30 x i8] c"Name: Adriana Cortez-Jauregui\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 28, i32 2014)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, char *, char *);
void AVRCP_ResponseSink_AVTransport_GetTransportInfo(
    struct UPnPService *Service, int ErrorCode, void *User,
    char *CurrentTransportState, char *CurrentTransportStatus,
    char *CurrentSpeed) {
  printf("AVRCP_ Invoke Response: "
         "AVTransport/GetTransportInfo[ErrorCode:%d](%s,%s,%s)\r\n",
         ErrorCode, CurrentTransportState, CurrentTransportStatus,
         CurrentSpeed);
}


x86 assembly (clang, -O0):
<AVRCP_ResponseSink_AVTransport_GetTransportInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AVRCP_ResponseSink_AVTransport_GetTransportInfo>:
lea    0xee9(%rip),%rdi
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %r9,%r8
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [79 x i8] c"AVRCP_ Invoke Response: AVTransport/GetTransportInfo[ErrorCode:%d](%s,%s,%s)\0D\0A\00"
define void @AVRCP_ResponseSink_AVTransport_GetTransportInfo(%struct.UPnPService* %0, i32 %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca %struct.UPnPService*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i32, i32* %8
%14 = load i8*, i8** %10
%15 = load i8*, i8** %11
%16 = load i8*, i8** %12
%17 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i32 %13, i8* %14, i8* %15, i8* %16)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [79 x i8] c"AVRCP_ Invoke Response: AVTransport/GetTransportInfo[ErrorCode:%d](%s,%s,%s)\0D\0A\00"
define void @AVRCP_ResponseSink_AVTransport_GetTransportInfo(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* %3, i8* %4, i8* %5) {
%7 = tail call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %3, i8* %4, i8* %5)
ret void
}
/* Variables and functions */
size_t objc_ext_alignof_type(char const *);
size_t objc_alignof_type(const char *type) {
  return objc_ext_alignof_type(type);
}


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

x86 assembly (clang, -O2):
<objc_alignof_type>:
jmp    1030 <objc_ext_alignof_type@plt>

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

LLVM IR (-O2):
define i64 @objc_alignof_type(i8* %0) {
%2 = tail call i64 @objc_ext_alignof_type(i8* %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ dfs(int *, int, int *, int, int);
void remove_edge(int t[], int e, bool g1[], bool g2[], int len) {
  dfs(t, e, g1, t[e], len);
  dfs(t, t[e], g2, e, len);
}


x86 assembly (clang, -O0):
<remove_edge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x24(%rbp),%r8d
call   1030 <dfs@plt>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x20(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x24(%rbp),%r8d
call   1030 <dfs@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_edge>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%r15d
mov    %rcx,%r14
mov    %rdi,%rbx
movslq %esi,%rbp
mov    (%rdi,%rbp,4),%ecx
mov    %ebp,%esi
call   1030 <dfs@plt>
mov    (%rbx,%rbp,4),%esi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %ebp,%ecx
mov    %r15d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <dfs@plt>

LLVM IR (-O0):
define void @remove_edge(i32* %0, i32 %1, i32* %2, i32* %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %6
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %10
%20 = call i32 @dfs(i32* %11, i32 %12, i32* %13, i32 %18, i32 %19)
%21 = load i32*, i32** %6
%22 = load i32*, i32** %6
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %22, i64 %24
%26 = load i32, i32* %25
%27 = load i32*, i32** %9
%28 = load i32, i32* %7
%29 = load i32, i32* %10
%30 = call i32 @dfs(i32* %21, i32 %26, i32* %27, i32 %28, i32 %29)
ret void
}

LLVM IR (-O2):
define void @remove_edge(i32* %0, i32 %1, i32* %2, i32* %3, i32 %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = tail call i32 @dfs(i32* %0, i32 %1, i32* %2, i32 %8, i32 %4)
%10 = load i32, i32* %7
%11 = tail call i32 @dfs(i32* %0, i32 %10, i32* %3, i32 %1, i32 %4)
ret void
}
int memRead16(const unsigned char *p) {
  unsigned int r = 0;
  r |= (unsigned int)(*(p + 0));
  r |= (unsigned int)(*(p + 1)) << 8;
  return r;
}


x86 assembly (clang, -O0):
<memRead16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memRead16>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @memRead16(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = load i32, i32* %3
%9 = or i32 %8, %7
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i32, i32* %3
%16 = or i32 %15, %14
store i32 %16, i32* %3
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @memRead16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int ascii_isdigit(const char inchar) {
  if (inchar > 0x2F && inchar < 0x3A)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ascii_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
jle    1130 <ascii_isdigit+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x3a,%eax
jge    1130 <ascii_isdigit+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <ascii_isdigit+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_isdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @ascii_isdigit(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sgt i32 %5, 47
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 58
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @ascii_isdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int ERR_isError(size_t);
unsigned FSE_isError(size_t code) { return ERR_isError(code); }


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

x86 assembly (clang, -O2):
<FSE_isError>:
jmp    1030 <ERR_isError@plt>

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

LLVM IR (-O2):
define i32 @FSE_isError(i64 %0) {
%2 = tail call i32 @ERR_isError(i64 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main() {
  unsigned getun();
  printf("%d\n", getun());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getun@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getun()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strncat(char *, char *, int);
int main(void) {
  char src[6] = "flores";
  char dst[12] = "victor";
  strncat(dst, src, 6);
  printf("%s\n", dst);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xebc(%rip),%rax
mov    %rax,-0x16(%rbp)
mov    0xeba(%rip),%eax
mov    %eax,-0xe(%rbp)
lea    -0x16(%rbp),%rdi
lea    -0xa(%rbp),%rsi
mov    $0x6,%edx
call   1040 <strncat@plt>
lea    -0x16(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movw   $0x7365,0xc(%rsp)
movl   $0x726f6c66,0x8(%rsp)
72
movabs $0x726f74636976,%rax
mov    %rax,0x10(%rsp)
movl   $0x0,0x18(%rsp)
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x6,%edx
call   1040 <strncat@plt>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.src = [6 x i8] c"flores"
@__const.main.dst = [12 x i8] c"victor\00\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca [12 x i8]
store i32 0, i32* %1
%4 = bitcast [6 x i8]* %2 to i8*
%5 = bitcast [12 x i8]* %3 to i8*
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%8 = call i32 @strncat(i8* %6, i8* %7, i32 6)
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.src = [6 x i8] c"flores"
@__const.main.dst = [12 x i8] c"victor\00\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [12 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = call i32 @strncat(i8* %4, i8* %3, i32 6)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}