xunge/DecIR huggingface dataset:
void swap(int *pa, int *pb) {
  int temp;
  temp = *pa;
  *pa = *pb;
  *pb = temp;
}


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

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

LLVM IR (-O0):
define void @swap(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** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
void INT_Excep_QSPI_SPRI(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_QSPI_SPRI() {
ret void
}
unsigned get_secure_buffer_size(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_secure_buffer_size() {
ret i32 0
}
/* Type definitions */
typedef char uint8_t;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ _write(int, char *, int);
void oled_sleep_set(int fd, bool val) {
  uint8_t buf[] = {'S', 'O', 'O', val ? 1 : 0};
  _write(fd, buf, sizeof(buf));
}


x86 assembly (clang, -O0):
<oled_sleep_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movb   $0x53,-0xc(%rbp)
movb   $0x4f,-0xb(%rbp)
movb   $0x4f,-0xa(%rbp)
mov    -0x8(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,-0x9(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oled_sleep_set>:
push   %rax
movw   $0x4f53,0x4(%rsp)
movb   $0x4f,0x6(%rsp)
test   %esi,%esi
setne  0x7(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <_write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @oled_sleep_set(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [4 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
store i8 83, i8* %6
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8 79, i8* %7
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 79, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
%14 = trunc i32 %13 to i8
store i8 %14, i8* %9
%15 = load i32, i32* %3
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%17 = call i32 @_write(i32 %15, i8* %16, i32 4)
ret void
}

LLVM IR (-O2):
define void @oled_sleep_set(i32 %0, i32 %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 83, i8* %4
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 79, i8* %5
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 79, i8* %6
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%8 = icmp ne i32 %1, 0
%9 = zext i1 %8 to i8
store i8 %9, i8* %7
%10 = call i32 @_write(i32 %0, i8* %4, i32 4)
ret void
}
void matrixAdd() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_xfsz()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, int, char *);
void warning(char *file, int line, int column, char *msg) {
  printf("\n%s:%d:%d: warning: %s\n", file, line, column, msg);
}


x86 assembly (clang, -O0):
<warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warning>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xedf(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"\0A%s:%d:%d: warning: %s\0A\00"
define void @warning(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10, i32 %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0A%s:%d:%d: warning: %s\0A\00"
define void @warning(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %2, i8* %3)
ret void
}
int d_bge_rm1(double a1, double *a2) {
  return (__builtin_isgreaterequal(a1, *a2));
}


x86 assembly (clang, -O0):
<d_bge_rm1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_bge_rm1>:
xor    %eax,%eax
ucomisd (%rdi),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @d_bge_rm1(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double, double* %3
%6 = load double*, double** %4
%7 = load double, double* %6
%8 = fcmp oge double %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @d_bge_rm1(double %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fcmp ole double %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ translate(char *);
int main(int argc, char **argv) {
  int i;
  i = 1;
  while (i++ < argc)
    translate(argv[i - 1]);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
cmp    -0x8(%rbp),%eax
jge    115c <main+0x4c>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <translate@plt>
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
add    $0x1,%rbx
call   1030 <translate@plt>
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
br label %7
7: ; preds = %12, %2
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 1
store i32 %9, i32* %6
%10 = load i32, i32* %4
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %20
12: ; preds = %7
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %13, i64 %16
%18 = load i8*, i8** %17
%19 = call i32 @translate(i8* %18)
br label %7
20: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %8, %6 ]
%8 = add nuw nsw i64 %7, 1
%9 = getelementptr inbounds i8*, i8** %1, i64 %7
%10 = load i8*, i8** %9
%11 = tail call i32 @translate(i8* %10)
%12 = icmp eq i64 %8, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ send_event;
};
struct TYPE_4__ {
  TYPE_1__ xkey;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xkey_send_event(void *_p) {
  return (int)((XEvent *)_p)->xkey.send_event;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XEvent_xkey_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int test_imm_FCint8_reg(signed char val) {
  return ((val) & (-0xFC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FCint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff04,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FCint8_reg>:
test   $0xffffff04,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FCint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -252
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ wagner_fischer(char *, char *);
int main(int argc, char *argv[]) {
  if (argc == 3)
    printf("%lu\n", wagner_fischer(argv[1], argv[2]));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    1163 <main+0x43>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <wagner_fischer@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x3,%edi
jne    1145 <main+0x25>
push   %rax
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1040 <wagner_fischer@plt>
lea    0xec6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @wagner_fischer(i8* %6, i8* %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %4, %2
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void CRCConfigSet(uint32_t ui32Base, uint32_t ui32CRCConfig) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000400))) = ui32CRCConfig;
}


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

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

LLVM IR (-O0):
define void @CRCConfigSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 1024
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @CRCConfigSet(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 1024
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int errno;
int /*<<< orphan*/ fatal_error_with_errno(char *);
int pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   void *(*)(void *), void *);
pthread_t create_thread(void *(*proc)(void *), void *params) {
  int result;
  pthread_t t;
  result = pthread_create(&t, NULL, proc, params);
  if (result) {
    errno = result;
    fatal_error_with_errno("Failed to create new thread");
  }
  return t;
}


x86 assembly (clang, -O0):
<create_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_create@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     116a <create_thread+0x4a>
mov    -0x14(%rbp),%ecx
mov    0x2e84(%rip),%rax
mov    %ecx,(%rax)
lea    0xe9b(%rip),%rdi
call   1030 <fatal_error_with_errno@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_thread>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0x4(%rsp),%rdi
xor    %esi,%esi
call   1040 <pthread_create@plt>
test   %eax,%eax
je     114c <create_thread+0x2c>
mov    0x2ea2(%rip),%rcx
mov    %eax,(%rcx)
lea    0xeb9(%rip),%rdi
call   1030 <fatal_error_with_errno@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
@.str = [28 x i8] c"Failed to create new thread\00"
define i32 @create_thread(i8* (i8*)* %0, i8* %1) {
%3 = alloca i8* (i8*)*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* (i8*)* %0, i8* (i8*)** %3
store i8* %1, i8** %4
%7 = load i8* (i8*)*, i8* (i8*)** %3
%8 = load i8*, i8** %4
%9 = call i32 @pthread_create(i32* %6, i32* null, i8* (i8*)* %7, i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* %5
store i32 %13, i32* @errno
%14 = call i32 @fatal_error_with_errno(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %12, %2
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [28 x i8] c"Failed to create new thread\00"
define i32 @create_thread(i8* (i8*)* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @pthread_create(i32* %3, i32* null, i8* (i8*)* %0, i8* %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
store i32 %5, i32* @errno
%8 = call i32 @fatal_error_with_errno(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = load i32, i32* %3
ret i32 %10
}
const char *stress_1_get_description(void) {
  return "Create a file named stress_1_test_file_pid, "
         "where pid is the process id. "
         "The size is given by the -z or --size option, "
         "otherwise it defaults to 1000000. "
         "The file will be deleted if the delete option "
         "is specified. ";
}


x86 assembly (clang, -O0):
<stress_1_get_description>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_1_get_description>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [214 x i8] c"Create a file named stress_1_test_file_pid, where pid is the process id. The size is given by the -z or --size option, otherwise it defaults to 1000000. The file will be deleted if the delete option is specified. \00"
define i8* @stress_1_get_description() {
ret i8* getelementptr inbounds ([214 x i8], [214 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [214 x i8] c"Create a file named stress_1_test_file_pid, where pid is the process id. The size is given by the -z or --size option, otherwise it defaults to 1000000. The file will be deleted if the delete option is specified. \00"
define i8* @stress_1_get_description() {
ret i8* getelementptr inbounds ([214 x i8], [214 x i8]* @.str, i64 0, i64 0)
}
void copy(float *origen, float *destino) {
  int i;
  for (i = 0; i < 3; i++) {
    destino[i] = origen[i];
  }
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    1145 <copy+0x45>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <copy+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
movss  (%rdi),%xmm0
movss  %xmm0,(%rsi)
movss  0x4(%rdi),%xmm0
movss  %xmm0,0x4(%rsi)
movss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rsi)
ret

LLVM IR (-O0):
define void @copy(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i32
store float* %0, float** %3
store float* %1, float** %4
store i32 0, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = load float*, float** %3
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds float, float* %10, i64 %12
%14 = load float, float* %13
%15 = load float*, float** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float, float* %15, i64 %17
store float %14, float* %18
br label %19
19: ; preds = %9
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @copy(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
store float %3, float* %1
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %1, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 2
store float %8, float* %9
ret void
}
/* Variables and functions */
void *receive_data(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @receive_data() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @receive_data() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ hanoi(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("n = ");
  scanf("%d", &n);
  hanoi(0, 1, n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edx
xor    %edi,%edi
mov    $0x1,%esi
call   1050 <hanoi@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"n = \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @hanoi(i32 0, i32 1, i32 %5)
ret i32 0
}
/* Type definitions */
struct fastbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bwrite(struct fastbuf *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void bputs(struct fastbuf *f, const char *b) { bwrite(f, b, strlen(b)); }


x86 assembly (clang, -O0):
<bputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <bwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bputs>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <bwrite@plt>

LLVM IR (-O0):
%struct.fastbuf = type { i32 }
define void @bputs(%struct.fastbuf* %0, i8* %1) {
%3 = alloca %struct.fastbuf*
%4 = alloca i8*
store %struct.fastbuf* %0, %struct.fastbuf** %3
store i8* %1, i8** %4
%5 = load %struct.fastbuf*, %struct.fastbuf** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @bwrite(%struct.fastbuf* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.fastbuf = type { i32 }
define void @bputs(%struct.fastbuf* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @bwrite(%struct.fastbuf* %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BUG();
void flush_tlb_all(void) { BUG(); }


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

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

LLVM IR (-O0):
define void @flush_tlb_all() {
%1 = call i32 (...) @BUG()
ret void
}

LLVM IR (-O2):
define void @flush_tlb_all() {
%1 = tail call i32 (...) @BUG()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_message(char *, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
void log_client_connection(int socket_fd) {
  char message[1024];
  sprintf(message, "New connection with socket file descriptor #%d", socket_fd);
  log_message(message, 6);
}


x86 assembly (clang, -O0):
<log_client_connection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec1(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x410(%rbp),%rdi
mov    $0x6,%esi
call   1030 <log_message@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_client_connection>:
push   %rbx
sub    $0x400,%rsp
mov    %edi,%edx
lea    0xecf(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <log_message@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"New connection with socket file descriptor #%d\00"
define void @log_client_connection(i32 %0) {
%2 = alloca i32
%3 = alloca [1024 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call i32 @log_message(i8* %7, i32 6)
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"New connection with socket file descriptor #%d\00"
define void @log_client_connection(i32 %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @log_message(i8* %3, i32 6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 2;
  int *p = &x;
  printf("O endereço de X e: %p\n", (void *)p);
  printf("O valor de X e: %d\n", *p);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x2,0x4(%rsp)
lea    0x4(%rsp),%rsi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"O endere\C3\A7o de X e: %p\0A\00"
@.str.1 = [20 x i8] c"O valor de X e: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 2, i32* %1
store i32* %1, i32** %2
%3 = load i32*, i32** %2
%4 = bitcast i32* %3 to i8*
%5 = ptrtoint i8* %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"O endere\C3\A7o de X e: %p\0A\00"
@.str.1 = [20 x i8] c"O valor de X e: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 2, i32* %1
%3 = ptrtoint i32* %1 to i64
%4 = trunc i64 %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp) {}


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

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

LLVM IR (-O0):
%struct.sock = type opaque
%struct.sk_filter = type opaque
define void @sk_filter_uncharge(%struct.sock* %0, %struct.sk_filter* %1) {
%3 = alloca %struct.sock*
%4 = alloca %struct.sk_filter*
store %struct.sock* %0, %struct.sock** %3
store %struct.sk_filter* %1, %struct.sk_filter** %4
ret void
}

LLVM IR (-O2):
%struct.sock = type opaque
%struct.sk_filter = type opaque
define void @sk_filter_uncharge(%struct.sock* nocapture %0, %struct.sk_filter* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ddotsub(int const *, double const *, int const *,
                           double const *, int const *, double *);
double c_ddot(const int N, const double *X, const int strideX, const double *Y,
              const int strideY) {
  double dot;
  ddotsub(&N, X, &strideX, Y, &strideY, &dot);
  return dot;
}


x86 assembly (clang, -O0):
<c_ddot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
lea    -0x24(%rbp),%r8
lea    -0x30(%rbp),%r9
call   1030 <ddotsub@plt>
movsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_ddot>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
mov    %edx,0x8(%rsp)
mov    %r8d,0x4(%rsp)
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%r8
lea    0x10(%rsp),%r9
call   1030 <ddotsub@plt>
movsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @c_ddot(i32 %0, double* %1, i32 %2, double* %3, i32 %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca i32
%9 = alloca double*
%10 = alloca i32
%11 = alloca double
store i32 %0, i32* %6
store double* %1, double** %7
store i32 %2, i32* %8
store double* %3, double** %9
store i32 %4, i32* %10
%12 = load double*, double** %7
%13 = load double*, double** %9
%14 = call i32 @ddotsub(i32* %6, double* %12, i32* %8, double* %13, i32* %10, double* %11)
%15 = load double, double* %11
ret double %15
}

LLVM IR (-O2):
define double @c_ddot(i32 %0, double* %1, i32 %2, double* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
store i32 %0, i32* %6
store i32 %2, i32* %7
store i32 %4, i32* %8
%10 = bitcast double* %9 to i8*
%11 = call i32 @ddotsub(i32* %6, double* %1, i32* %7, double* %3, i32* %8, double* %9)
%12 = load double, double* %9
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char *, char *, int);
void set_single_threaded_BLAS(void) { setenv("OMP_NUM_THREADS", "1", 1); }


x86 assembly (clang, -O0):
<set_single_threaded_BLAS>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeee(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_single_threaded_BLAS>:
lea    0xee9(%rip),%rdi
lea    0xef2(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <setenv@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"OMP_NUM_THREADS\00"
@.str.1 = [2 x i8] c"1\00"
define void @set_single_threaded_BLAS() {
%1 = call i32 @setenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"OMP_NUM_THREADS\00"
@.str.1 = [2 x i8] c"1\00"
define void @set_single_threaded_BLAS() {
%1 = tail call i32 @setenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) { printf("usage: image_mm bzImage major# minor#\n"); }


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"usage: image_mm bzImage major# minor#\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"usage: image_mm bzImage major# minor#\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int M_PI;
int fatorial(int);
int /*<<< orphan*/ printf(char *, int, double);
double rad_to_deg(int);
int main() {
  int fat = fatorial(3);
  double ang = rad_to_deg(2 * M_PI);
  printf("%d %lf\n", fat, ang);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1040 <fatorial@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
shl    $0x1,%edi
call   1050 <rad_to_deg@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%edi
call   1040 <fatorial@plt>
mov    %eax,%ebx
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
add    %edi,%edi
call   1050 <rad_to_deg@plt>
lea    0xeac(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@M_PI = global i32 0
@.str = [8 x i8] c"%d %lf\0A\00"
define i32 @main() {
%1 = tail call i32 @fatorial(i32 3)
%2 = load i32, i32* @M_PI
%3 = shl nsw i32 %2, 1
%4 = tail call double @rad_to_deg(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1, double %4)
ret i32 0
}
const char *loader_AF_get_type(void) { return "AF"; }


x86 assembly (clang, -O0):
<loader_AF_get_type>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<loader_AF_get_type>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"AF\00"
define i8* @loader_AF_get_type() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [3 x i8] c"AF\00"
define i8* @loader_AF_get_type() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ arg_proc(int, char **);
int /*<<< orphan*/ clear();
int /*<<< orphan*/ draw();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ init();
int /*<<< orphan*/ mainloop();
int main(int ac, char **av) {
  arg_proc(ac, av);
  init();
  draw();
  mainloop();
  clear();
  endwin();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <arg_proc@plt>
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x0,%al
call   1030 <draw@plt>
mov    $0x0,%al
call   1070 <mainloop@plt>
mov    $0x0,%al
call   1080 <clear@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1050 <arg_proc@plt>
xor    %eax,%eax
call   1040 <init@plt>
xor    %eax,%eax
call   1030 <draw@plt>
xor    %eax,%eax
call   1070 <mainloop@plt>
xor    %eax,%eax
call   1080 <clear@plt>
xor    %eax,%eax
call   1060 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @arg_proc(i32 %6, i8** %7)
%9 = call i32 (...) @init()
%10 = call i32 (...) @draw()
%11 = call i32 (...) @mainloop()
%12 = call i32 (...) @clear()
%13 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @arg_proc(i32 %0, i8** %1)
%4 = tail call i32 (...) @init()
%5 = tail call i32 (...) @draw()
%6 = tail call i32 (...) @mainloop()
%7 = tail call i32 (...) @clear()
%8 = tail call i32 (...) @endwin()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i;
  for (i = 10; i > 0; i--)
    printf("Hello, World!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct yaffs_obj {
  int dummy;
};

/* Variables and functions */
struct yaffs_obj *yaffsfs_DoFindDirectory(struct yaffs_obj *, char const *,
                                          char **, int, int *, int *);
struct yaffs_obj *yaffsfs_FindDirectory(struct yaffs_obj *relDir,
                                        const char *path, char **name,
                                        int symDepth, int *notDir, int *loop) {
  return yaffsfs_DoFindDirectory(relDir, path, name, symDepth, notDir, loop);
}


x86 assembly (clang, -O0):
<yaffsfs_FindDirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <yaffsfs_DoFindDirectory@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaffsfs_FindDirectory>:
jmp    1030 <yaffsfs_DoFindDirectory@plt>

LLVM IR (-O0):
%struct.yaffs_obj = type { i32 }
define %struct.yaffs_obj* @yaffsfs_FindDirectory(%struct.yaffs_obj* %0, i8* %1, i8** %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca %struct.yaffs_obj*
%8 = alloca i8*
%9 = alloca i8**
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
store %struct.yaffs_obj* %0, %struct.yaffs_obj** %7
store i8* %1, i8** %8
store i8** %2, i8*** %9
store i32 %3, i32* %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load %struct.yaffs_obj*, %struct.yaffs_obj** %7
%14 = load i8*, i8** %8
%15 = load i8**, i8*** %9
%16 = load i32, i32* %10
%17 = load i32*, i32** %11
%18 = load i32*, i32** %12
%19 = call %struct.yaffs_obj* @yaffsfs_DoFindDirectory(%struct.yaffs_obj* %13, i8* %14, i8** %15, i32 %16, i32* %17, i32* %18)
ret %struct.yaffs_obj* %19
}

LLVM IR (-O2):
%struct.yaffs_obj = type { i32 }
define %struct.yaffs_obj* @yaffsfs_FindDirectory(%struct.yaffs_obj* %0, i8* %1, i8** %2, i32 %3, i32* %4, i32* %5) {
%7 = tail call %struct.yaffs_obj* @yaffsfs_DoFindDirectory(%struct.yaffs_obj* %0, i8* %1, i8** %2, i32 %3, i32* %4, i32* %5)
ret %struct.yaffs_obj* %7
}
/* Variables and functions */
int OK;
int PDC_set_cursor_mode(int startrow, int endrow) { return (OK); }


x86 assembly (clang, -O0):
<PDC_set_cursor_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ecf(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@OK = global i32 0
define i32 @PDC_set_cursor_mode(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @OK
ret i32 %5
}

LLVM IR (-O2):
@OK = global i32 0
define i32 @PDC_set_cursor_mode(i32 %0, i32 %1) {
%3 = load i32, i32* @OK
ret i32 %3
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int arr[], int indexS, int indexF) {
  if (indexS < indexF) {
    int indexM = partition(arr, indexS, indexF);
    quick_sort(arr, indexS, indexM - 1);
    quick_sort(arr, indexM + 1, indexF);
  }
  return;
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int bah(int /*<<< orphan*/, int);
int /*<<< orphan*/ do_other_stuff();
int top1(int q) {
  do_other_stuff();
  return bah(0, q);
}


x86 assembly (clang, -O0):
<top1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <do_other_stuff@plt>
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1040 <bah@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<top1>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <do_other_stuff@plt>
xor    %edi,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <bah@plt>

LLVM IR (-O0):
define i32 @top1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @do_other_stuff()
%4 = load i32, i32* %2
%5 = call i32 @bah(i32 0, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @top1(i32 %0) {
%2 = tail call i32 (...) @do_other_stuff()
%3 = tail call i32 @bah(i32 0, i32 %0)
ret i32 %3
}