xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void display(time_t time) { printf("%d\n", (int)time); }


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

x86 assembly (clang, -O2):
<display>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @display(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clearCarryflag(char *);
int /*<<< orphan*/ op_adc(char *, char *, char *, char *);
void op_add(char rega[], char regb[], char accumulator[], char flags[]) {
  clearCarryflag(flags);
  op_adc(rega, regb, accumulator, flags);
}


x86 assembly (clang, -O0):
<op_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <clearCarryflag@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <op_adc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_add>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
mov    %rcx,%rdi
call   1040 <clearCarryflag@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <op_adc@plt>

LLVM IR (-O0):
define void @op_add(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = call i32 @clearCarryflag(i8* %9)
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = call i32 @op_adc(i8* %11, i8* %12, i8* %13, i8* %14)
ret void
}

LLVM IR (-O2):
define void @op_add(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @clearCarryflag(i8* %3)
%6 = tail call i32 @op_adc(i8* %0, i8* %1, i8* %2, i8* %3)
ret void
}
/* Variables and functions */
unsigned char inb_local(int);
__attribute__((always_)) unsigned char inb(int port) { return inb_local(port); }


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

x86 assembly (clang, -O2):
<inb>:
jmp    1030 <inb_local@plt>

LLVM IR (-O0):
define zeroext i8 @inb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call zeroext i8 @inb_local(i32 %3)
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @inb(i32 %0) {
%2 = tail call zeroext i8 @inb_local(i32 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  double result = 1.0;
  int i;
  for (i = 2; i < 17; ++i)
    result = result * i;
  printf("16! = %.14g\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
cmpl   $0x11,-0x14(%rbp)
jge    115e <main+0x4e>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <main+0x23>
movsd  -0x10(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"16! = %.14g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
store i32 0, i32* %1
store double 1.000000e+00, double* %2
store i32 2, i32* %3
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 17
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load double, double* %2
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to double
%11 = fmul double %8, %10
store double %11, double* %2
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
%16 = load double, double* %2
%17 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"16! = %.14g\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double 0x42B3077775800000)
ret i32 0
}
int scsp_round(double val) { return (int)(val + 0.5); }


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

x86 assembly (clang, -O2):
<scsp_round>:
addsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @scsp_round(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 5.000000e-01
%5 = fptosi double %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @scsp_round(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = fptosi double %2 to i32
ret i32 %3
}
double omp_get_wtime(void) { return 0.0; }


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

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

LLVM IR (-O0):
define double @omp_get_wtime() {
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @omp_get_wtime() {
ret double 0.000000e+00
}
/* Variables and functions */
int strcmp(char const *, char const *);
int sort_callback(const void *v0, const void *v1) {
  const char *c0 = v0;
  const char *c1 = v1;
  return (strcmp(c0, c1));
}


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

x86 assembly (clang, -O2):
<sort_callback>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @sort_callback(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
int comparator(const void *a, const void *b) {
  return *((short *)a) - *((short *)b);
}


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

x86 assembly (clang, -O2):
<comparator>:
movswl (%rdi),%eax
movswl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @comparator(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 = bitcast i8* %5 to i16*
%7 = load i16, i16* %6
%8 = sext i16 %7 to i32
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i16*
%11 = load i16, i16* %10
%12 = sext i16 %11 to i32
%13 = sub nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @comparator(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i16*
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = bitcast i8* %1 to i16*
%7 = load i16, i16* %6
%8 = sext i16 %7 to i32
%9 = sub nsw i32 %5, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int recebe_op() {
  int op;
  char lin;
  printf("> Digite uma opcao: ");
  scanf("%d", &op);
  scanf("%c", &lin);
  return op;
}


x86 assembly (clang, -O0):
<recebe_op>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xecb(%rip),%rdi
lea    -0x5(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recebe_op>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xed1(%rip),%rdi
lea    0x3(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"> Digite uma opcao: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c"%c\00"
define i32 @recebe_op() {
%1 = alloca i32
%2 = alloca i8
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%7 = load i32, i32* %1
ret i32 %7
}
/* Variables and functions */
size_t CTREE_MaxSize();
size_t CSET_MaxSize(void) { return CTREE_MaxSize(); }


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

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

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

LLVM IR (-O2):
define i64 @CSET_MaxSize() {
%1 = tail call i64 (...) @CTREE_MaxSize()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ m_buf(int);
int /*<<< orphan*/ m_len(int);
int /*<<< orphan*/ m_width(int);
int /*<<< orphan*/ qsort(int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/,
                         int (*)(void const *, void const *));
void m_qsort(int list, int (*compar)(const void *, const void *)) {
  qsort(m_buf(list), m_len(list), m_width(list), compar);
}


x86 assembly (clang, -O0):
<m_qsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <m_buf@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <m_len@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <m_width@plt>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    %eax,%edx
mov    -0x10(%rbp),%rcx
call   1040 <qsort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_qsort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebp
call   1060 <m_buf@plt>
mov    %eax,%r15d
mov    %ebp,%edi
call   1030 <m_len@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1050 <m_width@plt>
mov    %r15d,%edi
mov    %ebx,%esi
mov    %eax,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <qsort@plt>

LLVM IR (-O0):
define void @m_qsort(i32 %0, i32 (i8*, i8*)* %1) {
%3 = alloca i32
%4 = alloca i32 (i8*, i8*)*
store i32 %0, i32* %3
store i32 (i8*, i8*)* %1, i32 (i8*, i8*)** %4
%5 = load i32, i32* %3
%6 = call i32 @m_buf(i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @m_len(i32 %7)
%9 = load i32, i32* %3
%10 = call i32 @m_width(i32 %9)
%11 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %4
%12 = call i32 @qsort(i32 %6, i32 %8, i32 %10, i32 (i8*, i8*)* %11)
ret void
}

LLVM IR (-O2):
define void @m_qsort(i32 %0, i32 (i8*, i8*)* nocapture %1) {
%3 = tail call i32 @m_buf(i32 %0)
%4 = tail call i32 @m_len(i32 %0)
%5 = tail call i32 @m_width(i32 %0)
%6 = tail call i32 @qsort(i32 %3, i32 %4, i32 %5, i32 (i8*, i8*)* %1)
ret void
}
void vla_simple(int x) { int vla[x]; }


x86 assembly (clang, -O0):
<vla_simple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @vla_simple(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i32, i64 %6
store i64 %6, i64* %4
%9 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @vla_simple(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NumberIO_OctToStr(unsigned int, unsigned int, char *, int);
int /*<<< orphan*/ StrIO_WriteString(char *, int);
void NumberIO_WriteOct(unsigned int x, unsigned int n) {
  typedef struct _T11_a _T11;
  struct _T11_a {
    char array[79 + 1];
  };
  _T11 a;
  NumberIO_OctToStr(x, n, (char *)&a.array[0], 79);
  StrIO_WriteString((char *)&a.array[0], 79);
}


x86 assembly (clang, -O0):
<NumberIO_WriteOct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x58(%rbp),%rdx
mov    $0x4f,%ecx
call   1040 <NumberIO_OctToStr@plt>
lea    -0x58(%rbp),%rdi
mov    $0x4f,%esi
call   1030 <StrIO_WriteString@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NumberIO_WriteOct>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdx
mov    $0x4f,%ecx
call   1040 <NumberIO_OctToStr@plt>
mov    %rbx,%rdi
mov    $0x4f,%esi
call   1030 <StrIO_WriteString@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct._T11_a = type { [80 x i8] }
define void @NumberIO_WriteOct(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct._T11_a
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = getelementptr inbounds %struct._T11_a, %struct._T11_a* %5, i32 0, i32 0
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
%10 = call i32 @NumberIO_OctToStr(i32 %6, i32 %7, i8* %9, i32 79)
%11 = getelementptr inbounds %struct._T11_a, %struct._T11_a* %5, i32 0, i32 0
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%13 = call i32 @StrIO_WriteString(i8* %12, i32 79)
ret void
}

LLVM IR (-O2):
%struct._T11_a = type { [80 x i8] }
define void @NumberIO_WriteOct(i32 %0, i32 %1) {
%3 = alloca %struct._T11_a
%4 = getelementptr inbounds %struct._T11_a, %struct._T11_a* %3, i64 0, i32 0, i64 0
%5 = call i32 @NumberIO_OctToStr(i32 %0, i32 %1, i8* %4, i32 79)
%6 = call i32 @StrIO_WriteString(i8* %4, i32 79)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  char a;
  char b = a = 'a';
  assert(a == 'a');
  assert(b == 'a');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x61,-0x1(%rbp)
movb   $0x61,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
store i8 97, i8* %1
store i8 97, i8* %2
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 97
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 97
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
int main() {
  if (15 >= 16)
    return 7;
  else
    return 9;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x9,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 9
}
void pd_set_pins_speed(int port) {}


x86 assembly (clang, -O0):
<pd_set_pins_speed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @pd_set_pins_speed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @pd_set_pins_speed(i32 %0) {
ret void
}
int test_imm_65int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x65 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_65int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0x65,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_65int64_highword_mem>:
testb  $0x65,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_65int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 101
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_65int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 433791696896
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ a();
int main(int argc, char **argv) {
  for (unsigned i = 0; i < 10; ++i) {
    a();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jae    114c <main+0x3c>
mov    $0x0,%al
call   1030 <a@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <a@plt>
xor    %eax,%eax
call   1030 <a@plt>
xor    %eax,%eax
call   1030 <a@plt>
xor    %eax,%eax
call   1030 <a@plt>
xor    %eax,%eax
call   1030 <a@plt>
xor    %eax,%eax
call   1030 <a@plt>
xor    %eax,%eax
call   1030 <a@plt>
xor    %eax,%eax
call   1030 <a@plt>
xor    %eax,%eax
call   1030 <a@plt>
xor    %eax,%eax
call   1030 <a@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**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %12, %2
%8 = load i32, i32* %6
%9 = icmp ult i32 %8, 10
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = call i32 (...) @a()
br label %12
12: ; preds = %10
%13 = load i32, i32* %6
%14 = add i32 %13, 1
store i32 %14, i32* %6
br label %7
15: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @a()
%4 = tail call i32 (...) @a()
%5 = tail call i32 (...) @a()
%6 = tail call i32 (...) @a()
%7 = tail call i32 (...) @a()
%8 = tail call i32 (...) @a()
%9 = tail call i32 (...) @a()
%10 = tail call i32 (...) @a()
%11 = tail call i32 (...) @a()
%12 = tail call i32 (...) @a()
ret i32 0
}
int test_50_4(int *mem) { return __atomic_fetch_and(mem + 4, 1, 4); }


x86 assembly (clang, -O0):
<test_50_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x10,%rcx
mov    %rcx,-0x20(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    0x10(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
and    %esi,%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    1153 <test_50_4+0x53>
jmp    112a <test_50_4+0x2a>
mov    -0x24(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_50_4>:
mov    0x10(%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
and    $0x1,%ecx
lock cmpxchg %ecx,0x10(%rdi)
jne    1110 <test_50_4+0x10>
ret

LLVM IR (-O0):
define i32 @test_50_4(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 4
store i32 1, i32* %3
%7 = load i32, i32* %3
%8 = atomicrmw and i32* %6, i32 %7 acq_rel
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_50_4(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = atomicrmw and i32* %2, i32 1 acq_rel
ret i32 %3
}
__attribute__((no)) int mul(int x, int y) { return x * y; }


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

x86 assembly (clang, -O2):
<mul>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @mul(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
void rpy2quat_terminate(void) {}


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

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

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

LLVM IR (-O2):
define void @rpy2quat_terminate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ toupper(char);
char *Capitalize(char *str) {
  toupper(str[0]);
  return str;
}


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

x86 assembly (clang, -O2):
<Capitalize>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <toupper@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @Capitalize(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 = call i32 @toupper(i8 signext %5)
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
define i8* @Capitalize(i8* returned %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @toupper(i8 signext %2)
ret i8* %0
}
void __attribute__((__no__)) load_fpr(double *a, double *b) {
  double c = *a;
  __asm__("# fpr, reg = %0" : "+d"(c));
  *b = c;
}


x86 assembly (clang, -O0):
<load_fpr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rdx
movq   %rdx,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_fpr>:
mov    (%rdi),%rdx
mov    %rdx,(%rsi)
ret

LLVM IR (-O0):
define void @load_fpr(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double, double* %6
store double %7, double* %5
%8 = load double, double* %5
%9 = call double asm "# fpr, reg = $0", "={dx},0,~{dirflag},~{fpsr},~{flags}"(double %8)
store double %9, double* %5
%10 = load double, double* %5
%11 = load double*, double** %4
store double %10, double* %11
ret void
}

LLVM IR (-O2):
define void @load_fpr(double* nocapture %0, double* nocapture writeonly %1) {
%3 = load double, double* %0
%4 = tail call double asm "# fpr, reg = $0", "={dx},0,~{dirflag},~{fpsr},~{flags}"(double %3)
store double %4, double* %1
ret void
}
unsigned char sp_cp_port_is_ground(void *data) { return (0); }


x86 assembly (clang, -O0):
<sp_cp_port_is_ground>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @sp_cp_port_is_ground(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @sp_cp_port_is_ground(i8* nocapture readnone %0) {
ret i8 0
}
/* Variables and functions */
char getchar();
void eatline() {
  while (getchar() != '\n')
    ;
}


x86 assembly (clang, -O0):
<eatline>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <eatline+0x9>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1131 <eatline+0x21>
jmp    1119 <eatline+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eatline>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <eatline+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @eatline() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @eatline() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int fwrite(char *, int, int, int /*<<< orphan*/ *);
int IO_Write_Str(char *str, int size, FILE *fp) {
  assert(str && (size > 0) && fp);
  return (fwrite(str, 1, size, fp) == size);
}


x86 assembly (clang, -O0):
<IO_Write_Str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x19(%rbp)
je     115d <IO_Write_Str+0x3d>
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x19(%rbp)
jle    115d <IO_Write_Str+0x3d>
cmpq   $0x0,-0x18(%rbp)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IO_Write_Str>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
test   %rdi,%rdi
setne  %al
test   %esi,%esi
setg   %cl
and    %al,%cl
test   %rdx,%rdx
setne  %al
and    %cl,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %r14,%rcx
call   1040 <fwrite@plt>
xor    %ecx,%ecx
cmp    %ebp,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @IO_Write_Str(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = load i32, i32* %5
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32*, i32** %6
%14 = icmp ne i32* %13, null
br label %15
15: ; preds = %12, %9, %3
%16 = phi i1 [ false, %9 ], [ false, %3 ], [ %14, %12 ]
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i8*, i8** %4
%20 = load i32, i32* %5
%21 = load i32*, i32** %6
%22 = call i32 @fwrite(i8* %19, i32 1, i32 %20, i32* %21)
%23 = load i32, i32* %5
%24 = icmp eq i32 %22, %23
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @IO_Write_Str(i8* %0, i32 %1, i32* %2) {
%4 = icmp ne i8* %0, null
%5 = icmp sgt i32 %1, 0
%6 = and i1 %4, %5
%7 = icmp ne i32* %2, null
%8 = and i1 %6, %7
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @fwrite(i8* %0, i32 1, i32 %1, i32* %2)
%12 = icmp eq i32 %11, %1
%13 = zext i1 %12 to i32
ret i32 %13
}
long C_swigmpointer(long **ptr, void *mp, void *sdata) {
  long *p = *ptr, *p0 = p;
  *(p++) = ((0x0c00000000000000L | 0x2000000000000000L) | (((3 - 1) << 3)));
  *((void **)p) = mp;
  *((void **)p + 1) = sdata;
  *ptr = p + 2;
  return (long)p0;
}


x86 assembly (clang, -O0):
<C_swigmpointer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x20(%rbp)
movabs $0x2c00000000000010,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x20(%rbp),%rcx
add    $0x10,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_swigmpointer>:
mov    (%rdi),%rax
movabs $0x2c00000000000010,%rcx
mov    %rcx,(%rax)
mov    %rsi,0x8(%rax)
mov    %rdx,0x10(%rax)
lea    0x18(%rax),%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i64 @C_swigmpointer(i64** %0, i8* %1, i8* %2) {
%4 = alloca i64**
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64*
%8 = alloca i64*
store i64** %0, i64*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i64**, i64*** %4
%10 = load i64*, i64** %9
store i64* %10, i64** %7
%11 = load i64*, i64** %7
store i64* %11, i64** %8
%12 = load i64*, i64** %7
%13 = getelementptr inbounds i64, i64* %12, i32 1
store i64* %13, i64** %7
store i64 3170534137668829200, i64* %12
%14 = load i8*, i8** %5
%15 = load i64*, i64** %7
%16 = bitcast i64* %15 to i8**
store i8* %14, i8** %16
%17 = load i8*, i8** %6
%18 = load i64*, i64** %7
%19 = bitcast i64* %18 to i8**
%20 = getelementptr inbounds i8*, i8** %19, i64 1
store i8* %17, i8** %20
%21 = load i64*, i64** %7
%22 = getelementptr inbounds i64, i64* %21, i64 2
%23 = load i64**, i64*** %4
store i64* %22, i64** %23
%24 = load i64*, i64** %8
%25 = ptrtoint i64* %24 to i64
ret i64 %25
}

LLVM IR (-O2):
define i64 @C_swigmpointer(i64** nocapture %0, i8* %1, i8* %2) {
%4 = load i64*, i64** %0
%5 = getelementptr inbounds i64, i64* %4, i64 1
store i64 3170534137668829200, i64* %4
%6 = bitcast i64* %5 to i8**
store i8* %1, i8** %6
%7 = getelementptr inbounds i64, i64* %4, i64 2
%8 = bitcast i64* %7 to i8**
store i8* %2, i8** %8
%9 = getelementptr inbounds i64, i64* %4, i64 3
store i64* %9, i64** %0
%10 = ptrtoint i64* %4 to i64
ret i64 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void BreakPoint(uint32_t pc, uint32_t opcode) {}


x86 assembly (clang, -O0):
<BreakPoint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @BreakPoint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @BreakPoint(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello Wold\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"Hello Wold\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned long __fls(unsigned long word) {
  asm("bsr %1,%0" : "=r"(word) : "rm"(word));
  return word;
}


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

x86 assembly (clang, -O2):
<__fls>:
mov    %rdi,-0x8(%rsp)
bsr    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @__fls(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 asm "bsr $1,$0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i64 %3)
store i64 %4, i64* %2
%5 = load i64, i64* %2
ret i64 %5
}

LLVM IR (-O2):
define i64 @__fls(i64 %0) {
%2 = tail call i64 asm "bsr $1,$0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret i64 %2
}
const char *Ref_Brief(void) { return "Shared Pointer"; }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"Shared Pointer\00"
define i8* @Ref_Brief() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void first_periodic() {
  printf("Hello World again, "
         "0000000000000000000000000000000000000000000000000000\n");
}


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

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

LLVM IR (-O0):
@.str = [73 x i8] c"Hello World again, 0000000000000000000000000000000000000000000000000000\0A\00"
define void @first_periodic() {
%1 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [72 x i8] c"Hello World again, 0000000000000000000000000000000000000000000000000000\00"
define void @first_periodic() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void mm_free_char(char **data) {
  free(*data);
  *data = NULL;
}


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

x86 assembly (clang, -O2):
<mm_free_char>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @mm_free_char(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = call i32 @free(i8* %4)
%6 = load i8**, i8*** %2
store i8* null, i8** %6
ret void
}

LLVM IR (-O2):
define void @mm_free_char(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
ret void
}
int raptor_sax2_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @raptor_sax2_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int, int);
char *tex_name(char *name, double tau, double h1, double h2, int t) {
  sprintf(name, "t%02dh%02dh%02dl%d.tex", (int)(tau * 100), (int)(h1 * 100),
          (int)(h2 * 100), t);
  return name;
}


x86 assembly (clang, -O0):
<tex_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %esi,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
movsd  0xec6(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edx
movsd  0xeb5(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%ecx
movsd  0xea4(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%r8d
mov    -0x24(%rbp),%r9d
lea    0xe97(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tex_name>:
push   %rbx
movsd  0xee7(%rip),%xmm3
mulsd  %xmm3,%xmm0
cvttsd2si %xmm0,%edx
mulsd  %xmm3,%xmm1
cvttsd2si %xmm1,%ecx
mov    %esi,%r9d
mov    %rdi,%rbx
mulsd  %xmm3,%xmm2
cvttsd2si %xmm2,%r8d
lea    0xec9(%rip),%rsi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"t%02dh%02dh%02dl%d.tex\00"
define i8* @tex_name(i8* %0, double %1, double %2, double %3, i32 %4) {
%6 = alloca i8*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i32
store i8* %0, i8** %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load double, double* %7
%13 = fmul double %12, 1.000000e+02
%14 = fptosi double %13 to i32
%15 = load double, double* %8
%16 = fmul double %15, 1.000000e+02
%17 = fptosi double %16 to i32
%18 = load double, double* %9
%19 = fmul double %18, 1.000000e+02
%20 = fptosi double %19 to i32
%21 = load i32, i32* %10
%22 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %17, i32 %20, i32 %21)
%23 = load i8*, i8** %6
ret i8* %23
}

LLVM IR (-O2):
@.str = [23 x i8] c"t%02dh%02dh%02dl%d.tex\00"
define i8* @tex_name(i8* returned writeonly %0, double %1, double %2, double %3, i32 %4) {
%6 = fmul double %1, 1.000000e+02
%7 = fptosi double %6 to i32
%8 = fmul double %2, 1.000000e+02
%9 = fptosi double %8 to i32
%10 = fmul double %3, 1.000000e+02
%11 = fptosi double %10 to i32
%12 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9, i32 %11, i32 %4)
ret i8* %0
}
/* Type definitions */
union i2c_smbus_data {
  int byte;
};
typedef int /*<<< orphan*/ __u8;
typedef int __s32;

/* Variables and functions */
scalar_t__ i2c_smbus_access(int, int, int /*<<< orphan*/, int,
                            union i2c_smbus_data *);
__s32 i2c_smbus_read_byte_data(int file, __u8 command) {
  union i2c_smbus_data data;
  if (i2c_smbus_access(file, 1, command, 2, &data))
    return -1;
  else
    return 0x0FF & data.byte;
}


x86 assembly (clang, -O0):
<i2c_smbus_read_byte_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
mov    $0x2,%ecx
lea    -0x10(%rbp),%r8
call   1030 <i2c_smbus_access@plt>
cmp    $0x0,%rax
je     114d <i2c_smbus_read_byte_data+0x3d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <i2c_smbus_read_byte_data+0x48>
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_smbus_read_byte_data>:
push   %rax
mov    %esi,%edx
mov    %rsp,%r8
mov    $0x1,%esi
mov    $0x2,%ecx
call   1030 <i2c_smbus_access@plt>
movzbl (%rsp),%ecx
neg    %rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%union.i2c_smbus_data = type { i32 }
define i32 @i2c_smbus_read_byte_data(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca %union.i2c_smbus_data
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i64 @i2c_smbus_access(i32 %7, i32 1, i32 %8, i32 2, %union.i2c_smbus_data* %6)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %16
12: ; preds = %2
%13 = bitcast %union.i2c_smbus_data* %6 to i32*
%14 = load i32, i32* %13
%15 = and i32 255, %14
store i32 %15, i32* %3
br label %16
16: ; preds = %12, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%union.i2c_smbus_data = type { i32 }
define i32 @i2c_smbus_read_byte_data(i32 %0, i32 %1) {
%3 = alloca %union.i2c_smbus_data
%4 = bitcast %union.i2c_smbus_data* %3 to i8*
%5 = call i64 @i2c_smbus_access(i32 %0, i32 1, i32 %1, i32 2, %union.i2c_smbus_data* %3)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds %union.i2c_smbus_data, %union.i2c_smbus_data* %3, i64 0, i32 0
%8 = load i32, i32* %7
%9 = and i32 %8, 255
%10 = select i1 %6, i32 %9, i32 -1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ RB_AUTOBOOT;
int /*<<< orphan*/ perror(char *);
int reboot(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int retval = reboot(RB_AUTOBOOT);
  if (retval != 0)
    perror("reboot failed");
  return retval;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1040 <reboot@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     115d <main+0x3d>
lea    0xea8(%rip),%rdi
call   1030 <perror@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1040 <reboot@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1139 <main+0x19>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec0(%rip),%rdi
call   1030 <perror@plt>
jmp    1135 <main+0x15>

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

LLVM IR (-O2):
@RB_AUTOBOOT = global i32 0
@.str = [14 x i8] c"reboot failed\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @RB_AUTOBOOT
%4 = tail call i32 @reboot(i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void prString2(void *s) { printf("%s\n", (char *)s); }


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

x86 assembly (clang, -O2):
<prString2>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @prString2(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *my_realloc(int *, int);
void call_my_realloc_array_ok(int *p) {
  p = my_realloc(p, 10 * sizeof(int));
  p[0] = 42;
  free(p);
}


x86 assembly (clang, -O0):
<call_my_realloc_array_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x28,%esi
call   1040 <my_realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_my_realloc_array_ok>:
push   %rax
mov    $0x28,%esi
call   1040 <my_realloc@plt>
movl   $0x2a,(%rax)
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @call_my_realloc_array_ok(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32* @my_realloc(i32* %3, i32 40)
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
store i32 42, i32* %6
%7 = load i32*, i32** %2
%8 = call i32 @free(i32* %7)
ret void
}

LLVM IR (-O2):
define void @call_my_realloc_array_ok(i32* %0) {
%2 = tail call i32* @my_realloc(i32* %0, i32 40)
store i32 42, i32* %2
%3 = tail call i32 @free(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hvt_x86_mem_size(size_t *);
void hvt_mem_size(size_t *mem_size) { hvt_x86_mem_size(mem_size); }


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

x86 assembly (clang, -O2):
<hvt_mem_size>:
jmp    1030 <hvt_x86_mem_size@plt>

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

LLVM IR (-O2):
define void @hvt_mem_size(i64* %0) {
%2 = tail call i32 @hvt_x86_mem_size(i64* %0)
ret void
}