xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void _gfortran_caf_fail_image(void) {
  fputs("IMAGE FAILED!\n", stderr);
  exit(0);
}


x86 assembly (clang, -O0):
<_gfortran_caf_fail_image>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_gfortran_caf_fail_image>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"IMAGE FAILED!\0A\00"
@stderr = global i32 0
define void @_gfortran_caf_fail_image() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"IMAGE FAILED!\0A\00"
@stderr = global i32 0
define void @_gfortran_caf_fail_image() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
double dBbp0b(double x) { return -1.0; }


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

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

LLVM IR (-O0):
define double @dBbp0b(double %0) {
%2 = alloca double
store double %0, double* %2
ret double -1.000000e+00
}

LLVM IR (-O2):
define double @dBbp0b(double %0) {
ret double -1.000000e+00
}
int __attribute__((regparm(3))) g1(int x, int y, int z) {
  return x * 9 + y * 3 + z;
}


x86 assembly (clang, -O0):
<g1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x9,-0x4(%rbp),%eax
imul   $0x3,-0x8(%rbp),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g1>:
lea    (%rdi,%rdi,8),%ecx
lea    (%rsi,%rsi,2),%eax
add    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @g1(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 9
%9 = load i32, i32* %5
%10 = mul nsw i32 %9, 3
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @g1(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 9
%5 = mul nsw i32 %1, 3
%6 = add nsw i32 %5, %4
%7 = add nsw i32 %6, %2
ret i32 %7
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *, int);
void main(void) {
  int c;
  int i = 0;
  while (c != '\n') {
    c = getchar();
    if (c == 10)
      ++i;
  }
  printf("El numero de lineas es: %i\n", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x4(%rbp)
je     115b <main+0x3b>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    1156 <main+0x36>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <main+0xf>
mov    -0x8(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %esi,%esi
cmp    $0xa,%eax
sete   %al
jne    1130 <main+0x10>
mov    %al,%sil
lea    0xeb5(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [28 x i8] c"El numero de lineas es: %i\0A\00"
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ %6, %1 ], [ 0, %0 ]
%3 = tail call i32 (...) @getchar()
%4 = icmp eq i32 %3, 10
%5 = zext i1 %4 to i32
%6 = add nuw nsw i32 %2, %5
br i1 %4, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
int calc_dias(int anos, int meses, int dias) {
  return (anos * 360) + (meses * 30) + (dias);
}


x86 assembly (clang, -O0):
<calc_dias>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x168,-0x4(%rbp),%eax
imul   $0x1e,-0x8(%rbp),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_dias>:
imul   $0x168,%edi,%ecx
mov    %esi,%eax
shl    $0x5,%eax
sub    %esi,%eax
sub    %esi,%eax
add    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @calc_dias(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 360
%9 = load i32, i32* %5
%10 = mul nsw i32 %9, 30
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @calc_dias(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 360
%5 = mul nsw i32 %1, 30
%6 = add nsw i32 %5, %4
%7 = add nsw i32 %6, %2
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ expanded;

/* Variables and functions */
int /*<<< orphan*/ b_gets(int, char *);
int /*<<< orphan*/ b_lineid(int);
int /*<<< orphan*/ displ_text(int, int /*<<< orphan*/, int, char *);
int expand(char *, char *, int);
void display(int row, int line) {
  int nsegs;
  char buf[1000 - 1], expanded[1000 + 100];
  b_gets(line, buf);
  nsegs = expand(expanded, buf, sizeof(expanded));
  displ_text(row, b_lineid(line), nsegs, expanded);
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x860,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x400(%rbp),%rsi
call   1040 <b_gets@plt>
lea    -0x850(%rbp),%rdi
lea    -0x400(%rbp),%rsi
mov    $0x44c,%edx
call   1060 <expand@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x854(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <b_lineid@plt>
mov    -0x854(%rbp),%edi
mov    %eax,%esi
mov    -0xc(%rbp),%edx
lea    -0x850(%rbp),%rcx
call   1050 <displ_text@plt>
add    $0x860,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x848,%rsp
mov    %esi,%ebx
mov    %edi,%r14d
mov    %rsp,%rbp
mov    %esi,%edi
mov    %rbp,%rsi
call   1040 <b_gets@plt>
lea    0x3f0(%rsp),%r15
mov    %r15,%rdi
mov    %rbp,%rsi
mov    $0x44c,%edx
call   1060 <expand@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <b_lineid@plt>
mov    %r14d,%edi
mov    %eax,%esi
mov    %ebp,%edx
mov    %r15,%rcx
call   1050 <displ_text@plt>
add    $0x848,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @display(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [999 x i8]
%7 = alloca [1100 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = getelementptr inbounds [999 x i8], [999 x i8]* %6, i64 0, i64 0
%10 = call i32 @b_gets(i32 %8, i8* %9)
%11 = getelementptr inbounds [1100 x i8], [1100 x i8]* %7, i64 0, i64 0
%12 = getelementptr inbounds [999 x i8], [999 x i8]* %6, i64 0, i64 0
%13 = call i32 @expand(i8* %11, i8* %12, i32 1100)
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @b_lineid(i32 %15)
%17 = load i32, i32* %5
%18 = getelementptr inbounds [1100 x i8], [1100 x i8]* %7, i64 0, i64 0
%19 = call i32 @displ_text(i32 %14, i32 %16, i32 %17, i8* %18)
ret void
}

LLVM IR (-O2):
define void @display(i32 %0, i32 %1) {
%3 = alloca [999 x i8]
%4 = alloca [1100 x i8]
%5 = getelementptr inbounds [999 x i8], [999 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [1100 x i8], [1100 x i8]* %4, i64 0, i64 0
%7 = call i32 @b_gets(i32 %1, i8* %5)
%8 = call i32 @expand(i8* %6, i8* %5, i32 1100)
%9 = call i32 @b_lineid(i32 %1)
%10 = call i32 @displ_text(i32 %0, i32 %9, i32 %8, i8* %6)
ret void
}
void gconfig(void) {}


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

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

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

LLVM IR (-O2):
define void @gconfig() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dup(int);
int main() {
  dup(1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @dup(i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t FlashAllUserRegisterSet(uint32_t ui32User0, uint32_t ui32User1,
                                uint32_t ui32User2, uint32_t ui32User3) {
  (*((volatile uint32_t *)(0x400FE1E0))) = ui32User0;
  (*((volatile uint32_t *)(0x400FE1E4))) = ui32User1;
  (*((volatile uint32_t *)(0x400FE1E8))) = ui32User2;
  (*((volatile uint32_t *)(0x400FE1EC))) = ui32User3;
  return (0);
}


x86 assembly (clang, -O0):
<FlashAllUserRegisterSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x400fe1e0,%eax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
mov    $0x400fe1e4,%eax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    $0x400fe1e8,%eax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%ecx
mov    $0x400fe1ec,%eax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashAllUserRegisterSet>:
mov    %edi,0x400fe1e0
mov    %esi,0x400fe1e4
mov    %edx,0x400fe1e8
mov    %ecx,0x400fe1ec
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @FlashAllUserRegisterSet(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
store volatile i32 %9, i32* inttoptr (i64 1074782688 to i32*)
%10 = load i32, i32* %6
store volatile i32 %10, i32* inttoptr (i64 1074782692 to i32*)
%11 = load i32, i32* %7
store volatile i32 %11, i32* inttoptr (i64 1074782696 to i32*)
%12 = load i32, i32* %8
store volatile i32 %12, i32* inttoptr (i64 1074782700 to i32*)
ret i32 0
}

LLVM IR (-O2):
define i32 @FlashAllUserRegisterSet(i32 %0, i32 %1, i32 %2, i32 %3) {
store volatile i32 %0, i32* inttoptr (i64 1074782688 to i32*)
store volatile i32 %1, i32* inttoptr (i64 1074782692 to i32*)
store volatile i32 %2, i32* inttoptr (i64 1074782696 to i32*)
store volatile i32 %3, i32* inttoptr (i64 1074782700 to i32*)
ret i32 0
}
/* Type definitions */
struct sockaddr {
  int /*<<< orphan*/ sa_family;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ get_in_addr(struct sockaddr *);
int /*<<< orphan*/ *inet_ntop(int /*<<< orphan*/, int /*<<< orphan*/, char *,
                              int /*<<< orphan*/);
char *get_ip_str(struct sockaddr *sa, char *s, ssize_t maxlen) {
  if (inet_ntop(sa->sa_family, get_in_addr((struct sockaddr *)sa), s, maxlen) ==
      NULL) {
    return NULL;
  }
  return s;
}


x86 assembly (clang, -O0):
<get_ip_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <get_in_addr@plt>
mov    -0x20(%rbp),%edi
mov    %eax,%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <inet_ntop@plt>
cmp    $0x0,%rax
jne    116d <get_ip_str+0x4d>
movq   $0x0,-0x8(%rbp)
jmp    1175 <get_ip_str+0x55>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ip_str>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    (%rdi),%ebp
call   1040 <get_in_addr@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
mov    %r14d,%ecx
call   1030 <inet_ntop@plt>
test   %rax,%rax
cmovne %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i8* @get_ip_str(%struct.sockaddr* %0, i8* %1, i32 %2) {
%4 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %0, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @get_in_addr(%struct.sockaddr* %0)
%7 = tail call i32* @inet_ntop(i32 %5, i32 %6, i8* %1, i32 %2)
%8 = icmp eq i32* %7, null
%9 = select i1 %8, i8* null, i8* %1
ret i8* %9
}
odds(attack, defend) int attack, defend;
{
  int result;
  result = (defend > 0) ? attack / defend + 1 : 6;
  if (result > 6)
    result = 6;
  if (result == 1)
    result = (2 * attack < defend) ? 0 : 1;
  return (result);
}


x86 assembly (clang, -O0):
<odds>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1126 <odds+0x26>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <odds+0x33>
mov    $0x6,%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <odds+0x33>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jle    114a <odds+0x4a>
movl   $0x6,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    116c <odds+0x6c>
mov    -0x4(%rbp),%edx
shl    $0x1,%edx
mov    -0x8(%rbp),%esi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<odds>:
mov    $0x6,%ecx
test   %esi,%esi
jle    1124 <odds+0x24>
mov    %edi,%eax
cltd
idiv   %esi
cmp    $0x4,%eax
jg     1124 <odds+0x24>
lea    0x1(%rax),%edx
add    %edi,%edi
xor    %ecx,%ecx
cmp    %esi,%edi
setge  %cl
test   %eax,%eax
cmovne %edx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @odds(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = sdiv i32 %0, %1
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = add nsw i32 %5, 1
%9 = icmp eq i32 %5, 0
%10 = shl nsw i32 %0, 1
%11 = icmp sge i32 %10, %1
%12 = zext i1 %11 to i32
%13 = select i1 %9, i32 %12, i32 %8
br label %14
14: ; preds = %7, %2, %4
%15 = phi i32 [ 6, %4 ], [ 6, %2 ], [ %13, %7 ]
ret i32 %15
}
void glEnd(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glEnd() {
ret void
}
/* Variables and functions */
long random();
long int RandomVal(void) { return random(); }


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

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

LLVM IR (-O0):
define i64 @RandomVal() {
%1 = call i64 (...) @random()
ret i64 %1
}

LLVM IR (-O2):
define i64 @RandomVal() {
%1 = tail call i64 (...) @random()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_signal_init() {
  printf("NOT IMPLEMENTED:"
         "pa_signal_init"
         "\n");
}


x86 assembly (clang, -O0):
<pa_signal_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"NOT IMPLEMENTED:pa_signal_init\0A\00"
define i32 @pa_signal_init() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_signal_init\00"
define i32 @pa_signal_init() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int rand();
int rand_val(void) {
  int val;
  int i;
  val = (rand() & 0x000000ff);
  for (i = 0; i < (sizeof(int)); i++) {
    val = val << 8;
    val += (rand() & 0x000000ff);
  }
  return val;
}


x86 assembly (clang, -O0):
<rand_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x4,%rax
jae    1165 <rand_val+0x55>
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xff,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <rand_val+0x1e>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_val>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
shl    $0x18,%ebx
movzbl %bpl,%ecx
shl    $0x10,%ecx
or     %ebx,%ecx
shl    $0x8,%eax
movzwl %ax,%ebx
or     %ecx,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
movzbl %al,%eax
or     %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rand_val() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @rand()
%4 = and i32 %3, 255
store i32 %4, i32* %1
store i32 0, i32* %2
br label %5
5: ; preds = %16, %0
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = icmp ult i64 %7, 4
br i1 %8, label %9, label %19
9: ; preds = %5
%10 = load i32, i32* %1
%11 = shl i32 %10, 8
store i32 %11, i32* %1
%12 = call i32 (...) @rand()
%13 = and i32 %12, 255
%14 = load i32, i32* %1
%15 = add nsw i32 %14, %13
store i32 %15, i32* %1
br label %16
16: ; preds = %9
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %5
19: ; preds = %5
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
define i32 @rand_val() {
%1 = tail call i32 (...) @rand()
%2 = tail call i32 (...) @rand()
%3 = tail call i32 (...) @rand()
%4 = tail call i32 (...) @rand()
%5 = shl i32 %2, 24
%6 = shl i32 %3, 16
%7 = and i32 %6, 16711680
%8 = or i32 %5, %7
%9 = shl i32 %4, 8
%10 = and i32 %9, 65280
%11 = or i32 %8, %10
%12 = tail call i32 (...) @rand()
%13 = and i32 %12, 255
%14 = or i32 %13, %11
ret i32 %14
}
char atoi_reverse(int n) {
  char c = (char)n + '0';
  return c;
}


x86 assembly (clang, -O0):
<atoi_reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%eax
add    $0x30,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi_reverse>:
lea    0x30(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @atoi_reverse(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
%6 = sext i8 %5 to i32
%7 = add nsw i32 %6, 48
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %3
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @atoi_reverse(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 48
ret i8 %3
}
/* Variables and functions */
int exp(double);
double sinh(double x) { return (exp(x) - exp(-x)) / 2; }


x86 assembly (clang, -O0):
<sinh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinh>:
push   %rbx
sub    $0x10,%rsp
movaps %xmm0,(%rsp)
call   1030 <exp@plt>
mov    %eax,%ebx
movaps (%rsp),%xmm0
xorps  0xed5(%rip),%xmm0
call   1030 <exp@plt>
sub    %eax,%ebx
mov    %ebx,%eax
shr    $0x1f,%eax
add    %ebx,%eax
sar    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @sinh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @exp(double %3)
%5 = load double, double* %2
%6 = fneg double %5
%7 = call i32 @exp(double %6)
%8 = sub nsw i32 %4, %7
%9 = sdiv i32 %8, 2
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @sinh(double %0) {
%2 = tail call i32 @exp(double %0)
%3 = fneg double %0
%4 = tail call i32 @exp(double %3)
%5 = sub nsw i32 %2, %4
%6 = sdiv i32 %5, 2
%7 = sitofp i32 %6 to double
ret double %7
}
/* Type definitions */
struct svc_req {
  int dummy;
};
struct rpc_msg {
  int dummy;
};
typedef enum auth_stat { ____Placeholder_auth_stat } auth_stat;

/* Variables and functions */
int AUTH_REJECTEDCRED;
enum auth_stat _svcauth_short(struct svc_req *rqst, struct rpc_msg *msg) {
  return (AUTH_REJECTEDCRED);
}


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

x86 assembly (clang, -O2):
<_svcauth_short>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.svc_req = type { i32 }
%struct.rpc_msg = type { i32 }
@AUTH_REJECTEDCRED = global i32 0
define i32 @_svcauth_short(%struct.svc_req* %0, %struct.rpc_msg* %1) {
%3 = alloca %struct.svc_req*
%4 = alloca %struct.rpc_msg*
store %struct.svc_req* %0, %struct.svc_req** %3
store %struct.rpc_msg* %1, %struct.rpc_msg** %4
%5 = load i32, i32* @AUTH_REJECTEDCRED
ret i32 %5
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
%struct.rpc_msg = type { i32 }
@AUTH_REJECTEDCRED = global i32 0
define i32 @_svcauth_short(%struct.svc_req* nocapture readnone %0, %struct.rpc_msg* nocapture readnone %1) {
%3 = load i32, i32* @AUTH_REJECTEDCRED
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmplt_epi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_cmplt_epi8(__m128i A, __m128i B) {
  return _mm_cmplt_epi8(A, B);
}


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

x86 assembly (clang, -O2):
<test_mm_cmplt_epi8>:
jmp    1030 <_mm_cmplt_epi8@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmplt_epi8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmplt_epi8(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
int main(void) {
  int vec[3] = {1, 2, 3};
  printf("La direccion de memoria del primer elemento es:%p\n", vec);
  printf("La direccion de memoria del primer elemento es:%p\n", &vec[0]);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0xeeb(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xed8(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xed8(%rip),%rbx
lea    0x8(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.vec = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [51 x i8] c"La direccion de memoria del primer elemento es:%p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
store i32 0, i32* %1
%3 = bitcast [3 x i32]* %2 to i8*
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32* %4)
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.vec = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [51 x i8] c"La direccion de memoria del primer elemento es:%p\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32* %3)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateRTCEnable(void) {
  (*((volatile uint32_t *)(0x400FC010))) |= 0x00000001;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateRTCEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc010,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x400fc010,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateRTCEnable>:
orl    $0x1,0x400fc010
01
xor    %eax,%eax
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateRTCEnable() {
%1 = load volatile i32, i32* inttoptr (i64 1074774032 to i32*)
%2 = or i32 %1, 1
store volatile i32 %2, i32* inttoptr (i64 1074774032 to i32*)
%3 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateRTCEnable() {
%1 = load volatile i32, i32* inttoptr (i64 1074774032 to i32*)
%2 = or i32 %1, 1
store volatile i32 %2, i32* inttoptr (i64 1074774032 to i32*)
%3 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
/* Variables and functions */
long atol(char *);
long calc_fib_last_digit(long);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ stdin;
int main() {
  long n = 0;
  long fib;
  char buffer[100];
  fgets(buffer, 100, stdin);
  n = atol(buffer);
  fib = calc_fib_last_digit(n);
  printf("%ld\n", fib);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1040 <fgets@plt>
lea    -0x80(%rbp),%rdi
call   1060 <atol@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <calc_fib_last_digit@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1060 <atol@plt>
mov    %rax,%rdi
call   1050 <calc_fib_last_digit@plt>
lea    0xe8b(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca [100 x i8]
store i32 0, i32* %1
store i64 0, i64* %2
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %5, i32 100, i32 %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%9 = call i64 @atol(i8* %8)
store i64 %9, i64* %2
%10 = load i64, i64* %2
%11 = call i64 @calc_fib_last_digit(i64 %10)
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %12)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 100, i32 %3)
%5 = call i64 @atol(i8* %2)
%6 = call i64 @calc_fib_last_digit(i64 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %6)
ret i32 0
}
/* Variables and functions */
int inb(int);
int ioperm(int, int, int);
int /*<<< orphan*/ outb(int, int);
int main(void) {
  int ret;
  ret = ioperm(0x80, 1, 1);
  if (ret < 0)
    return 1;
  ret = inb(0x80);
  outb(0xff, 0x80);
  (void)ioperm(0x80, 1, 0);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x80,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <ioperm@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1169 <main+0x39>
movl   $0x1,-0x4(%rbp)
jmp    119c <main+0x6c>
mov    $0x80,%edi
call   1050 <inb@plt>
mov    %eax,-0x8(%rbp)
mov    $0xff,%edi
mov    $0x80,%esi
call   1030 <outb@plt>
mov    $0x80,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <ioperm@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x80,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1040 <ioperm@plt>
test   %eax,%eax
js     1179 <main+0x49>
mov    $0x80,%edi
call   1050 <inb@plt>
mov    %eax,%ebx
mov    $0xff,%edi
mov    $0x80,%esi
call   1030 <outb@plt>
mov    $0x80,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <ioperm@plt>
mov    %ebx,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @ioperm(i32 128, i32 1, i32 1)
%2 = icmp slt i32 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 @inb(i32 128)
%5 = tail call i32 @outb(i32 255, i32 128)
%6 = tail call i32 @ioperm(i32 128, i32 1, i32 0)
br label %7
7: ; preds = %0, %3
%8 = phi i32 [ %4, %3 ], [ 1, %0 ]
ret i32 %8
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int vencedor(char *p1, char *p2) {
  if (strcmp(p1, p2) == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<vencedor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1143 <vencedor+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <vencedor+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @vencedor(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 = load i8*, i8** %5
%8 = call i64 @strcmp(i8* %6, i8* %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @vencedor(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct dns_packet {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct dns_packet *);
void dns_p_free(struct dns_packet *P) { free(P); }


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

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

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

LLVM IR (-O2):
%struct.dns_packet = type { i32 }
define void @dns_p_free(%struct.dns_packet* nocapture %0) {
%2 = tail call i32 @free(%struct.dns_packet* %0)
ret void
}
void music_sheet_get_iter_by_progress(struct music_sheet *self, float progress,
                                      struct music_sheet_iter *iter) {}


x86 assembly (clang, -O0):
<music_sheet_get_iter_by_progress>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.music_sheet = type opaque
%struct.music_sheet_iter = type opaque
define void @music_sheet_get_iter_by_progress(%struct.music_sheet* %0, float %1, %struct.music_sheet_iter* %2) {
%4 = alloca %struct.music_sheet*
%5 = alloca float
%6 = alloca %struct.music_sheet_iter*
store %struct.music_sheet* %0, %struct.music_sheet** %4
store float %1, float* %5
store %struct.music_sheet_iter* %2, %struct.music_sheet_iter** %6
ret void
}

LLVM IR (-O2):
%struct.music_sheet = type opaque
%struct.music_sheet_iter = type opaque
define void @music_sheet_get_iter_by_progress(%struct.music_sheet* nocapture %0, float %1, %struct.music_sheet_iter* nocapture %2) {
ret void
}
/* Variables and functions */
scalar_t__ isspace(char const);
char *skipspaces(const char *str) {
  while (isspace(*str))
    str++;
  return (char *)str;
}


x86 assembly (clang, -O0):
<skipspaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skipspaces+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipspaces+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipspaces>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skipspaces+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skipspaces(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @isspace(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @skipspaces(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test38_Test0_pollen__run__E() { printf("hello out there"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"hello out there\00"
define void @test38_Test0_pollen__run__E() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"hello out there\00"
define void @test38_Test0_pollen__run__E() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int js_bound(int m_ext) {
  static int jsb_table[4] = {4, 8, 12, 16};
  if (m_ext < 0 || m_ext > 3) {
    fprintf(stderr, "js_bound bad modext (%d)\n", m_ext);
    exit(1);
  }
  return (jsb_table[m_ext]);
}


x86 assembly (clang, -O0):
<js_bound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     113f <js_bound+0x1f>
cmpl   $0x3,-0x4(%rbp)
jle    1161 <js_bound+0x41>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xeae(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
movslq -0x4(%rbp),%rcx
lea    0x2ed4(%rip),%rax
mov    (%rax,%rcx,4),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<js_bound>:
push   %rax
mov    %edi,%edx
cmp    $0x4,%edi
jae    1136 <js_bound+0x16>
mov    %edx,%eax
lea    0xecf(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@js_bound.jsb_table = internal global [4 x i32] [i32 4, i32 8, i32 12, i32 16]
@stderr = global i32 0
@.str = [26 x i8] c"js_bound bad modext (%d)\0A\00"
define i32 @js_bound(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 3
br i1 %7, label %8, label %13
8: ; preds = %5, %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %5
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [4 x i32], [4 x i32]* @js_bound.jsb_table, i64 0, i64 %15
%17 = load i32, i32* %16
ret i32 %17
}

LLVM IR (-O2):
@js_bound.jsb_table = internal unnamed_addr constant [4 x i32] [i32 4, i32 8, i32 12, i32 16]
@stderr = global i32 0
@.str = [26 x i8] c"js_bound bad modext (%d)\0A\00"
define i32 @js_bound(i32 %0) {
%2 = icmp ugt i32 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = zext i32 %0 to i64
%9 = getelementptr inbounds [4 x i32], [4 x i32]* @js_bound.jsb_table, i64 0, i64 %8
%10 = load i32, i32* %9
ret i32 %10
}
/* Variables and functions */
double floor(double);
double floorw(double v) { return floor(v); }


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

x86 assembly (clang, -O2):
<floorw>:
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @floorw(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.floor.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @floorw(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
ret double %2
}
void g_value_array_copy() {}


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

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

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

LLVM IR (-O2):
define void @g_value_array_copy() {
ret void
}
/* Variables and functions */
double M_PI;
double sin(double);
double sinc(double x) { return sin(M_PI * x) / (M_PI * x); }


x86 assembly (clang, -O0):
<sinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ec4(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
mov    0x2eaf(%rip),%rax
movsd  (%rax),%xmm1
mulsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinc>:
push   %rbx
sub    $0x10,%rsp
movapd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
mov    0x2ec2(%rip),%rbx
movsd  (%rbx),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  0x8(%rsp),%xmm1
mulsd  (%rbx),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @sinc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* @M_PI
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = call double @sin(double %5)
%7 = load double, double* @M_PI
%8 = load double, double* %2
%9 = fmul double %7, %8
%10 = fdiv double %6, %9
ret double %10
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @sinc(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %2, %0
%4 = tail call double @sin(double %3)
%5 = load double, double* @M_PI
%6 = fmul double %5, %0
%7 = fdiv double %4, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ ft_itoa(int);
int /*<<< orphan*/ ft_putstr(int /*<<< orphan*/);
void ft_putnbr(int n) { ft_putstr(ft_itoa(n)); }


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

x86 assembly (clang, -O2):
<ft_putnbr>:
push   %rax
call   1030 <ft_itoa@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <ft_putstr@plt>

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

LLVM IR (-O2):
define void @ft_putnbr(i32 %0) {
%2 = tail call i32 @ft_itoa(i32 %0)
%3 = tail call i32 @ft_putstr(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int i;
  for (i = 0; i < 65536; i += 32)
    printf("int foo%04x (void) { return %d; }\n", i, i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x10000,-0x8(%rbp)
jge    1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffe0,%ebx
lea    0xee0(%rip),%r14
add    $0x20,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
cmp    $0xffe0,%ebx
jb     1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [35 x i8] c"int foo%04x (void) { return %d; }\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 32
%5 = icmp ult i32 %2, 65504
br i1 %5, label %1, label %6
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
double atanh(double);
double avgMagnetization(double beta) {
  double M;
  double betaMuB = beta * 1.0 * 1.0;
  M = 1 * 1.0 * (atanh(betaMuB) - 1.0 / (betaMuB));
  return M;
}


x86 assembly (clang, -O0):
<avgMagnetization>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <atanh@plt>
movaps %xmm0,%xmm1
movsd  0xeb0(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe9f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avgMagnetization>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <atanh@plt>
movsd  0xedd(%rip),%xmm1
divsd  (%rsp),%xmm1
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @avgMagnetization(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fmul double %5, 1.000000e+00
%7 = fmul double %6, 1.000000e+00
store double %7, double* %4
%8 = load double, double* %4
%9 = call double @atanh(double %8)
%10 = load double, double* %4
%11 = fdiv double 1.000000e+00, %10
%12 = fsub double %9, %11
%13 = fmul double 1.000000e+00, %12
store double %13, double* %3
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @avgMagnetization(double %0) {
%2 = tail call double @atanh(double %0)
%3 = fdiv double 1.000000e+00, %0
%4 = fsub double %2, %3
ret double %4
}