xunge/DecIR huggingface dataset:
/* Type definitions */
struct cpu {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cpu_set_r8(struct cpu *, int, unsigned char);
void cpu_set_r16(struct cpu *cpu, int ri, unsigned short v) {
  unsigned char h = ((unsigned char)(((unsigned short)(v)) >> 8));
  unsigned char l = ((unsigned char)(((unsigned short)(v)) >> 0));
  cpu_set_r8(cpu, ri + 0, l);
  cpu_set_r8(cpu, ri + 1, h);
}


x86 assembly (clang, -O0):
<cpu_set_r16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
movzwl -0xe(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0xf(%rbp)
movzwl -0xe(%rbp),%eax
sar    $0x0,%eax
mov    %al,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x0,%esi
movzbl -0x10(%rbp),%edx
call   1030 <cpu_set_r8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
movzbl -0xf(%rbp),%edx
call   1030 <cpu_set_r8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_set_r16>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
mov    %edx,%ebp
shr    $0x8,%ebp
movzbl %dl,%edx
call   1030 <cpu_set_r8@plt>
add    $0x1,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <cpu_set_r8@plt>

LLVM IR (-O0):
%struct.cpu = type { i32 }
define void @cpu_set_r16(%struct.cpu* %0, i32 %1, i16 zeroext %2) {
%4 = alloca %struct.cpu*
%5 = alloca i32
%6 = alloca i16
%7 = alloca i8
%8 = alloca i8
store %struct.cpu* %0, %struct.cpu** %4
store i32 %1, i32* %5
store i16 %2, i16* %6
%9 = load i16, i16* %6
%10 = zext i16 %9 to i32
%11 = ashr i32 %10, 8
%12 = trunc i32 %11 to i8
store i8 %12, i8* %7
%13 = load i16, i16* %6
%14 = zext i16 %13 to i32
%15 = ashr i32 %14, 0
%16 = trunc i32 %15 to i8
store i8 %16, i8* %8
%17 = load %struct.cpu*, %struct.cpu** %4
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 0
%20 = load i8, i8* %8
%21 = call i32 @cpu_set_r8(%struct.cpu* %17, i32 %19, i8 zeroext %20)
%22 = load %struct.cpu*, %struct.cpu** %4
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
%25 = load i8, i8* %7
%26 = call i32 @cpu_set_r8(%struct.cpu* %22, i32 %24, i8 zeroext %25)
ret void
}

LLVM IR (-O2):
%struct.cpu = type { i32 }
define void @cpu_set_r16(%struct.cpu* %0, i32 %1, i16 zeroext %2) {
%4 = lshr i16 %2, 8
%5 = trunc i16 %4 to i8
%6 = trunc i16 %2 to i8
%7 = tail call i32 @cpu_set_r8(%struct.cpu* %0, i32 %1, i8 zeroext %6)
%8 = add nsw i32 %1, 1
%9 = tail call i32 @cpu_set_r8(%struct.cpu* %0, i32 %8, i8 zeroext %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_root();
int /*<<< orphan*/ disable_smep_smap();
int /*<<< orphan*/ get_root();
int /*<<< orphan*/ setup_sandbox();
int /*<<< orphan*/ sleep(int);
int main() {
  setup_sandbox();
  disable_smep_smap();
  get_root();
  check_root();
  while (true) {
    sleep(100);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <setup_sandbox@plt>
mov    $0x0,%al
call   1030 <disable_smep_smap@plt>
mov    $0x0,%al
call   1040 <get_root@plt>
mov    $0x0,%al
call   1050 <check_root@plt>
mov    $0x64,%edi
call   1070 <sleep@plt>
jmp    117b <main+0x2b>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <setup_sandbox@plt>
xor    %eax,%eax
call   1030 <disable_smep_smap@plt>
xor    %eax,%eax
call   1040 <get_root@plt>
xor    %eax,%eax
call   1050 <check_root@plt>
nopl   (%rax)
mov    $0x64,%edi
call   1070 <sleep@plt>
jmp    1170 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @setup_sandbox()
%3 = call i32 (...) @disable_smep_smap()
%4 = call i32 (...) @get_root()
%5 = call i32 (...) @check_root()
br label %6
6: ; preds = %0, %6
%7 = call i32 @sleep(i32 100)
br label %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup_sandbox()
%2 = tail call i32 (...) @disable_smep_smap()
%3 = tail call i32 (...) @get_root()
%4 = tail call i32 (...) @check_root()
br label %5
5: ; preds = %0, %5
%6 = tail call i32 @sleep(i32 100)
br label %5
}
unsigned long get_eflags(void) {
  unsigned long eflags;
  asm volatile("pushfq\n\tpopq %0" : "=rm"(eflags));
  return eflags;
}


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

x86 assembly (clang, -O2):
<get_eflags>:
pushf
pop    -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @get_eflags() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @get_eflags() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = load i64, i64* %1
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int _mm_ucomile_ss(int /*<<< orphan*/, int /*<<< orphan*/);
int test_mm_ucomile_ss(__m128 A, __m128 B) { return _mm_ucomile_ss(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_ucomile_ss>:
jmp    1030 <_mm_ucomile_ss@plt>

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

LLVM IR (-O2):
define i32 @test_mm_ucomile_ss(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_ucomile_ss(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int memcmp(char const *, char const *, int);
int strlen(char const *);
int matches(const char *cmd, const char *pattern) {
  int len = strlen(cmd);
  if (len > strlen(pattern))
    return -1;
  return memcmp(pattern, cmd, len);
}


x86 assembly (clang, -O0):
<matches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cmp    %ecx,%eax
jle    1164 <matches+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <matches+0x57>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <memcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matches>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
cmp    %eax,%ebp
jle    1147 <matches+0x27>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @matches(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp sgt i32 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memcmp(i8* %1, i8* %0, i32 %3)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ -1, %2 ]
ret i32 %9
}
int max(int a, int b) {
  if (a >= b) {
    return a;
  }
  return b;
}


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

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

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
double foo(double x) { return 1.0 / x; }


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

x86 assembly (clang, -O2):
<foo>:
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @foo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
ret double %4
}

LLVM IR (-O2):
define double @foo(double %0) {
%2 = fdiv double 1.000000e+00, %0
ret double %2
}
OP(dd, a1) { op_a1(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_a1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_a1()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ SIGSEGV;
int /*<<< orphan*/ kill(int, int /*<<< orphan*/);
int main() {
  kill(1, SIGSEGV);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edi
call   1030 <kill@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@SIGSEGV = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @SIGSEGV
%3 = call i32 @kill(i32 1, i32 %2)
ret i32 0
}

LLVM IR (-O2):
@SIGSEGV = global i32 0
define i32 @main() {
%1 = load i32, i32* @SIGSEGV
%2 = tail call i32 @kill(i32 1, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ serial_putc(int /*<<< orphan*/);
void Uart_SendString(char *s) {
  while (*s) {
    serial_putc(*s++);
  }
}


x86 assembly (clang, -O0):
<Uart_SendString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <Uart_SendString+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <serial_putc@plt>
jmp    111c <Uart_SendString+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @Uart_SendString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @serial_putc(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int compare_Type(const int64_t *x, const int64_t *y) {
  return (*x > *y) - (*x < *y);
}


x86 assembly (clang, -O0):
<compare_Type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x10(%rbp),%rdx
cmp    (%rdx),%rcx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_Type>:
mov    (%rdi),%rcx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%rcx
setg   %al
setl   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @compare_Type(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = load i64*, i64** %4
%8 = load i64, i64* %7
%9 = icmp sgt i64 %6, %8
%10 = zext i1 %9 to i32
%11 = load i64*, i64** %3
%12 = load i64, i64* %11
%13 = load i64*, i64** %4
%14 = load i64, i64* %13
%15 = icmp slt i64 %12, %14
%16 = zext i1 %15 to i32
%17 = sub nsw i32 %10, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @compare_Type(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
%5 = icmp sgt i64 %3, %4
%6 = zext i1 %5 to i32
%7 = icmp slt i64 %3, %4
%8 = sext i1 %7 to i32
%9 = add nsw i32 %8, %6
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void uae_reset(int hardreset) { printf("processor blocked: yes\n"); }


x86 assembly (clang, -O0):
<uae_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [23 x i8] c"processor blocked: yes\00"
define void @uae_reset(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void example4(void) {
  int a[42];
  int i = 41;
  while (i >= 12) {
    a[i] = 0;
    i--;
  }
  assert(a[i + 2] == 0);
  assert(a[41] == 0);
  assert(a[i] == 0);
  assert(a[0] == 0);
}


x86 assembly (clang, -O0):
<example4>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x29,-0xb4(%rbp)
cmpl   $0xc,-0xb4(%rbp)
jl     1158 <example4+0x48>
movslq -0xb4(%rbp),%rax
movl   $0x0,-0xb0(%rbp,%rax,4)
mov    -0xb4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xb4(%rbp)
jmp    1125 <example4+0x15>
mov    -0xb4(%rbp),%eax
add    $0x2,%eax
cltq
cmpl   $0x0,-0xb0(%rbp,%rax,4)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movslq -0xb4(%rbp),%rax
cmpl   $0x0,-0xb0(%rbp,%rax,4)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0xb0(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0xc0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @example4() {
%1 = alloca [42 x i32]
%2 = alloca i32
store i32 41, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 12
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 %8
store i32 0, i32* %9
%10 = load i32, i32* %2
%11 = add nsw i32 %10, -1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, 0
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 41
%22 = load i32, i32* %21
%23 = icmp eq i32 %22, 0
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = load i32, i32* %2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = icmp eq i32 %29, 0
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
%33 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 0
%34 = load i32, i32* %33
%35 = icmp eq i32 %34, 0
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
ret void
}

LLVM IR (-O2):
define void @example4() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 0)
%4 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glmATan3f_(float *);
int /*<<< orphan*/ glmDegrees3f_(float *);
void glmATanD3f_(float x[3]) {
  glmATan3f_(x);
  glmDegrees3f_(x);
}


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

x86 assembly (clang, -O2):
<glmATanD3f_>:
push   %rbx
mov    %rdi,%rbx
call   1030 <glmATan3f_@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <glmDegrees3f_@plt>

LLVM IR (-O0):
define void @glmATanD3f_(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 @glmATan3f_(float* %3)
%5 = load float*, float** %2
%6 = call i32 @glmDegrees3f_(float* %5)
ret void
}

LLVM IR (-O2):
define void @glmATanD3f_(float* %0) {
%2 = tail call i32 @glmATan3f_(float* %0)
%3 = tail call i32 @glmDegrees3f_(float* %0)
ret void
}
/* Variables and functions */
short foo5(int);
short int bar5(int x) { return foo5(x + 6); }


x86 assembly (clang, -O0):
<bar5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x6,%edi
call   1030 <foo5@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar5>:
add    $0x6,%edi
jmp    1030 <foo5@plt>

LLVM IR (-O0):
define signext i16 @bar5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 6
%5 = call signext i16 @foo5(i32 %4)
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @bar5(i32 %0) {
%2 = add nsw i32 %0, 6
%3 = tail call signext i16 @foo5(i32 %2)
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ set(int, int, int /*<<< orphan*/, int /*<<< orphan*/, int,
                       int);
void hstart_vs_alpha(int y, int invert) {
  set(120, y, 0, 0, (invert ? 0x7F : 0), 0x0002 | 0x0010);
  set(-120, y, 0, 0, (invert ? 0 : 0x7F), 0x0002 | 0x0010);
}


x86 assembly (clang, -O0):
<hstart_vs_alpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
xor    %r8d,%r8d
mov    $0x7f,%eax
cmp    $0x0,%ecx
cmovne %eax,%r8d
mov    $0x78,%edi
xor    %ecx,%ecx
mov    $0x12,%r9d
mov    %ecx,%edx
call   1030 <set@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
mov    $0x7f,%r8d
xor    %eax,%eax
cmp    $0x0,%ecx
cmovne %eax,%r8d
mov    $0xffffff88,%edi
xor    %ecx,%ecx
mov    $0x12,%r9d
mov    %ecx,%edx
call   1030 <set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hstart_vs_alpha>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%r8d
mov    %edi,%ebx
xor    %eax,%eax
test   %esi,%esi
mov    $0x7f,%ebp
cmovne %ebp,%r8d
cmovne %eax,%ebp
mov    $0x78,%edi
mov    %ebx,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x12,%r9d
call   1030 <set@plt>
mov    $0xffffff88,%edi
mov    %ebx,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %ebp,%r8d
mov    $0x12,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <set@plt>

LLVM IR (-O0):
define void @hstart_vs_alpha(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 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 127, i32 0
%10 = call i32 @set(i32 120, i32 %5, i32 0, i32 0, i32 %9, i32 18)
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 0, i32 127
%16 = call i32 @set(i32 -120, i32 %11, i32 0, i32 0, i32 %15, i32 18)
ret void
}

LLVM IR (-O2):
define void @hstart_vs_alpha(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 0, i32 127
%5 = tail call i32 @set(i32 120, i32 %0, i32 0, i32 0, i32 %4, i32 18)
%6 = select i1 %3, i32 127, i32 0
%7 = tail call i32 @set(i32 -120, i32 %0, i32 0, i32 0, i32 %6, i32 18)
ret void
}
/* Type definitions */
struct rtentry {
  int /*<<< orphan*/ *rt_dev;
};

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int route_destroy(struct rtentry *route) {
  if (((route)->rt_dev) != NULL) {
    free(((route)->rt_dev));
    ((route)->rt_dev) = NULL;
  }
  return 0;
}


x86 assembly (clang, -O0):
<route_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1141 <route_destroy+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<route_destroy>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <route_destroy+0x18>
call   1030 <free@plt>
movq   $0x0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.rtentry = type { i32* }
define i32 @route_destroy(%struct.rtentry* %0) {
%2 = alloca %struct.rtentry*
store %struct.rtentry* %0, %struct.rtentry** %2
%3 = load %struct.rtentry*, %struct.rtentry** %2
%4 = getelementptr inbounds %struct.rtentry, %struct.rtentry* %3, i32 0, i32 0
%5 = load i32*, i32** %4
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load %struct.rtentry*, %struct.rtentry** %2
%9 = getelementptr inbounds %struct.rtentry, %struct.rtentry* %8, i32 0, i32 0
%10 = load i32*, i32** %9
%11 = call i32 @free(i32* %10)
%12 = load %struct.rtentry*, %struct.rtentry** %2
%13 = getelementptr inbounds %struct.rtentry, %struct.rtentry* %12, i32 0, i32 0
store i32* null, i32** %13
br label %14
14: ; preds = %7, %1
ret i32 0
}

LLVM IR (-O2):
%struct.rtentry = type { i32* }
define i32 @route_destroy(%struct.rtentry* nocapture %0) {
%2 = getelementptr inbounds %struct.rtentry, %struct.rtentry* %0, i64 0, i32 0
%3 = load i32*, i32** %2
%4 = icmp eq i32* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @free(i32* %3)
store i32* null, i32** %2
br label %7
7: ; preds = %5, %1
ret i32 0
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_remove(struct list *);
struct list *list_tail(struct list *);
struct list *list_pop_tail(struct list *list) {
  struct list *e = list_tail(list);
  list_remove(e);
  return e;
}


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

x86 assembly (clang, -O2):
<list_pop_tail>:
push   %rbx
call   1030 <list_tail@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <list_remove@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.list = type { i32 }
define %struct.list* @list_pop_tail(%struct.list* %0) {
%2 = alloca %struct.list*
%3 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
%4 = load %struct.list*, %struct.list** %2
%5 = call %struct.list* @list_tail(%struct.list* %4)
store %struct.list* %5, %struct.list** %3
%6 = load %struct.list*, %struct.list** %3
%7 = call i32 @list_remove(%struct.list* %6)
%8 = load %struct.list*, %struct.list** %3
ret %struct.list* %8
}

LLVM IR (-O2):
%struct.list = type { i32 }
define %struct.list* @list_pop_tail(%struct.list* %0) {
%2 = tail call %struct.list* @list_tail(%struct.list* %0)
%3 = tail call i32 @list_remove(%struct.list* %2)
ret %struct.list* %2
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, double);
int main() {
  double nc;
  for (nc = 0; getchar() != EOF; nc++)
    ;
  printf("%.0f\n", nc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%rax
je     116a <main+0x4a>
jmp    1153 <main+0x33>
movsd  0xea5(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1137 <main+0x17>
movsd  -0x10(%rbp),%xmm0
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb5(%rip),%rbx
xorpd  %xmm0,%xmm0
cmp    (%rbx),%rax
je     1160 <main+0x40>
xorpd  %xmm0,%xmm0
addsd  0xeb8(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1040 <getchar@plt>
movsd  0x8(%rsp),%xmm0
cmp    (%rbx),%rax
jne    1140 <main+0x20>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [6 x i8] c"%.0f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
br label %3
3: ; preds = %8, %0
%4 = call i64 (...) @getchar()
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
br label %8
8: ; preds = %7
%9 = load double, double* %2
%10 = fadd double %9, 1.000000e+00
store double %10, double* %2
br label %3
11: ; preds = %3
%12 = load double, double* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %12)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [6 x i8] c"%.0f\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi double [ %6, %4 ], [ 0.000000e+00, %0 ]
%6 = fadd double %5, 1.000000e+00
%7 = tail call i64 (...) @getchar()
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
%11 = phi double [ 0.000000e+00, %0 ], [ %6, %4 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %11)
ret i32 0
}
int LZ4_embedded_compressBound(int isize) {
  return ((isize) + ((isize) / 255) + 16);
}


x86 assembly (clang, -O0):
<LZ4_embedded_compressBound>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_embedded_compressBound>:
movslq %edi,%rax
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x7,%ecx
add    %edx,%ecx
add    %ecx,%eax
add    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @LZ4_embedded_compressBound(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 255
%6 = add nsw i32 %3, %5
%7 = add nsw i32 %6, 16
ret i32 %7
}

LLVM IR (-O2):
define i32 @LZ4_embedded_compressBound(i32 %0) {
%2 = sdiv i32 %0, 255
%3 = add i32 %0, 16
%4 = add i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ RAND_load_file(char *, int);
void seed_prng(void) { RAND_load_file("/dev/urandom", 1024); }


x86 assembly (clang, -O0):
<seed_prng>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x400,%esi
call   1030 <RAND_load_file@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<seed_prng>:
lea    0xee9(%rip),%rdi
mov    $0x400,%esi
jmp    1030 <RAND_load_file@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/urandom\00"
define void @seed_prng() {
%1 = call i32 @RAND_load_file(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1024)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/urandom\00"
define void @seed_prng() {
%1 = tail call i32 @RAND_load_file(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1024)
ret void
}
int test_imm_4Cint32_mem(int *val) {
  return ((*val) & (0x4C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_4Cint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 76
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void cli(void) { asm volatile("cli" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @cli() {
tail call void asm sideeffect "cli", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
int g5(int a, int b) { return a * b; }


x86 assembly (clang, -O0):
<g5>:
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):
<g5>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @g5(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 @g5(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
long long longlong_ignoring_longdouble(long long x, long double y) { return x; }


x86 assembly (clang, -O0):
<longlong_ignoring_longdouble>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<longlong_ignoring_longdouble>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @longlong_ignoring_longdouble(i64 %0, x86_fp80 %1) {
%3 = alloca i64
%4 = alloca x86_fp80
store i64 %0, i64* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @longlong_ignoring_longdouble(i64 returned %0, x86_fp80 %1) {
ret i64 %0
}
unsigned long dl_Pow2(unsigned long dim) {
  unsigned long i = 1;
  while (i < dim)
    i <<= 1;
  return i;
}


x86 assembly (clang, -O0):
<dl_Pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    112f <dl_Pow2+0x2f>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <dl_Pow2+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dl_Pow2>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rcx,%rax
add    %rcx,%rcx
cmp    %rdi,%rax
jb     1110 <dl_Pow2+0x10>
ret

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

LLVM IR (-O2):
define i64 @dl_Pow2(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 1, %1 ], [ %5, %2 ]
%4 = icmp ult i64 %3, %0
%5 = shl i64 %3, 1
br i1 %4, label %2, label %6
6: ; preds = %2
ret i64 %3
}
int time_equals(double ta, double tb) {
  double d = tb - ta;
  return (d < 1e-6 && d > -1e-6);
}


x86 assembly (clang, -O0):
<time_equals>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
xor    %eax,%eax
movsd  0xed9(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
mov    %al,-0x19(%rbp)
jbe    114c <time_equals+0x4c>
movsd  -0x18(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_equals>:
subsd  %xmm0,%xmm1
movsd  0xef4(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
ucomisd 0xeed(%rip),%xmm1
seta   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @time_equals(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* %4
%7 = load double, double* %3
%8 = fsub double %6, %7
store double %8, double* %5
%9 = load double, double* %5
%10 = fcmp olt double %9, 0x3EB0C6F7A0B5ED8D
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load double, double* %5
%13 = fcmp ogt double %12, 0xBEB0C6F7A0B5ED8D
br label %14
14: ; preds = %11, %2
%15 = phi i1 [ false, %2 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @time_equals(double %0, double %1) {
%3 = fsub double %1, %0
%4 = fcmp olt double %3, 0x3EB0C6F7A0B5ED8D
%5 = fcmp ogt double %3, 0xBEB0C6F7A0B5ED8D
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
_Noreturn void myExit(int exit_status) {
  puts("myExit...");
  exit(exit_status);
}


x86 assembly (clang, -O0):
<myExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<myExit>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"myExit...\00"
define void @myExit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"myExit...\00"
define void @myExit(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
tail call void @exit(i32 %0)
unreachable
}
int isBiggest(int data[6], int size) {
  int i;
  for (i = 0; i < (size - 2); i++) {
    if (data[i] < data[i + 1]) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<isBiggest>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    1163 <isBiggest+0x63>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jge    1150 <isBiggest+0x50>
movl   $0x0,-0x4(%rbp)
jmp    116a <isBiggest+0x6a>
jmp    1155 <isBiggest+0x55>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <isBiggest+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBiggest>:
add    $0xfffffffe,%esi
xor    %eax,%eax
test   %esi,%esi
cmovle %eax,%esi
nopw   0x0(%rax,%rax,1)
cmp    %rax,%rsi
je     1128 <isBiggest+0x28>
mov    (%rdi,%rax,4),%ecx
lea    0x1(%rax),%rdx
cmp    0x4(%rdi,%rax,4),%ecx
mov    %rdx,%rax
jge    1110 <isBiggest+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isBiggest(i32* nocapture %0, i32 %1) {
%3 = add i32 %1, -2
%4 = call i32 @llvm.smax.i32(i32 %3, i32 0)
%5 = zext i32 %4 to i64
br label %6
6: ; preds = %9, %2
%7 = phi i64 [ %12, %9 ], [ 0, %2 ]
%8 = icmp eq i64 %7, %5
br i1 %8, label %16, label %9
9: ; preds = %6
%10 = getelementptr inbounds i32, i32* %0, i64 %7
%11 = load i32, i32* %10
%12 = add nuw nsw i64 %7, 1
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = icmp slt i32 %11, %14
br i1 %15, label %16, label %6
16: ; preds = %6, %9
%17 = phi i32 [ 0, %9 ], [ 1, %6 ]
ret i32 %17
}
int d_lt_rc1(double a1) { return (((a1) < (100))); }


x86 assembly (clang, -O0):
<d_lt_rc1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_lt_rc1>:
movsd  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @d_lt_rc1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 1.000000e+02
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @d_lt_rc1(double %0) {
%2 = fcmp olt double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
int /*<<< orphan*/ scanf(char *, long long *);
int main(void) {
  long long n, i, ans = 1;
  scanf("%d", &n);
  for (i = n; i > 1; i--)
    ans *= i;
  printf("%lld\n", ans);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x20(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x1,-0x18(%rbp)
jle    1178 <main+0x58>
mov    -0x18(%rbp),%rax
imul   -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    114f <main+0x2f>
mov    -0x20(%rbp),%rsi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%rax
mov    $0x1,%esi
cmp    $0x2,%rax
jl     1161 <main+0x41>
mov    $0x1,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
imul   %rax,%rsi
lea    -0x1(%rax),%rcx
cmp    $0x2,%rax
mov    %rcx,%rax
ja     1150 <main+0x30>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = icmp sgt i64 %4, 1
br i1 %5, label %6, label %12
6: ; preds = %0, %6
%7 = phi i64 [ %9, %6 ], [ 1, %0 ]
%8 = phi i64 [ %10, %6 ], [ %4, %0 ]
%9 = mul nsw i64 %7, %8
%10 = add nsw i64 %8, -1
%11 = icmp ugt i64 %8, 2
br i1 %11, label %6, label %12
12: ; preds = %6, %0
%13 = phi i64 [ 1, %0 ], [ %9, %6 ]
%14 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %13)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgshr(void) { gen("sarq\t%cl,%rax"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"sarq\09%cl,%rax\00"
define void @cgshr() {
%1 = call i32 @gen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"sarq\09%cl,%rax\00"
define void @cgshr() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
float c2f(float f) {
  float _temp = f * 9.0;
  _temp /= 5;
  _temp += 32;
  return _temp;
}


x86 assembly (clang, -O0):
<c2f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeee(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xed0(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xebb(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2f>:
mulss  0xef8(%rip),%xmm0
divss  0xef4(%rip),%xmm0
addss  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define float @c2f(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fmul double %5, 9.000000e+00
%7 = fptrunc double %6 to float
store float %7, float* %3
%8 = load float, float* %3
%9 = fdiv float %8, 5.000000e+00
store float %9, float* %3
%10 = load float, float* %3
%11 = fadd float %10, 3.200000e+01
store float %11, float* %3
%12 = load float, float* %3
ret float %12
}

LLVM IR (-O2):
define float @c2f(float %0) {
%2 = fmul float %0, 9.000000e+00
%3 = fdiv float %2, 5.000000e+00
%4 = fadd float %3, 3.200000e+01
ret float %4
}
/* Variables and functions */
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
scalar_t__ malloc(int);
int sscanf(char *, char *, int *);
int /*<<< orphan*/ stdin;
char *InputHandler(void) {
  char *buffer = (char *)malloc(256);
  int i;
  if (fgets(buffer, 256, stdin)) {
    if (1 == sscanf(buffer, "%d", &i)) {
    }
  }
  return buffer;
}


x86 assembly (clang, -O0):
<InputHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x100,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
mov    $0x100,%esi
call   1030 <fgets@plt>
cmp    $0x0,%rax
je     1194 <InputHandler+0x64>
mov    -0x8(%rbp),%rdi
lea    0xe8e(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <sscanf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jne    118f <InputHandler+0x5f>
jmp    118f <InputHandler+0x5f>
jmp    1194 <InputHandler+0x64>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InputHandler>:
push   %rbx
sub    $0x10,%rsp
mov    $0x100,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1030 <fgets@plt>
test   %rax,%rax
je     1171 <InputHandler+0x41>
lea    0xe9c(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <sscanf@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
define i8* @InputHandler() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i64 @malloc(i32 256)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = load i32, i32* @stdin
%7 = call i64 @fgets(i8* %5, i32 256, i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %0
%10 = load i8*, i8** %1
%11 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%12 = icmp eq i32 1, %11
br i1 %12, label %13, label %14
13: ; preds = %9
br label %14
14: ; preds = %13, %9
br label %15
15: ; preds = %14, %0
%16 = load i8*, i8** %1
ret i8* %16
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
define i8* @InputHandler() {
%1 = alloca i32
%2 = tail call i64 @malloc(i32 256)
%3 = inttoptr i64 %2 to i8*
%4 = bitcast i32* %1 to i8*
%5 = load i32, i32* @stdin
%6 = tail call i64 @fgets(i8* %3, i32 256, i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 @sscanf(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
br label %10
10: ; preds = %8, %0
ret i8* %3
}
int fun1122() { return 1122; }


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

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

LLVM IR (-O0):
define i32 @fun1122() {
ret i32 1122
}

LLVM IR (-O2):
define i32 @fun1122() {
ret i32 1122
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void monexit(int err) { printf(" sortie cote jardin code %d\n", err); }


x86 assembly (clang, -O0):
<monexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monexit>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [29 x i8] c" sortie cote jardin code %d\0A\00"
define void @monexit(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}