xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(unsigned int);
int /*<<< orphan*/ stderr;
void *xmalloc(unsigned size) {
  void *p;
  if ((p = malloc(size)) != NULL)
    return p;
  fprintf(stderr, "Not enough memory, exit.\n");
  exit(2);
  return NULL;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     115b <xmalloc+0x2b>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xe95(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Not enough memory, exit.\0A\00"
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8*, i8** %3
ret i8* %8
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Not enough memory, exit.\0A\00"
define noalias i8* @xmalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
ret i8* %2
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void linear_root(int CoeffB, int CoeffC) {
  double linear_root;
  linear_root = ((double)-(CoeffC)) / (double)CoeffB;
  printf("The line has a zero at x = %.3lf", linear_root);
  printf("\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\n");
  return;
}


x86 assembly (clang, -O0):
<linear_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xebf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_root>:
push   %rax
neg    %esi
cvtsi2sd %esi,%xmm0
cvtsi2sd %edi,%xmm1
divsd  %xmm1,%xmm0
lea    0xeca(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"The line has a zero at x = %.3lf\00"
@.str.1 = [49 x i8] c"\0A-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\0A\0A\00"
define void @linear_root(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 0, %6
%8 = sitofp i32 %7 to double
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to double
%11 = fdiv double %8, %10
store double %11, double* %5
%12 = load double, double* %5
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), double %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"The line has a zero at x = %.3lf\00"
@str = [48 x i8] c"\0A-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\0A\00"
define void @linear_root(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %1
%4 = sitofp i32 %3 to double
%5 = sitofp i32 %0 to double
%6 = fdiv double %4, %5
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), double %6)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hfp_subevent_speaker_volume_get_status(const uint8_t *event) {
  return event[3];
}


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

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

LLVM IR (-O0):
define i32 @hfp_subevent_speaker_volume_get_status(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hfp_subevent_speaker_volume_get_status(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
struct ringbuf_t {
  int dummy;
};

/* Variables and functions */
scalar_t__ ringbuf_bytes_free(struct ringbuf_t const *);
scalar_t__ ringbuf_capacity(struct ringbuf_t const *);
int ringbuf_is_empty(const struct ringbuf_t *rb) {
  return ringbuf_bytes_free(rb) == ringbuf_capacity(rb);
}


x86 assembly (clang, -O0):
<ringbuf_is_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ringbuf_bytes_free@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ringbuf_capacity@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ringbuf_is_empty>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <ringbuf_bytes_free@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <ringbuf_capacity@plt>
xor    %ecx,%ecx
cmp    %rax,%r14
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ringbuf_t = type { i32 }
define i32 @ringbuf_is_empty(%struct.ringbuf_t* %0) {
%2 = alloca %struct.ringbuf_t*
store %struct.ringbuf_t* %0, %struct.ringbuf_t** %2
%3 = load %struct.ringbuf_t*, %struct.ringbuf_t** %2
%4 = call i64 @ringbuf_bytes_free(%struct.ringbuf_t* %3)
%5 = load %struct.ringbuf_t*, %struct.ringbuf_t** %2
%6 = call i64 @ringbuf_capacity(%struct.ringbuf_t* %5)
%7 = icmp eq i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.ringbuf_t = type { i32 }
define i32 @ringbuf_is_empty(%struct.ringbuf_t* %0) {
%2 = tail call i64 @ringbuf_bytes_free(%struct.ringbuf_t* %0)
%3 = tail call i64 @ringbuf_capacity(%struct.ringbuf_t* %0)
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void foo_1_1_1_2_2_2_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_2_2_2_2_1_2() {
ret void
}
int main() {
  unsigned long arg1 = 0x1000000000000000L;
  unsigned long arg2 = 0x1000000000000000L;
  unsigned long mulLo = 0;
  unsigned long mulHi = 0;
  __asm__("mulq %%rbx;" : "=a"(mulLo), "=d"(mulHi) : "a"(arg1), "b"(arg2));
  return (mulLo == 0) && (mulHi == 0x100000000000000L);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
movl   $0x0,-0xc(%rbp)
movabs $0x1000000000000000,%rax
mov    %rax,-0x18(%rbp)
movabs $0x1000000000000000,%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rbx
mul    %rbx
mov    %rax,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x28(%rbp)
mov    %al,-0x31(%rbp)
jne    116f <main+0x6f>
movabs $0x100000000000000,%rax
cmp    %rax,-0x30(%rbp)
sete   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movabs $0x1000000000000000,%rax
mov    %rax,%rbx
mul    %rbx
movabs $0x100000000000000,%rsi
xor    %rdx,%rsi
xor    %ecx,%ecx
or     %rax,%rsi
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
store i64 1152921504606846976, i64* %2
store i64 1152921504606846976, i64* %3
store i64 0, i64* %4
store i64 0, i64* %5
%6 = load i64, i64* %2
%7 = load i64, i64* %3
%8 = call { i64, i64 } asm "mulq %rbx;", "={ax},={dx},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i64 %6, i64 %7)
%9 = extractvalue { i64, i64 } %8, 0
%10 = extractvalue { i64, i64 } %8, 1
store i64 %9, i64* %4
store i64 %10, i64* %5
%11 = load i64, i64* %4
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %0
%14 = load i64, i64* %5
%15 = icmp eq i64 %14, 72057594037927936
br label %16
16: ; preds = %13, %0
%17 = phi i1 [ false, %0 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call { i64, i64 } asm "mulq %rbx;", "={ax},={dx},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i64 1152921504606846976, i64 1152921504606846976)
%2 = extractvalue { i64, i64 } %1, 0
%3 = extractvalue { i64, i64 } %1, 1
%4 = icmp eq i64 %2, 0
%5 = icmp eq i64 %3, 72057594037927936
%6 = select i1 %4, i1 %5, i1 false
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "date"
        " [+format]\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Usage: date [+format]\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [23 x i8] c"Usage: date [+format]\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Type definitions */
struct MP4DescriptorRecord {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct MP4DescriptorRecord *);
void destroy(struct MP4DescriptorRecord *self) { free(self); }


x86 assembly (clang, -O0):
<destroy>:
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):
<destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.MP4DescriptorRecord = type { i32 }
define void @destroy(%struct.MP4DescriptorRecord* nocapture %0) {
%2 = tail call i32 @free(%struct.MP4DescriptorRecord* %0)
ret void
}
void gtk_paned_pack2() {}


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

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

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

LLVM IR (-O2):
define void @gtk_paned_pack2() {
ret void
}
int ft_sqrt(int nbr) {
  int result;
  result = 1;
  while ((result * result) < nbr)
    result++;
  return (result);
}


x86 assembly (clang, -O0):
<ft_sqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112c <ft_sqrt+0x2c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <ft_sqrt+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_sqrt>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%eax
mov    %eax,%ecx
imul   %eax,%ecx
cmp    %edi,%ecx
jl     1110 <ft_sqrt+0x10>
ret

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

LLVM IR (-O2):
define i32 @ft_sqrt(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %6, %2 ]
%4 = mul nsw i32 %3, %3
%5 = icmp slt i32 %4, %0
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i32 %3
}
void cleanBuffer(char *buffer) {
  int i = 0;
  while (buffer[i] != '\0') {
    buffer[i] = '\0';
    i++;
  }
}


x86 assembly (clang, -O0):
<cleanBuffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     113e <cleanBuffer+0x3e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <cleanBuffer+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanBuffer>:
cmpb   $0x0,(%rdi)
je     111d <cleanBuffer+0x1d>
add    $0x1,%rdi
nopl   0x0(%rax)
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <cleanBuffer+0x10>
ret

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

LLVM IR (-O2):
define void @cleanBuffer(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
store i8 0, i8* %6
%7 = add nuw nsw i64 %5, 1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
int swap_matrix_row(char **m, int r1, int r2) {
  char *r = 0;
  if (!m)
    return -1;
  r = m[r1];
  m[r1] = m[r2];
  m[r2] = r;
  return 0;
}


x86 assembly (clang, -O0):
<swap_matrix_row>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    112d <swap_matrix_row+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <swap_matrix_row+0x6c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_matrix_row>:
test   %rdi,%rdi
je     111e <swap_matrix_row+0x1e>
movslq %esi,%rax
mov    (%rdi,%rax,8),%rcx
movslq %edx,%rdx
mov    (%rdi,%rdx,8),%rsi
mov    %rsi,(%rdi,%rax,8)
mov    %rcx,(%rdi,%rdx,8)
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @swap_matrix_row(i8** %0, i32 %1, i32 %2) {
%4 = icmp eq i8** %0, null
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8*, i8** %0, i64 %6
%8 = load i8*, i8** %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
store i8* %11, i8** %7
store i8* %8, i8** %10
br label %12
12: ; preds = %3, %5
%13 = phi i32 [ 0, %5 ], [ -1, %3 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ert_format_timestamp(struct timespec *, char *, size_t,
                                        int /*<<< orphan*/ *);
void ert_exif_format_date(struct timespec *ts, size_t length, char *string) {
  ert_format_timestamp(ts, "%Y:%m:%d", length, (uint8_t *)string);
}


x86 assembly (clang, -O0):
<ert_exif_format_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rsi
call   1030 <ert_format_timestamp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ert_exif_format_date>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <ert_format_timestamp@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@.str = [9 x i8] c"%Y:%m:%d\00"
define void @ert_exif_format_date(%struct.timespec* %0, i64 %1, i8* %2) {
%4 = alloca %struct.timespec*
%5 = alloca i64
%6 = alloca i8*
store %struct.timespec* %0, %struct.timespec** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load %struct.timespec*, %struct.timespec** %4
%8 = load i64, i64* %5
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to i32*
%11 = call i32 @ert_format_timestamp(%struct.timespec* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %8, i32* %10)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@.str = [9 x i8] c"%Y:%m:%d\00"
define void @ert_exif_format_date(%struct.timespec* %0, i64 %1, i8* %2) {
%4 = bitcast i8* %2 to i32*
%5 = tail call i32 @ert_format_timestamp(%struct.timespec* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %1, i32* %4)
ret void
}
int test_include_C(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @test_include_C() {
ret i32 1
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ doCriticalErrorAndQuit(char *);
int /*<<< orphan*/ exit(int);
void *simpleArrayCreateRelease(int ELEMENTS, int ESIZE) {
  void *array;
  array = (void *)calloc(ELEMENTS, ESIZE);
  if (NULL == array) {
    doCriticalErrorAndQuit(
        "\nsimpleArrayCreateRelease: Memory error. Aborting!");
    exit(1);
  }
  return array;
}


x86 assembly (clang, -O0):
<simpleArrayCreateRelease>:
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 <calloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    116f <simpleArrayCreateRelease+0x3f>
lea    0xea0(%rip),%rdi
call   1040 <doCriticalErrorAndQuit@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simpleArrayCreateRelease>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <simpleArrayCreateRelease+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <doCriticalErrorAndQuit@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"\0AsimpleArrayCreateRelease: Memory error. Aborting!\00"
define i8* @simpleArrayCreateRelease(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i64 @calloc(i32 %6, i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp eq i8* null, %10
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @doCriticalErrorAndQuit(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@.str = [51 x i8] c"\0AsimpleArrayCreateRelease: Memory error. Aborting!\00"
define i8* @simpleArrayCreateRelease(i32 %0, i32 %1) {
%3 = tail call i64 @calloc(i32 %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @doCriticalErrorAndQuit(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = inttoptr i64 %3 to i8*
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ foo(int /*<<< orphan*/, int);
int main(void) {
  foo(0, 1);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 0, i32 1)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0, i32 1)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double BounceEaseIn(double);
double BounceEaseOut(double);
double BounceEaseInOut(double p) {
  if (p < 0.5) {
    return 0.5 * BounceEaseIn(p * 2);
  } else {
    return 0.5 * BounceEaseOut(p * 2 - 1) + 0.5;
  }
}


x86 assembly (clang, -O0):
<BounceEaseInOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xecb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    116b <BounceEaseInOut+0x4b>
movsd  0xec8(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <BounceEaseIn@plt>
movaps %xmm0,%xmm1
movsd  0xea3(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119a <BounceEaseInOut+0x7a>
movsd  -0x10(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xe8c(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <BounceEaseOut@plt>
movsd  0xe73(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BounceEaseInOut>:
push   %rax
movsd  0xed7(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1142 <BounceEaseInOut+0x22>
addsd  %xmm0,%xmm0
call   1030 <BounceEaseIn@plt>
mulsd  0xec0(%rip),%xmm0
pop    %rax
ret
addsd  %xmm0,%xmm0
addsd  0xeba(%rip),%xmm0
call   1040 <BounceEaseOut@plt>
movsd  0xea5(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @BounceEaseInOut(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 5.000000e-01
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load double, double* %3
%8 = fmul double %7, 2.000000e+00
%9 = call double @BounceEaseIn(double %8)
%10 = fmul double 5.000000e-01, %9
store double %10, double* %2
br label %16
11: ; preds = %1
%12 = load double, double* %3
%13 = call double @llvm.fmuladd.f64(double %12, double 2.000000e+00, double -1.000000e+00)
%14 = call double @BounceEaseOut(double %13)
%15 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %14, double 5.000000e-01)
store double %15, double* %2
br label %16
16: ; preds = %11, %6
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @BounceEaseInOut(double %0) {
%2 = fcmp olt double %0, 5.000000e-01
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fmul double %0, 2.000000e+00
%5 = tail call double @BounceEaseIn(double %4)
%6 = fmul double %5, 5.000000e-01
br label %11
7: ; preds = %1
%8 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double -1.000000e+00)
%9 = tail call double @BounceEaseOut(double %8)
%10 = tail call double @llvm.fmuladd.f64(double %9, double 5.000000e-01, double 5.000000e-01)
br label %11
11: ; preds = %7, %3
%12 = phi double [ %6, %3 ], [ %10, %7 ]
ret double %12
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, size_t, char const *, int /*<<< orphan*/);
int c_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
  return vsnprintf(str, size, format, ap);
}


x86 assembly (clang, -O0):
<c_vsnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_vsnprintf>:
jmp    1030 <vsnprintf@plt>

LLVM IR (-O0):
define i32 @c_vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @vsnprintf(i8* %9, i64 %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @c_vsnprintf(i8* nocapture %0, i64 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Type definitions */
struct Chip8 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Chip8 *);
void chip8_free(struct Chip8 *chip8) { free(chip8); }


x86 assembly (clang, -O0):
<chip8_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):
<chip8_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.Chip8 = type { i32 }
define void @chip8_free(%struct.Chip8* nocapture %0) {
%2 = tail call i32 @free(%struct.Chip8* %0)
ret void
}
/* Type definitions */
struct device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pm_runtime_init(struct device *);
void device_pm_init(struct device *dev) { pm_runtime_init(dev); }


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

x86 assembly (clang, -O2):
<device_pm_init>:
jmp    1030 <pm_runtime_init@plt>

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

LLVM IR (-O2):
%struct.device = type { i32 }
define void @device_pm_init(%struct.device* %0) {
%2 = tail call i32 @pm_runtime_init(%struct.device* %0)
ret void
}
/* Type definitions */
struct cl_rhash {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cl_rhash_move_lower(struct cl_rhash *);
scalar_t__ cl_rhash_should_move_lower(struct cl_rhash *);
void cl_rhash_check_move_lower(struct cl_rhash *hash) {
  if (cl_rhash_should_move_lower(hash))
    cl_rhash_move_lower(hash);
}


x86 assembly (clang, -O0):
<cl_rhash_check_move_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <cl_rhash_should_move_lower@plt>
cmp    $0x0,%rax
je     1148 <cl_rhash_check_move_lower+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <cl_rhash_move_lower@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cl_rhash_check_move_lower>:
push   %rbx
mov    %rdi,%rbx
call   1040 <cl_rhash_should_move_lower@plt>
test   %rax,%rax
je     1137 <cl_rhash_check_move_lower+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <cl_rhash_move_lower@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.cl_rhash = type { i32 }
define void @cl_rhash_check_move_lower(%struct.cl_rhash* %0) {
%2 = alloca %struct.cl_rhash*
store %struct.cl_rhash* %0, %struct.cl_rhash** %2
%3 = load %struct.cl_rhash*, %struct.cl_rhash** %2
%4 = call i64 @cl_rhash_should_move_lower(%struct.cl_rhash* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.cl_rhash*, %struct.cl_rhash** %2
%8 = call i32 @cl_rhash_move_lower(%struct.cl_rhash* %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.cl_rhash = type { i32 }
define void @cl_rhash_check_move_lower(%struct.cl_rhash* %0) {
%2 = tail call i64 @cl_rhash_should_move_lower(%struct.cl_rhash* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @cl_rhash_move_lower(%struct.cl_rhash* %0)
br label %6
6: ; preds = %4, %1
ret void
}
unsigned long blargg_min(unsigned long x, unsigned long y) {
  if (y < x)
    x = y;
  return x;
}


x86 assembly (clang, -O0):
<blargg_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1122 <blargg_min+0x22>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blargg_min>:
mov    %rdi,%rax
cmp    %rdi,%rsi
cmovb  %rsi,%rax
ret

LLVM IR (-O0):
define i64 @blargg_min(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 = icmp ult i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %4
store i64 %9, i64* %3
br label %10
10: ; preds = %8, %2
%11 = load i64, i64* %3
ret i64 %11
}

LLVM IR (-O2):
define i64 @blargg_min(i64 %0, i64 %1) {
%3 = icmp ult i64 %1, %0
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
int ieor_(int *i, int *j) { return *i ^ *j; }


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

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

LLVM IR (-O0):
define i32 @ieor_(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = xor i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @ieor_(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = xor i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void print_version() {
  printf("wx v%s\n", ("0.1.0"));
  exit(0);
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed9(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"wx v%s\0A\00"
@.str.1 = [6 x i8] c"0.1.0\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"wx v%s\0A\00"
@.str.1 = [6 x i8] c"0.1.0\00"
define void @print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_space(size_t depth) {
  for (size_t i = 0; i < depth; i++) {
    printf("  ");
  }
}


x86 assembly (clang, -O0):
<print_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    114f <print_space+0x3f>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <print_space+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_space>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     113e <print_space+0x2e>
mov    %rdi,%rbx
lea    0xedd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
jne    1130 <print_space+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @print_space(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = add nuw i64 %5, 1
%8 = icmp eq i64 %7, %0
br i1 %8, label %3, label %4
}
/* Variables and functions */
int /*<<< orphan*/ ComputeDiffWeights();
int /*<<< orphan*/ RealisePreselectedSet();
void ConstructPreselectedSet() {
  ComputeDiffWeights();
  RealisePreselectedSet();
}


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

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

LLVM IR (-O0):
define void @ConstructPreselectedSet() {
%1 = call i32 (...) @ComputeDiffWeights()
%2 = call i32 (...) @RealisePreselectedSet()
ret void
}

LLVM IR (-O2):
define void @ConstructPreselectedSet() {
%1 = tail call i32 (...) @ComputeDiffWeights()
%2 = tail call i32 (...) @RealisePreselectedSet()
ret void
}
int output_frames_src_48_to_8_total(int input_frames) {
  if ((input_frames % 6) != 0)
    return -1;
  return input_frames / 6;
}


x86 assembly (clang, -O0):
<output_frames_src_48_to_8_total>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1127 <output_frames_src_48_to_8_total+0x27>
movl   $0xffffffff,-0x4(%rbp)
jmp    1135 <output_frames_src_48_to_8_total+0x35>
mov    -0x8(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_frames_src_48_to_8_total>:
imul   $0xaaaaaaab,%edi,%ecx
add    $0x2aaaaaaa,%ecx
ror    %ecx
mov    $0xffffffff,%eax
cmp    $0x2aaaaaaa,%ecx
jbe    111c <output_frames_src_48_to_8_total+0x1c>
ret
movslq %edi,%rax
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @output_frames_src_48_to_8_total(i32 %0) {
%2 = srem i32 %0, 6
%3 = icmp eq i32 %2, 0
%4 = sdiv i32 %0, 6
%5 = select i1 %3, i32 %4, i32 -1
ret i32 %5
}
void glMultMatrixx(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glMultMatrixx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *upload_file(char *path) {
  printf("upload_file: %s\n", path);
  return "upload_file.......... %s", path;
}


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

x86 assembly (clang, -O2):
<upload_file>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"upload_file: %s\0A\00"
define i8* @upload_file(i8* returned %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %0
}
void *_mls(int ln, const char *fn, const char *fun, int h, int i) {
  _mlsdb_caller(__FUNCTION__, ln, fn, fun, 3, h, i, 0);
  return mls(h, i);
}


x86 assembly (clang, -O0):
<_mls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r9d
mov    -0x20(%rbp),%eax
lea    0xead(%rip),%rdi
mov    $0x3,%r8d
xor    %r10d,%r10d
mov    %eax,(%rsp)
movl   $0x0,0x8(%rsp)
mov    $0x0,%al
call   1030 <_mlsdb_caller@plt>
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    $0x0,%al
call   1040 <mls@plt>
cltq
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mls>:
push   %rbp
push   %rbx
push   %rax
mov    %r8d,%ebx
mov    %ecx,%ebp
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xec9(%rip),%rdi
mov    $0x3,%r8d
mov    %ebp,%r9d
xor    %eax,%eax
push   $0x0
push   %rbx
call   1030 <_mlsdb_caller@plt>
add    $0x10,%rsp
mov    %ebp,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <mls@plt>
cltq
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@__FUNCTION__._mls = [5 x i8] c"_mls\00"
define i8* @_mls(i32 %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 (i8*, i32, i8*, i8*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @_mlsdb_caller to i32 (i8*, i32, i8*, i8*, i32, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__._mls, i64 0, i64 0), i32 %0, i8* %1, i8* %2, i32 3, i32 %3, i32 %4, i32 0)
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @mls to i32 (i32, i32, ...)*)(i32 %3, i32 %4)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int /*<<< orphan*/ IntDisable(int);
int /*<<< orphan*/ IntUnregister(int);
void WatchdogIntUnregister(unsigned long ulBase) {
  DEBUG_ASSERT((ulBase == 0x40000000) || (ulBase == 0x40001000));
  IntDisable(34);
  IntUnregister(34);
}


x86 assembly (clang, -O0):
<WatchdogIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x40000000,-0x8(%rbp)
40
mov    %al,-0x9(%rbp)
je     115d <WatchdogIntUnregister+0x2d>
cmpq   $0x40001000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    $0x22,%edi
call   1030 <IntDisable@plt>
mov    $0x22,%edi
call   1050 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogIntUnregister>:
push   %rax
and    $0xffffffffffffefff,%rdi
xor    %eax,%eax
cmp    $0x40000000,%rdi
sete   %al
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    $0x22,%edi
call   1030 <IntDisable@plt>
mov    $0x22,%edi
pop    %rax
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @WatchdogIntUnregister(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1073741824
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 1073745920
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = call i32 @IntDisable(i32 34)
%13 = call i32 @IntUnregister(i32 34)
ret void
}

LLVM IR (-O2):
define void @WatchdogIntUnregister(i64 %0) {
%2 = and i64 %0, -4097
%3 = icmp eq i64 %2, 1073741824
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = tail call i32 @IntDisable(i32 34)
%7 = tail call i32 @IntUnregister(i32 34)
ret void
}
void ASN1_get_object(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_get_object() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() {
  int x = 1;
  int y = 2;
  if (x == y) {
    printf("x equals y.\n");
  } else {
    printf("x is not equal to y.\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1143 <main+0x33>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
jmp    114f <main+0x3f>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"x equals y.\0A\00"
@.str.1 = [22 x i8] c"x is not equal to y.\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %1
store i32 2, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"x is not equal to y.\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int check_args(int argc, char **argv) {
  (void)argv;
  if (2 != argc) {
    fprintf(stderr, "ERROR - invalid number of arguments - expected 2\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%eax
cmp    -0x8(%rbp),%eax
je     114e <check_args+0x3e>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1155 <check_args+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_args>:
xor    %eax,%eax
cmp    $0x2,%edi
je     1136 <check_args+0x26>
push   %rax
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"ERROR - invalid number of arguments - expected 2\0A\00"
define i32 @check_args(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 2, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"ERROR - invalid number of arguments - expected 2\0A\00"
define i32 @check_args(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %8
}
void startints() { asm("sti"); }


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

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

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

LLVM IR (-O2):
define void @startints() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}