xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void tabuada(int num) {
  for (int i = 1; i <= num; i++) {
    printf("%d x %d = %d\n", i, num, i * num);
  }
}


x86 assembly (clang, -O0):
<tabuada>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1155 <tabuada+0x45>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
imul   -0x4(%rbp),%ecx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <tabuada+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tabuada>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edi,%edi
jle    1165 <tabuada+0x55>
mov    %edi,%r15d
mov    %edi,%r12d
neg    %r12d
mov    $0x1,%ebx
lea    0xecf(%rip),%r14
mov    %edi,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %ebp,%ecx
call   1030 <printf@plt>
lea    (%r12,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
add    %r15d,%ebp
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1140 <tabuada+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"%d x %d = %d\0A\00"
define void @tabuada(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %4
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = mul nsw i32 %5, %0
%7 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %0, i32 %6)
%8 = add nuw i32 %5, 1
%9 = icmp eq i32 %5, %0
br i1 %9, label %3, label %4
}
double multiply(double x, double y) { return x * y; }


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

x86 assembly (clang, -O2):
<multiply>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @multiply(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 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @multiply(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int restore_quaddobl_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(668, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<restore_quaddobl_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x29c,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restore_quaddobl_solutions>:
mov    $0x29c,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @restore_quaddobl_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 668, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @restore_quaddobl_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 668, i32* undef, i32* undef, double* undef)
ret i32 %1
}
double sdot(const double a[2], const double b[2]) {
  return a[0] * b[0] + a[1] * b[1];
}


x86 assembly (clang, -O0):
<sdot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdot>:
movsd  0x8(%rdi),%xmm1
mulsd  0x8(%rsi),%xmm1
movsd  (%rdi),%xmm0
mulsd  (%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sdot(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 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
ret double %18
}

LLVM IR (-O2):
define double @sdot(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage:\n");
  printf(" db_hide <database in> <database out> <tihm number>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [53 x i8] c" db_hide <database in> <database out> <tihm number>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.2 = [52 x i8] c" db_hide <database in> <database out> <tihm number>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char toupper(char);
void strupr(char *str) {
  while (*str) {
    *str = toupper(*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <strupr+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <strupr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <strupr+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strupr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @strupr(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 i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AccumulatorGetValue();
int /*<<< orphan*/ MemoryWrite_At_(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ OperandGetValue();
void Store(void) { MemoryWrite_At_(AccumulatorGetValue(), OperandGetValue()); }


x86 assembly (clang, -O0):
<Store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <AccumulatorGetValue@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <OperandGetValue@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1050 <MemoryWrite_At_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Store>:
push   %rbx
xor    %eax,%eax
call   1030 <AccumulatorGetValue@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <OperandGetValue@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1050 <MemoryWrite_At_@plt>

LLVM IR (-O0):
define void @Store() {
%1 = call i32 (...) @AccumulatorGetValue()
%2 = call i32 (...) @OperandGetValue()
%3 = call i32 @MemoryWrite_At_(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
define void @Store() {
%1 = tail call i32 (...) @AccumulatorGetValue()
%2 = tail call i32 (...) @OperandGetValue()
%3 = tail call i32 @MemoryWrite_At_(i32 %1, i32 %2)
ret void
}
/* Type definitions */
struct pci_dev {
  int dummy;
};

/* Variables and functions */
int EINVAL;
int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<pci_cleanup_aer_uncorrect_error_status>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_cleanup_aer_uncorrect_error_status>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.pci_dev = type { i32 }
@EINVAL = global i32 0
define i32 @pci_cleanup_aer_uncorrect_error_status(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
%struct.pci_dev = type { i32 }
@EINVAL = global i32 0
define i32 @pci_cleanup_aer_uncorrect_error_status(%struct.pci_dev* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) {
  if (islower(c)) {
    return c - 'a' + 'A';
  } else {
    return c;
  }
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113e <toupper+0x2e>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <toupper+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @islower(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 97
%10 = add nsw i32 %9, 65
store i32 %10, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* %3
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glPopMatrix();
void popView(void) {
  glPopMatrix();
  glMatrixMode(GL_MODELVIEW);
  glPopMatrix();
}


x86 assembly (clang, -O0):
<popView>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <glPopMatrix@plt>
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1040 <glPopMatrix@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<popView>:
push   %rax
xor    %eax,%eax
call   1040 <glPopMatrix@plt>
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glPopMatrix@plt>

LLVM IR (-O0):
@GL_MODELVIEW = global i32 0
define void @popView() {
%1 = call i32 (...) @glPopMatrix()
%2 = load i32, i32* @GL_MODELVIEW
%3 = call i32 @glMatrixMode(i32 %2)
%4 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
@GL_MODELVIEW = global i32 0
define void @popView() {
%1 = tail call i32 (...) @glPopMatrix()
%2 = load i32, i32* @GL_MODELVIEW
%3 = tail call i32 @glMatrixMode(i32 %2)
%4 = tail call i32 (...) @glPopMatrix()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int mem_write(int /*<<< orphan*/ *, char const *, int);
int strlen(char const *);
int mem_puts(BIO *bp, const char *str) {
  int n, ret;
  n = strlen(str);
  ret = mem_write(bp, str, n);
  return (ret);
}


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

x86 assembly (clang, -O2):
<mem_puts>:
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 <mem_write@plt>

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

LLVM IR (-O2):
define i32 @mem_puts(i32* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @mem_write(i32* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
double calc_time(clock_t start, clock_t end) {
  return ((double)(end - start)) / CLOCKS_PER_SEC;
}


x86 assembly (clang, -O0):
<calc_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2ec8(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_time>:
sub    %rdi,%rsi
cvtsi2sd %rsi,%xmm0
mov    0x2ed9(%rip),%rax
divsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @calc_time(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 = sub nsw i64 %5, %6
%8 = sitofp i64 %7 to double
%9 = load double, double* @CLOCKS_PER_SEC
%10 = fdiv double %8, %9
ret double %10
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @calc_time(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = sitofp i64 %3 to double
%5 = load double, double* @CLOCKS_PER_SEC
%6 = fdiv double %4, %5
ret double %6
}
_Bool qeihToBin(double q, double e, double i, double h, int bin[4]) {
  return qeiToBin(q, e, i, bin) && hToBin(h, bin + 3);
}


x86 assembly (clang, -O0):
<qeihToBin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    -0x28(%rbp),%rdi
mov    $0x3,%al
call   1030 <qeiToBin@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x29(%rbp)
je     1187 <qeihToBin+0x67>
movsd  -0x20(%rbp),%xmm0
mov    -0x28(%rbp),%rdi
add    $0xc,%rdi
mov    $0x1,%al
call   1040 <hToBin@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qeihToBin>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  %xmm3,0x8(%rsp)
mov    $0x3,%al
call   1030 <qeiToBin@plt>
test   %eax,%eax
je     1154 <qeihToBin+0x34>
add    $0xc,%rbx
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <hToBin@plt>
test   %eax,%eax
setne  %al
jmp    1156 <qeihToBin+0x36>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i1 @qeihToBin(double %0, double %1, double %2, double %3, i32* %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i32*
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store i32* %4, i32** %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = load double, double* %8
%14 = load i32*, i32** %10
%15 = call i32 (double, double, double, i32*, ...) bitcast (i32 (...)* @qeiToBin to i32 (double, double, double, i32*, ...)*)(double %11, double %12, double %13, i32* %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %5
%18 = load double, double* %9
%19 = load i32*, i32** %10
%20 = getelementptr inbounds i32, i32* %19, i64 3
%21 = call i32 (double, i32*, ...) bitcast (i32 (...)* @hToBin to i32 (double, i32*, ...)*)(double %18, i32* %20)
%22 = icmp ne i32 %21, 0
br label %23
23: ; preds = %17, %5
%24 = phi i1 [ false, %5 ], [ %22, %17 ]
ret i1 %24
}

LLVM IR (-O2):
define zeroext i1 @qeihToBin(double %0, double %1, double %2, double %3, i32* %4) {
%6 = tail call i32 (double, double, double, i32*, ...) bitcast (i32 (...)* @qeiToBin to i32 (double, double, double, i32*, ...)*)(double %0, double %1, double %2, i32* %4)
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = getelementptr inbounds i32, i32* %4, i64 3
%10 = tail call i32 (double, i32*, ...) bitcast (i32 (...)* @hToBin to i32 (double, i32*, ...)*)(double %3, i32* %9)
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %8, %5
%13 = phi i1 [ false, %5 ], [ %11, %8 ]
ret i1 %13
}
/* Variables and functions */
int /*<<< orphan*/ glPolygonMode(unsigned int, unsigned int);
void PolygonMode(unsigned int f, unsigned int m) { glPolygonMode(f, m); }


x86 assembly (clang, -O0):
<PolygonMode>:
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 <glPolygonMode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PolygonMode>:
jmp    1030 <glPolygonMode@plt>

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

LLVM IR (-O2):
define void @PolygonMode(i32 %0, i32 %1) {
%3 = tail call i32 @glPolygonMode(i32 %0, i32 %1)
ret void
}
char main$simple_init$start(void) {
  char result;
  result = counter$init$start();
  return result;
}


x86 assembly (clang, -O0):
<main$simple_init$start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <counter$init$start@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @"main$simple_init$start"() {
%1 = alloca i8
%2 = call i32 (...) @"counter$init$start"()
%3 = trunc i32 %2 to i8
store i8 %3, i8* %1
%4 = load i8, i8* %1
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @"main$simple_init$start"() {
%1 = tail call i32 (...) @"counter$init$start"()
%2 = trunc i32 %1 to i8
ret i8 %2
}
/* Variables and functions */
int Section2Hours(int);
int Section2Minutes(int);
int Section2Seconds(int);
int /*<<< orphan*/ printf(char *, int, int, int);
int Section2(int seconds) {
  printf("\n2.- %d hours, %d minutes and %d seconds", Section2Hours(seconds),
         Section2Minutes(seconds), Section2Seconds(seconds));
  return 0;
}


x86 assembly (clang, -O0):
<Section2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <Section2Hours@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <Section2Minutes@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <Section2Seconds@plt>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    %eax,%ecx
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Section2>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
call   1050 <Section2Hours@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <Section2Minutes@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1060 <Section2Seconds@plt>
lea    0xe9b(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"\0A2.- %d hours, %d minutes and %d seconds\00"
define i32 @Section2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @Section2Hours(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @Section2Minutes(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @Section2Seconds(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"\0A2.- %d hours, %d minutes and %d seconds\00"
define i32 @Section2(i32 %0) {
%2 = tail call i32 @Section2Hours(i32 %0)
%3 = tail call i32 @Section2Minutes(i32 %0)
%4 = tail call i32 @Section2Seconds(i32 %0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3, i32 %4)
ret i32 0
}
int RIGHT_OP(int x, int y) { return x >> y; }


x86 assembly (clang, -O0):
<RIGHT_OP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RIGHT_OP>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @RIGHT_OP(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int com1(char **para) {
  if (para[0])
    printf("this is com1, and parameter is : %s\n", para[0]);
  else
    printf("this command need one parameter\n");
  return 0;
}


x86 assembly (clang, -O0):
<com1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1144 <com1+0x34>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1152 <com1+0x42>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<com1>:
push   %rax
mov    (%rdi),%rsi
test   %rsi,%rsi
je     1139 <com1+0x19>
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1145 <com1+0x25>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"this is com1, and parameter is : %s\0A\00"
@.str.1 = [33 x i8] c"this command need one parameter\0A\00"
define i32 @com1(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8**, i8*** %2
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %14
12: ; preds = %1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"this is com1, and parameter is : %s\0A\00"
@str = [32 x i8] c"this command need one parameter\00"
define i32 @com1(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %8
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getBoundaries();
int /*<<< orphan*/ processSieve();
int /*<<< orphan*/ showPrimes();
int main() {
  processSieve();
  showPrimes();
  getBoundaries();
  showPrimes();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @processSieve()
%3 = call i32 (...) @showPrimes()
%4 = call i32 (...) @getBoundaries()
%5 = call i32 (...) @showPrimes()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @processSieve()
%2 = tail call i32 (...) @showPrimes()
%3 = tail call i32 (...) @getBoundaries()
%4 = tail call i32 (...) @showPrimes()
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void TimerPrescaleSet(uint32_t ui32Base, uint32_t ui32Timer,
                      uint32_t ui32Value) {
  ;

  ;
  ;
  if (ui32Timer & 0x000000ff) {
    (*((volatile uint32_t *)(ui32Base + 0x00000038))) = ui32Value;
  }
  if (ui32Timer & 0x0000ff00) {
    (*((volatile uint32_t *)(ui32Base + 0x0000003C))) = ui32Value;
  }
}


x86 assembly (clang, -O0):
<TimerPrescaleSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
cmp    $0x0,%eax
je     112b <TimerPrescaleSet+0x2b>
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x38,%eax
cltq
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
and    $0xff00,%eax
cmp    $0x0,%eax
je     1149 <TimerPrescaleSet+0x49>
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x3c,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerPrescaleSet>:
movslq %edi,%rax
test   %sil,%sil
je     110b <TimerPrescaleSet+0xb>
mov    %edx,0x38(%rax)
test   $0xff00,%esi
je     1116 <TimerPrescaleSet+0x16>
mov    %edx,0x3c(%rax)
ret

LLVM IR (-O0):
define void @TimerPrescaleSet(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = and i32 %7, 255
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 56
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
store volatile i32 %11, i32* %15
br label %16
16: ; preds = %10, %3
%17 = load i32, i32* %5
%18 = and i32 %17, 65280
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %26
20: ; preds = %16
%21 = load i32, i32* %6
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 60
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i32*
store volatile i32 %21, i32* %25
br label %26
26: ; preds = %20, %16
ret void
}

LLVM IR (-O2):
define void @TimerPrescaleSet(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, 255
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = add nsw i32 %0, 56
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %2, i32* %9
br label %10
10: ; preds = %6, %3
%11 = and i32 %1, 65280
%12 = icmp eq i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %10
%14 = add nsw i32 %0, 60
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store volatile i32 %2, i32* %16
br label %17
17: ; preds = %13, %10
ret void
}
/* Variables and functions */
int hcf(long, long);
int relprime(long x, long y) { return hcf(x, y) == 1; }


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

x86 assembly (clang, -O2):
<relprime>:
push   %rax
call   1030 <hcf@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @relprime(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i32 @hcf(i64 %5, i64 %6)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @relprime(i64 %0, i64 %1) {
%3 = tail call i32 @hcf(i64 %0, i64 %1)
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
double f(double, double, double);
double intGauss(double x0, double x1, double a, double b) {
  return (f(x0, a, b) + f(x1, a, b));
}


x86 assembly (clang, -O0):
<intGauss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1030 <f@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1030 <f@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intGauss>:
sub    $0x28,%rsp
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x20(%rsp)
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
call   1030 <f@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x20(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
call   1030 <f@plt>
addsd  0x18(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @intGauss(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %7
%11 = load double, double* %8
%12 = call double @f(double %9, double %10, double %11)
%13 = load double, double* %6
%14 = load double, double* %7
%15 = load double, double* %8
%16 = call double @f(double %13, double %14, double %15)
%17 = fadd double %12, %16
ret double %17
}

LLVM IR (-O2):
define double @intGauss(double %0, double %1, double %2, double %3) {
%5 = tail call double @f(double %0, double %2, double %3)
%6 = tail call double @f(double %1, double %2, double %3)
%7 = fadd double %5, %6
ret double %7
}
float tanf(float x) { return 0.0; }


x86 assembly (clang, -O0):
<tanf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanf>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @tanf(float %0) {
%2 = alloca float
store float %0, float* %2
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @tanf(float %0) {
ret float 0.000000e+00
}
void b_print_char_hex(char chr) {
  asm volatile("call 0x00100020" : : "a"(chr));
}


x86 assembly (clang, -O0):
<b_print_char_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
call   100020 <completed.0+0xfc000>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_print_char_hex>:
mov    %edi,%eax
call   100020 <completed.0+0xfc000>
ret

LLVM IR (-O0):
define void @b_print_char_hex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret void
}

LLVM IR (-O2):
define void @b_print_char_hex(i8 signext %0) {
tail call void asm sideeffect "call 0x00100020", "{ax},~{dirflag},~{fpsr},~{flags}"(i8 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_main(int, char **);
int main(int argc, char **argv) {
  test_main(argc, argv);
  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   1030 <test_main@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <test_main@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 @test_main(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @test_main(i32 %0, i8** %1)
ret i32 0
}
long CLOSE(fd)
long *fd;
{ return (close(*fd)); }


x86 assembly (clang, -O0):
<CLOSE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1030 <close@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CLOSE>:
push   %rax
mov    (%rdi),%rdi
xor    %eax,%eax
call   1030 <close@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @CLOSE(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = call i32 (i64, ...) bitcast (i32 (...)* @close to i32 (i64, ...)*)(i64 %4)
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @CLOSE(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = tail call i32 (i64, ...) bitcast (i32 (...)* @close to i32 (i64, ...)*)(i64 %2)
%4 = sext i32 %3 to i64
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
scalar_t__ cmp2(void const *, void const *);
scalar_t__ cmp4(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool cmp6(const void *a, const void *b) {
  return cmp2(a, b) && cmp4((uint8_t *)a + 2, (uint8_t *)b + 2);
}


x86 assembly (clang, -O0):
<cmp6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <cmp2@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     116e <cmp6+0x4e>
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1030 <cmp4@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp6>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <cmp2@plt>
test   %rax,%rax
je     1154 <cmp6+0x34>
add    $0x8,%rbx
add    $0x8,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <cmp4@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    1156 <cmp6+0x36>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @cmp6(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @cmp2(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to i32*
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i8*, i8** %4
%14 = bitcast i8* %13 to i32*
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = call i64 @cmp4(i32* %12, i32* %15)
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %9, %2
%19 = phi i1 [ false, %2 ], [ %17, %9 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @cmp6(i8* %0, i8* %1) {
%3 = tail call i64 @cmp2(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 8
%7 = bitcast i8* %6 to i32*
%8 = getelementptr inbounds i8, i8* %1, i64 8
%9 = bitcast i8* %8 to i32*
%10 = tail call i64 @cmp4(i32* %7, i32* %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %5, %2
%14 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %14
}
/* Variables and functions */
int mcfioC_NextEvent(int);
int mcfio_nextevent_(int *stream) { return mcfioC_NextEvent(*stream); }


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

x86 assembly (clang, -O2):
<mcfio_nextevent_>:
mov    (%rdi),%edi
jmp    1030 <mcfioC_NextEvent@plt>

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

LLVM IR (-O2):
define i32 @mcfio_nextevent_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @mcfioC_NextEvent(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ calls_free(void *);
void *calls_malloc();
void test(void) {
  void *ptr = calls_malloc();
  calls_free(ptr);
  calls_free(ptr);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <calls_malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <calls_free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <calls_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
xor    %eax,%eax
call   1040 <calls_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <calls_free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <calls_free@plt>

LLVM IR (-O0):
define void @test() {
%1 = alloca i8*
%2 = call i8* (...) @calls_malloc()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @calls_free(i8* %3)
%5 = load i8*, i8** %1
%6 = call i32 @calls_free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i8* (...) @calls_malloc()
%2 = tail call i32 @calls_free(i8* %1)
%3 = tail call i32 @calls_free(i8* %1)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double generate_random_number(double lower, double upper) {
  double random = ((double)rand() / (double)RAND_MAX);
  double diff = upper - lower;
  double r = random * diff;
  return lower + r;
}


x86 assembly (clang, -O0):
<generate_random_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb3(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_random_number>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm2
mov    0x2eb5(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm2
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @generate_random_number(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %3
store double %1, double* %4
%8 = call i64 (...) @rand()
%9 = sitofp i64 %8 to double
%10 = load i64, i64* @RAND_MAX
%11 = sitofp i64 %10 to double
%12 = fdiv double %9, %11
store double %12, double* %5
%13 = load double, double* %4
%14 = load double, double* %3
%15 = fsub double %13, %14
store double %15, double* %6
%16 = load double, double* %5
%17 = load double, double* %6
%18 = fmul double %16, %17
store double %18, double* %7
%19 = load double, double* %3
%20 = load double, double* %7
%21 = fadd double %19, %20
ret double %21
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @generate_random_number(double %0, double %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to double
%7 = fdiv double %4, %6
%8 = fsub double %1, %0
%9 = fmul double %8, %7
%10 = fadd double %9, %0
ret double %10
}
int main() {
  int a[3][3][3];
  __builtin_memset(a, 0, sizeof a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x6c,%edx
call   1030 <memset@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [3 x [3 x i32]]]
store i32 0, i32* %1
%3 = getelementptr inbounds [3 x [3 x [3 x i32]]], [3 x [3 x [3 x i32]]]* %2, i64 0, i64 0
%4 = bitcast [3 x [3 x i32]]* %3 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void ff_hevc_put_hevc_uni_w_epel_v16_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_v16_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bin_ambi_calc_HRTF_setup();
int /*<<< orphan*/ bin_ambi_reduced_decode_setup();
void iem_bin_ambi_sources_setup(void) {
  bin_ambi_calc_HRTF_setup();
  bin_ambi_reduced_decode_setup();
}


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

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

LLVM IR (-O0):
define void @iem_bin_ambi_sources_setup() {
%1 = call i32 (...) @bin_ambi_calc_HRTF_setup()
%2 = call i32 (...) @bin_ambi_reduced_decode_setup()
ret void
}

LLVM IR (-O2):
define void @iem_bin_ambi_sources_setup() {
%1 = tail call i32 (...) @bin_ambi_calc_HRTF_setup()
%2 = tail call i32 (...) @bin_ambi_reduced_decode_setup()
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t convertLedNumberToBit(int ledNumber) { return 1 << (ledNumber - 1); }


x86 assembly (clang, -O0):
<convertLedNumberToBit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertLedNumberToBit>:
lea    -0x1(%rdi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @convertLedNumberToBit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = shl i32 1, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @convertLedNumberToBit(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = shl nuw i32 1, %2
ret i32 %3
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int c, i;
  for (i = 0; i < 100; ++i) {
    c = getchar();
    printf("%3d : %d\n", i, c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    116a <main+0x4a>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    $0x64,%ebp
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%3d : %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 (...) @getchar()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 100
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}