xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ cls();
int /*<<< orphan*/ pausar();
int /*<<< orphan*/ printf(char *);
void ayuda(void) {
  cls();
  printf("7-seg");
  printf("[Comandos]\n z : salir del programa \n h : ayuda \n x : cambiar el "
         "dato actual a modificar\n t : mostrar tabla de datos \n i : cambiar "
         "indice\n k : activar/desactivar catodo comun\n ");
  pausar();
}


x86 assembly (clang, -O0):
<ayuda>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <cls@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pausar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ayuda>:
push   %rax
xor    %eax,%eax
call   1050 <cls@plt>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pausar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"7-seg\00"
@.str.1 = [176 x i8] c"[Comandos]\0A z : salir del programa \0A h : ayuda \0A x : cambiar el dato actual a modificar\0A t : mostrar tabla de datos \0A i : cambiar indice\0A k : activar/desactivar catodo comun\0A \00"
define void @ayuda() {
%1 = call i32 (...) @cls()
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @pausar()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"7-seg\00"
@.str.1 = [176 x i8] c"[Comandos]\0A z : salir del programa \0A h : ayuda \0A x : cambiar el dato actual a modificar\0A t : mostrar tabla de datos \0A i : cambiar indice\0A k : activar/desactivar catodo comun\0A \00"
define void @ayuda() {
%1 = tail call i32 (...) @cls()
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([176 x i8], [176 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @pausar()
ret void
}
void xadebug(const char *file, const char *func, int line, const char *format,
             ...) {
  (void)file;
  (void)func;
  (void)line;
  (void)format;
  return;
}


x86 assembly (clang, -O0):
<xadebug>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @xadebug(i8* nocapture %0, i8* nocapture %1, i32 %2, i8* nocapture %3, ...) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ reuseON;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_BROADCAST;
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int *, int);
void enable_broadcast(int socketFD) {
  int reuseON = 1;
  setsockopt(socketFD, SOL_SOCKET, SO_BROADCAST, &reuseON, sizeof(reuseON));
}


x86 assembly (clang, -O0):
<enable_broadcast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_broadcast>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rax
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
define void @enable_broadcast(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_BROADCAST
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret void
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
define void @enable_broadcast(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_BROADCAST
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ opx_adec(char *, char *);
void i_addx_adec(void) { opx_adec("adc", ""); }


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

x86 assembly (clang, -O2):
<i_addx_adec>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <opx_adec@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"adc\00"
@.str.1 = [1 x i8] zeroinitializer
define void @i_addx_adec() {
%1 = call i32 @opx_adec(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"adc\00"
@.str.1 = [1 x i8] zeroinitializer
define void @i_addx_adec() {
%1 = tail call i32 @opx_adec(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ loop(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ random();
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  int z = __VERIFIER_nondet_int();
  loop(random(), random());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <random@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <random@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <loop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1050 <random@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <random@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <loop@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %1
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %2
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %3
%7 = call i32 (...) @random()
%8 = call i32 (...) @random()
%9 = call i32 @loop(i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
%4 = tail call i32 (...) @random()
%5 = tail call i32 (...) @random()
%6 = tail call i32 @loop(i32 %4, i32 %5)
ret i32 0
}
int main(void) {
  float f = 2.0;
  !f;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca float
store float 2.000000e+00, float* %1
%2 = load float, float* %1
%3 = fcmp une float %2, 0.000000e+00
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int xor6(int i, int j) { return (((i * j) % 2 + (i * j) % 3) % 2) ? 0 : 1; }


x86 assembly (clang, -O0):
<xor6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor6>:
imul   %esi,%edi
movslq %edi,%rcx
imul   $0x55555556,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
add    %edx,%eax
add    %ecx,%eax
add    %ecx,%eax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @xor6(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
%8 = srem i32 %7, 2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = mul nsw i32 %9, %10
%12 = srem i32 %11, 3
%13 = add nsw i32 %8, %12
%14 = srem i32 %13, 2
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 0, i32 1
ret i32 %17
}

LLVM IR (-O2):
define i32 @xor6(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = srem i32 %3, 3
%5 = add i32 %4, %3
%6 = and i32 %5, 1
%7 = xor i32 %6, 1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ dwt_write8bitoffsetreg(int, int, int);
void dwt_rxreset(void) {
  dwt_write8bitoffsetreg(0x36, 3, 0xE0);
  dwt_write8bitoffsetreg(0x36, 3, 0xF0);
}


x86 assembly (clang, -O0):
<dwt_rxreset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x36,%edi
mov    $0x3,%esi
mov    $0xe0,%edx
call   1030 <dwt_write8bitoffsetreg@plt>
mov    $0x36,%edi
mov    $0x3,%esi
mov    $0xf0,%edx
call   1030 <dwt_write8bitoffsetreg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dwt_rxreset>:
push   %rax
mov    $0x36,%edi
mov    $0x3,%esi
mov    $0xe0,%edx
call   1030 <dwt_write8bitoffsetreg@plt>
mov    $0x36,%edi
mov    $0x3,%esi
mov    $0xf0,%edx
pop    %rax
jmp    1030 <dwt_write8bitoffsetreg@plt>

LLVM IR (-O0):
define void @dwt_rxreset() {
%1 = call i32 @dwt_write8bitoffsetreg(i32 54, i32 3, i32 224)
%2 = call i32 @dwt_write8bitoffsetreg(i32 54, i32 3, i32 240)
ret void
}

LLVM IR (-O2):
define void @dwt_rxreset() {
%1 = tail call i32 @dwt_write8bitoffsetreg(i32 54, i32 3, i32 224)
%2 = tail call i32 @dwt_write8bitoffsetreg(i32 54, i32 3, i32 240)
ret void
}
int test_imm_67int16_mem(short *val) {
  return ((*val) & (-0x67 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_67int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffff99,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_67int16_mem>:
movzwl (%rdi),%eax
test   $0xff99,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_67int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -103
%7 = icmp ne i32 %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_67int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -103
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int is_prime(int num) {
  int div = 2;
  while (num % div != 0) {
    div++;
  }
  if (num >= 2) {
    if (div == num)
      return 1;
    if (div != num)
      return 0;
  } else
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     112c <is_prime+0x2c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
cmpl   $0x2,-0x8(%rbp)
jl     116b <is_prime+0x6b>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    114e <is_prime+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    117e <is_prime+0x7e>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1166 <is_prime+0x66>
movl   $0x0,-0x4(%rbp)
jmp    117e <is_prime+0x7e>
jmp    1177 <is_prime+0x77>
movl   $0xffffffff,-0x4(%rbp)
jmp    117e <is_prime+0x7e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %edi,%eax
cltd
idiv   %ecx
add    $0x1,%ecx
test   %edx,%edx
jne    1110 <is_prime+0x10>
sub    %edi,%ecx
xor    %edx,%edx
cmp    $0x1,%ecx
sete   %dl
cmp    $0x2,%edi
mov    $0xffffffff,%eax
cmovge %edx,%eax
ret

LLVM IR (-O0):
define i32 @is_prime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 2, i32* %4
br label %5
5: ; preds = %10, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = srem i32 %6, %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
br label %5
13: ; preds = %5
%14 = load i32, i32* %3
%15 = icmp sge i32 %14, 2
br i1 %15, label %16, label %27
16: ; preds = %13
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = icmp eq i32 %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %2
br label %29
21: ; preds = %16
%22 = load i32, i32* %4
%23 = load i32, i32* %3
%24 = icmp ne i32 %22, %23
br i1 %24, label %25, label %26
25: ; preds = %21
store i32 0, i32* %2
br label %29
26: ; preds = %21
br label %28
27: ; preds = %13
store i32 -1, i32* %2
br label %29
28: ; preds = %26
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27, %25, %20
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 2, %1 ], [ %6, %2 ]
%4 = srem i32 %0, %3
%5 = icmp eq i32 %4, 0
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = icmp sgt i32 %0, 1
%9 = icmp eq i32 %3, %0
%10 = zext i1 %9 to i32
%11 = select i1 %8, i32 %10, i32 -1
ret i32 %11
}
void mocked_void_function1() { ; }


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

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

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

LLVM IR (-O2):
define void @mocked_void_function1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tml_dr_vMpy3(double const *, double *, double *, int);
void tml_dr_vMpy2(const double *src, double *dst, int n) {
  tml_dr_vMpy3(src, dst, dst, n);
}


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

x86 assembly (clang, -O2):
<tml_dr_vMpy2>:
mov    %edx,%ecx
mov    %rsi,%rdx
jmp    1030 <tml_dr_vMpy3@plt>

LLVM IR (-O0):
define void @tml_dr_vMpy2(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load double*, double** %5
%10 = load i32, i32* %6
%11 = call i32 @tml_dr_vMpy3(double* %7, double* %8, double* %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @tml_dr_vMpy2(double* %0, double* %1, i32 %2) {
%4 = tail call i32 @tml_dr_vMpy3(double* %0, double* %1, double* %1, i32 %2)
ret void
}
/* Type definitions */
struct xdr_stream {
  int dummy;
};
typedef enum msg_type { ____Placeholder_msg_type } msg_type;

/* Variables and functions */
int xdr_uint(struct xdr_stream *, int *);
int xdr_msg_type(struct xdr_stream *stream, enum msg_type *value) {
  return xdr_uint(stream, value);
}


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

x86 assembly (clang, -O2):
<xdr_msg_type>:
jmp    1030 <xdr_uint@plt>

LLVM IR (-O0):
%struct.xdr_stream = type { i32 }
define i32 @xdr_msg_type(%struct.xdr_stream* %0, i32* %1) {
%3 = alloca %struct.xdr_stream*
%4 = alloca i32*
store %struct.xdr_stream* %0, %struct.xdr_stream** %3
store i32* %1, i32** %4
%5 = load %struct.xdr_stream*, %struct.xdr_stream** %3
%6 = load i32*, i32** %4
%7 = call i32 @xdr_uint(%struct.xdr_stream* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.xdr_stream = type { i32 }
define i32 @xdr_msg_type(%struct.xdr_stream* %0, i32* %1) {
%3 = tail call i32 @xdr_uint(%struct.xdr_stream* %0, i32* %1)
ret i32 %3
}
int get_opposite_direction_bit(int direction) {
  int opposite_direction = -1;
  switch (direction) {
  case 0x04:
    opposite_direction = 0x10;
    break;
  case 0x08:
    opposite_direction = 0x20;
    break;
  case 0x10:
    opposite_direction = 0x04;
    break;
  case 0x20:
    opposite_direction = 0x08;
    break;
  }
  return opposite_direction;
}


x86 assembly (clang, -O0):
<get_opposite_direction_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xfffffffc,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x1c,%eax
ja     1162 <get_opposite_direction_bit+0x62>
mov    -0x10(%rbp),%rax
lea    0xed2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x10,-0x8(%rbp)
jmp    1162 <get_opposite_direction_bit+0x62>
movl   $0x20,-0x8(%rbp)
jmp    1162 <get_opposite_direction_bit+0x62>
movl   $0x4,-0x8(%rbp)
jmp    1162 <get_opposite_direction_bit+0x62>
movl   $0x8,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_opposite_direction_bit>:
add    $0xfffffffc,%edi
rol    $0x1e,%edi
mov    $0xffffffff,%eax
cmp    $0x7,%edi
ja     111d <get_opposite_direction_bit+0x1d>
movslq %edi,%rax
lea    0xee6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @get_opposite_direction_bit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -1, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %9 [
i32 4, label %5
i32 8, label %6
i32 16, label %7
i32 32, label %8
]
5: ; preds = %1
store i32 16, i32* %3
br label %9
6: ; preds = %1
store i32 32, i32* %3
br label %9
7: ; preds = %1
store i32 4, i32* %3
br label %9
8: ; preds = %1
store i32 8, i32* %3
br label %9
9: ; preds = %1, %8, %7, %6, %5
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@switch.table.get_opposite_direction_bit = [8 x i32] [i32 16, i32 32, i32 -1, i32 4, i32 -1, i32 -1, i32 -1, i32 8]
define i32 @get_opposite_direction_bit(i32 %0) {
%2 = add i32 %0, -4
%3 = tail call i32 @llvm.fshl.i32(i32 %2, i32 %2, i32 30)
%4 = icmp ult i32 %3, 8
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.get_opposite_direction_bit, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ -1, %1 ], [ %8, %5 ]
ret i32 %10
}
unsigned xrop3_210_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~S;
  stk2 = D & stk3;
  stk1 = T ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_210_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_210_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
xor    %ecx,%edi
not    %ecx
or     %eax,%ecx
not    %eax
xor    $0xff,%edi
and    %edi,%ecx
and    %esi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_210_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %5
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %9
%30 = xor i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = and i32 %31, %32
%34 = load i32, i32* %8
%35 = load i32, i32* %7
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = or i32 %33, %37
%39 = load i32, i32* %7
%40 = load i32, i32* %6
%41 = xor i32 %40, -1
%42 = and i32 %39, %41
%43 = load i32, i32* %5
%44 = and i32 %42, %43
%45 = or i32 %38, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_210_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -1
%8 = xor i32 %6, %3
%9 = xor i32 %8, 255
%10 = xor i32 %6, -1
%11 = or i32 %4, %10
%12 = and i32 %9, %11
%13 = and i32 %7, %5
%14 = or i32 %12, %13
ret i32 %14
}
/* Variables and functions */
int isascii(int);
bool invalidFunctionArgBool_isascii(bool b, int c) {
  (void)isascii(b);
  return isascii(c != 0);
}


x86 assembly (clang, -O0):
<invalidFunctionArgBool_isascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isascii@plt>
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <isascii@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @invalidFunctionArgBool_isascii(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 = call i32 @isascii(i32 %5)
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @isascii(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @invalidFunctionArgBool_isascii(i32 %0, i32 %1) {
ret i32 1
}
int dummy(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @dummy() {
ret i32 1
}
void __outwc(unsigned short value, unsigned short port) {
  __asm__ __volatile__("out"
                       "w"
                       " %"
                       "w"
                       "0,%"
                       ""
                       "1"
                       :
                       : "a"(value), "id"(port));
}


x86 assembly (clang, -O0):
<__outwc>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x4(%rbp),%dx
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__outwc>:
mov    %esi,%edx
mov    %edi,%eax
out    %ax,(%dx)
ret

LLVM IR (-O0):
define void @__outwc(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @__outwc(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw ${0:w},$1", "{ax},i{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
ret void
}
int find(int contain[], int vertex_number) { return (contain[vertex_number]); }


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

x86 assembly (clang, -O2):
<find>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @find(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @find(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
unsigned long long nlm_crypto_form_pkt_desc1(unsigned int cipherlen,
                                             unsigned int hashlen) {
  return (((unsigned long long)((cipherlen - 1)) & ((1ULL << (32)) - 1))
          << (32)) |
         (((unsigned long long)((hashlen - 1)) & ((1ULL << (32)) - 1)) << (0));
}


x86 assembly (clang, -O0):
<nlm_crypto_form_pkt_desc1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,%eax
movabs $0xffffffff,%rcx
and    %rcx,%rax
shl    $0x20,%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
movabs $0xffffffff,%rdx
and    %rdx,%rcx
shl    $0x0,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nlm_crypto_form_pkt_desc1>:
add    $0xffffffff,%edi
shl    $0x20,%rdi
lea    -0x1(%rsi),%eax
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @nlm_crypto_form_pkt_desc1(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 = sub i32 %5, 1
%7 = zext i32 %6 to i64
%8 = and i64 %7, 4294967295
%9 = shl i64 %8, 32
%10 = load i32, i32* %4
%11 = sub i32 %10, 1
%12 = zext i32 %11 to i64
%13 = and i64 %12, 4294967295
%14 = shl i64 %13, 0
%15 = or i64 %9, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @nlm_crypto_form_pkt_desc1(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = zext i32 %3 to i64
%5 = shl nuw i64 %4, 32
%6 = add i32 %1, -1
%7 = zext i32 %6 to i64
%8 = or i64 %5, %7
ret i64 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
scalar_t__ EBUSY;
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
scalar_t__ pthread_mutex_trylock(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void hts_mutex_assert0(pthread_mutex_t *l, const char *file, int line) {
  if (pthread_mutex_trylock(l) == EBUSY)
    return;
  fprintf(stderr, "Mutex not held at %s:%d\n", file, line);
  abort();
}


x86 assembly (clang, -O0):
<hts_mutex_assert0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_trylock@plt>
mov    0x2e85(%rip),%rcx
cmp    (%rcx),%rax
jne    1162 <hts_mutex_assert0+0x32>
add    $0x20,%rsp
pop    %rbp
ret
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xe87(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<hts_mutex_assert0>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1040 <pthread_mutex_trylock@plt>
mov    0x2e94(%rip),%rcx
cmp    (%rcx),%rax
jne    1150 <hts_mutex_assert0+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@EBUSY = global i64 0
@stderr = global i32 0
@.str = [25 x i8] c"Mutex not held at %s:%d\0A\00"
define void @hts_mutex_assert0(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = call i64 @pthread_mutex_trylock(i32* %7)
%9 = load i64, i64* @EBUSY
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
ret void
12: ; preds = %3
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %15)
%17 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@EBUSY = global i64 0
@stderr = global i32 0
@.str = [25 x i8] c"Mutex not held at %s:%d\0A\00"
define void @hts_mutex_assert0(i32* %0, i8* %1, i32 %2) {
%4 = tail call i64 @pthread_mutex_trylock(i32* %0)
%5 = load i64, i64* @EBUSY
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %3
ret void
8: ; preds = %3
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
%11 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() {
  int a = 456;
  double b;
  b = (double)a;
  printf("%.2lf\n ", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1c8,-0x8(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%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 = [8 x i8] c"%.2lf\0A \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 0, i32* %1
store i32 456, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
store double %5, double* %3
%6 = load double, double* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%.2lf\0A \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double 4.560000e+02)
ret i32 0
}
/* Variables and functions */
int MkINode(int, int /*<<< orphan*/);
int WriteParentDirEnt(int, int, char *);
int MkFile(int pINum, char *name) {
  int iNodeNum = MkINode((1), 0);
  if (iNodeNum < 0) {
    return -1;
  }
  int rc = WriteParentDirEnt(pINum, iNodeNum, name);
  if (rc < 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<MkFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <MkINode@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1154 <MkFile+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    1183 <MkFile+0x63>
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <WriteParentDirEnt@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    117c <MkFile+0x5c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1183 <MkFile+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MkFile>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <MkINode@plt>
test   %eax,%eax
js     1149 <MkFile+0x29>
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
call   1040 <WriteParentDirEnt@plt>
sar    $0x1f,%eax
jmp    114e <MkFile+0x2e>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @MkFile(i32 %0, i8* %1) {
%3 = tail call i32 @MkINode(i32 1, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @WriteParentDirEnt(i32 %0, i32 %3, i8* %1)
%7 = ashr i32 %6, 31
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %7, %5 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ CMT1_delay_core(int, int);
void CMT1_delay_40us(int n) { CMT1_delay_core(100, n); }


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

x86 assembly (clang, -O2):
<CMT1_delay_40us>:
mov    %edi,%esi
mov    $0x64,%edi
jmp    1030 <CMT1_delay_core@plt>

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

LLVM IR (-O2):
define void @CMT1_delay_40us(i32 %0) {
%2 = tail call i32 @CMT1_delay_core(i32 100, i32 %0)
ret void
}
/* Variables and functions */
void *malloc(int);
void *getSharedPage(void) { return malloc(4096); }


x86 assembly (clang, -O0):
<getSharedPage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1000,%edi
call   1030 <malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSharedPage>:
mov    $0x1000,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @getSharedPage() {
%1 = call i8* @malloc(i32 4096)
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @getSharedPage() {
%1 = tail call dereferenceable_or_null(4096) i8* @malloc(i32 4096)
ret i8* %1
}
void clearmatrix(char *matrix, int size) {
  int cont;
  for (cont = 0; cont < size; cont++)
    matrix[cont] = 0;
}


x86 assembly (clang, -O0):
<clearmatrix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <clearmatrix+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <clearmatrix+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearmatrix>:
test   %esi,%esi
jle    1122 <clearmatrix+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @clearmatrix(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mvprintw(int, int, char *);
void io_printborder(int x, int y, int width) {
  int i;
  for (i = 0; i < width; i++)
    mvprintw(y, x + i, "#");
}


x86 assembly (clang, -O0):
<io_printborder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <io_printborder+0x47>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
add    -0x10(%rbp),%esi
lea    0xebc(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <io_printborder+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_printborder>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
jle    1145 <io_printborder+0x35>
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
lea    0xed7(%rip),%r15
nopl   0x0(%rax)
mov    %r14d,%edi
mov    %ebp,%esi
mov    %r15,%rdx
call   1030 <mvprintw@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
jne    1130 <io_printborder+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"#\00"
define void @io_printborder(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 0, %3 ]
%7 = add nsw i32 %6, %0
%8 = tail call i32 @mvprintw(i32 %1, i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = add nuw nsw i32 %6, 1
%10 = icmp eq i32 %9, %2
br i1 %10, label %11, label %5
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
unsigned int alarm(unsigned int);
void test(void) {
  unsigned int seconds;
  unsigned int result;
  seconds = 10;
  result = alarm(seconds);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alarm@plt>
mov    %eax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    $0xa,%edi
jmp    1030 <alarm@plt>

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = alloca i32
store i32 10, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @alarm(i32 %3)
store i32 %4, i32* %2
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @alarm(i32 10)
ret void
}
int foo2(int i) { return i; }


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

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

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

LLVM IR (-O2):
define i32 @foo2(i32 returned %0) {
ret i32 %0
}
int maximo(int n1, int n2) {
  int maior;
  if (n1 > n2)
    maior = n1;
  else
    maior = n2;
  return maior;
}


x86 assembly (clang, -O0):
<maximo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <maximo+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <maximo+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maximo>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @maximo(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int divide_by_zero() {
  int t[2][3][2] = {{{1, 1}, {2, 2}, {3, 3}}, {{4, 4}, {5, 5}, {1, 0}}};
  return t[0][1][0] / t[1][2][1];
}


x86 assembly (clang, -O0):
<divide_by_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xedd(%rip),%rsi
mov    $0x30,%edx
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%eax
cltd
idivl  -0x4(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.divide_by_zero.t = [2 x [3 x [2 x i32]]] [[3 x [2 x i32]] [[2 x i32] [i32 1, i32 1], [2 x i32] [i32 2, i32 2], [2 x i32] [i32 3, i32 3]], [3 x [2 x i32]] [[2 x i32] [i32 4, i32 4], [2 x i32] [i32 5, i32 5], [2 x i32] [i32 1, i32 0]]]
define i32 @divide_by_zero() {
%1 = alloca [2 x [3 x [2 x i32]]]
%2 = bitcast [2 x [3 x [2 x i32]]]* %1 to i8*
%3 = getelementptr inbounds [2 x [3 x [2 x i32]]], [2 x [3 x [2 x i32]]]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %3, i64 0, i64 1
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds [2 x [3 x [2 x i32]]], [2 x [3 x [2 x i32]]]* %1, i64 0, i64 1
%8 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %7, i64 0, i64 2
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%10 = load i32, i32* %9
%11 = sdiv i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @divide_by_zero() {
ret i32 poison
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
double get_time_ms() {
  struct timeval tv;
  struct timezone tz;
  gettimeofday(&tv, &tz);
  return 1000. * tv.tv_sec + tv.tv_usec / 1000.;
}


x86 assembly (clang, -O0):
<get_time_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <gettimeofday@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xebd(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_ms>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x8(%rsp),%xmm0
cvtsi2sdl 0xc(%rsp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
%struct.timezone = type { i32 }
define double @get_time_ms() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 1.000000e+03
%11 = call double @llvm.fmuladd.f64(double 1.000000e+03, double %6, double %10)
ret double %11
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
%struct.timezone = type { i32 }
define double @get_time_ms() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 1.000000e+03
%13 = tail call double @llvm.fmuladd.f64(double %8, double 1.000000e+03, double %12)
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ run_expectish_lace_tool_pipem_callback(int, int,
                                                          char const *);
void run_expectish(int in_fd, int out_fd, void *voidarg) {
  run_expectish_lace_tool_pipem_callback(in_fd, out_fd, (const char *)voidarg);
}


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

x86 assembly (clang, -O2):
<run_expectish>:
jmp    1030 <run_expectish_lace_tool_pipem_callback@plt>

LLVM IR (-O0):
define void @run_expectish(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @run_expectish_lace_tool_pipem_callback(i32 %7, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @run_expectish(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @run_expectish_lace_tool_pipem_callback(i32 %0, i32 %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_SubtractVec3_init(void) {
  _hmt_register_covercase("HMM_SubtractVec3", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_SubtractVec3_init>:
lea    0xee9(%rip),%rdi
lea    0xef3(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"HMM_SubtractVec3\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_SubtractVec3_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addMoreLard();
int /*<<< orphan*/ fact2(int);
int mul(int, int /*<<< orphan*/);
int fact1(int n) {
  addMoreLard();
  if (n == 0)
    return 1;
  else
    return mul(n, fact2(n - 1));
}


x86 assembly (clang, -O0):
<fact1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <addMoreLard@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1158 <fact1+0x28>
movl   $0x1,-0x4(%rbp)
jmp    1176 <fact1+0x46>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fact2@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1050 <mul@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fact1>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <addMoreLard@plt>
test   %ebx,%ebx
je     1150 <fact1+0x20>
lea    -0x1(%rbx),%edi
call   1030 <fact2@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1050 <mul@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fact1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @addMoreLard()
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 1
%12 = call i32 @fact2(i32 %11)
%13 = call i32 @mul(i32 %9, i32 %12)
store i32 %13, i32* %2
br label %14
14: ; preds = %8, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @fact1(i32 %0) {
%2 = tail call i32 (...) @addMoreLard()
%3 = icmp eq i32 %0, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = add nsw i32 %0, -1
%6 = tail call i32 @fact2(i32 %5)
%7 = tail call i32 @mul(i32 %0, i32 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 1, %1 ]
ret i32 %9
}