xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ close(int);
int open(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ write(int, char *, int);
void stop_servo(const char *run_path) {
  int fd;
  fd = open(run_path, O_WRONLY);
  perror("open");
  write(fd, "0", 1);
  perror("write");
  close(fd);
}


x86 assembly (clang, -O0):
<stop_servo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e81(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0xc(%rbp)
lea    0xe98(%rip),%rdi
call   1060 <perror@plt>
mov    -0xc(%rbp),%edi
lea    0xe8e(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
lea    0xe7f(%rip),%rdi
call   1060 <perror@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_servo>:
push   %rbx
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,%ebx
lea    0xea8(%rip),%rdi
call   1060 <perror@plt>
lea    0xea1(%rip),%rsi
mov    %ebx,%edi
mov    $0x1,%edx
call   1030 <write@plt>
lea    0xe90(%rip),%rdi
call   1060 <perror@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@.str = [5 x i8] c"open\00"
@.str.1 = [2 x i8] c"0\00"
@.str.2 = [6 x i8] c"write\00"
define void @stop_servo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_WRONLY
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %3
%9 = call i32 @write(i32 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%10 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32, i32* %3
%12 = call i32 @close(i32 %11)
ret void
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@.str = [5 x i8] c"open\00"
@.str.1 = [2 x i8] c"0\00"
@.str.2 = [6 x i8] c"write\00"
define void @stop_servo(i8* nocapture %0) {
%2 = load i32, i32* @O_WRONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @write(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%6 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @close(i32 %3)
ret void
}
void __attribute__((address_space(1))) *
    void_ptr_arithmetic_test(void __attribute__((address_space(1))) * arg) {
  return arg + 4;
}


x86 assembly (clang, -O0):
<void_ptr_arithmetic_test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<void_ptr_arithmetic_test>:
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i8 addrspace(1)* @void_ptr_arithmetic_test(i8 addrspace(1)* %0) {
%2 = alloca i8 addrspace(1)*
store i8 addrspace(1)* %0, i8 addrspace(1)** %2
%3 = load i8 addrspace(1)*, i8 addrspace(1)** %2
%4 = getelementptr i8, i8 addrspace(1)* %3, i64 4
ret i8 addrspace(1)* %4
}

LLVM IR (-O2):
define i8 addrspace(1)* @void_ptr_arithmetic_test(i8 addrspace(1)* readnone %0) {
%2 = getelementptr i8, i8 addrspace(1)* %0, i64 4
ret i8 addrspace(1)* %2
}
float fusion_float_read(float *p) { return p[0x12345]; }


x86 assembly (clang, -O0):
<fusion_float_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  0x48d14(%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fusion_float_read>:
movss  0x48d14(%rdi),%xmm0
ret

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

LLVM IR (-O2):
define float @fusion_float_read(float* nocapture %0) {
%2 = getelementptr inbounds float, float* %0, i64 74565
%3 = load float, float* %2
ret float %3
}
int ld_le_mm1(long double *a1, long double *a2) { return (((*a1) <= (*a2))); }


x86 assembly (clang, -O0):
<ld_le_mm1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    -0x10(%rbp),%rax
fldt   (%rax)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_le_mm1>:
fldt   (%rdi)
fldt   (%rsi)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setae  %al
ret

LLVM IR (-O0):
define i32 @ld_le_mm1(x86_fp80* %0, x86_fp80* %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80*, x86_fp80** %4
%8 = load x86_fp80, x86_fp80* %7
%9 = fcmp ole x86_fp80 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ld_le_mm1(x86_fp80* nocapture %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = load x86_fp80, x86_fp80* %1
%5 = fcmp ole x86_fp80 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int mvwprintw(int /*<<< orphan*/ *, int, int, char const *);
int n_mvwprintw(WINDOW *win, int y, int x, const char *fmt) {
  return (mvwprintw(win, y, x, fmt));
}


x86 assembly (clang, -O0):
<n_mvwprintw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <mvwprintw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_mvwprintw>:
jmp    1030 <mvwprintw@plt>

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

LLVM IR (-O2):
define i32 @n_mvwprintw(i32* %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @mvwprintw(i32* %0, i32 %1, i32 %2, i8* %3)
ret i32 %5
}
/* Variables and functions */
int posix_memalign(int /*<<< orphan*/ *, int, int);
int result;
int main() {
  void *ptr = NULL;
  int result = posix_memalign(&result, sizeof(double), 32 * sizeof(double));
  return result == 0 ? 0 : -2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
mov    $0x8,%esi
mov    $0x100,%edx
call   1030 <posix_memalign@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    $0xfffffffe,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
mov    $0x8,%esi
mov    $0x100,%edx
call   1030 <posix_memalign@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
lea    (%rcx,%rcx,1),%eax
add    $0xfffffffe,%eax
pop    %rcx
ret

LLVM IR (-O0):
@result = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
store i8* null, i8** %2
%4 = call i32 @posix_memalign(i32* %3, i32 8, i32 256)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 0, i32 -2
ret i32 %8
}

LLVM IR (-O2):
@result = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @posix_memalign(i32* %1, i32 8, i32 256)
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 0, i32 -2
ret i32 %5
}
int runFunction(int (*function)(int, int), int a, int b) {
  return (*function)(a, b);
}


x86 assembly (clang, -O0):
<runFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runFunction>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %edx,%esi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @runFunction(i32 (i32, i32)* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 %0(i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct index_packet {
  int dummy;
};

/* Variables and functions */
int pgread_big_endian(unsigned char *, struct index_packet *);
int pgread_little_endian(unsigned char *, struct index_packet *);
int bitpack__pgread(unsigned char *page, struct index_packet *target,
                    int little_endian) {
  if (little_endian)
    return pgread_little_endian(page, target);
  else
    return pgread_big_endian(page, target);
}


x86 assembly (clang, -O0):
<bitpack__pgread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1152 <bitpack__pgread+0x32>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <pgread_little_endian@plt>
mov    %eax,-0x4(%rbp)
jmp    1162 <bitpack__pgread+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <pgread_big_endian@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitpack__pgread>:
test   %edx,%edx
je     1129 <bitpack__pgread+0x9>
jmp    1040 <pgread_little_endian@plt>
jmp    1030 <pgread_big_endian@plt>

LLVM IR (-O0):
%struct.index_packet = type { i32 }
define i32 @bitpack__pgread(i8* %0, %struct.index_packet* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.index_packet*
%7 = alloca i32
store i8* %0, i8** %5
store %struct.index_packet* %1, %struct.index_packet** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i8*, i8** %5
%12 = load %struct.index_packet*, %struct.index_packet** %6
%13 = call i32 @pgread_little_endian(i8* %11, %struct.index_packet* %12)
store i32 %13, i32* %4
br label %18
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = load %struct.index_packet*, %struct.index_packet** %6
%17 = call i32 @pgread_big_endian(i8* %15, %struct.index_packet* %16)
store i32 %17, i32* %4
br label %18
18: ; preds = %14, %10
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
%struct.index_packet = type { i32 }
define i32 @bitpack__pgread(i8* %0, %struct.index_packet* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @pgread_little_endian(i8* %0, %struct.index_packet* %1)
br label %9
7: ; preds = %3
%8 = tail call i32 @pgread_big_endian(i8* %0, %struct.index_packet* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int contains(const char c, const char *matrix, size_t len) {
  size_t x;
  for (x = 0; x < len; x++)
    if ((char)matrix[x] == c)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<contains>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1162 <contains+0x62>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    114c <contains+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1169 <contains+0x69>
jmp    1151 <contains+0x51>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111a <contains+0x1a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains>:
test   %rdx,%rdx
je     111f <contains+0x1f>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmp    %dil,(%rsi,%rax,1)
je     1122 <contains+0x22>
add    $0x1,%rax
cmp    %rax,%rdx
jne    1110 <contains+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @contains(i8 signext %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %13, label %7
5: ; preds = %7
%6 = icmp eq i64 %12, %2
br i1 %6, label %13, label %7
7: ; preds = %3, %5
%8 = phi i64 [ %12, %5 ], [ 0, %3 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %0
%12 = add nuw i64 %8, 1
br i1 %11, label %13, label %5
13: ; preds = %7, %5, %3
%14 = phi i32 [ 0, %3 ], [ 0, %5 ], [ 1, %7 ]
ret i32 %14
}
void ff_hevc_put_hevc_epel_hv16_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_hv16_8_sse4() {
ret void
}
int gcd(int a, int b) {
  while (b) {
    int r = a % b;
    a = b;
    b = r;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <gcd+0x2f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
char *RCSid() {
  return RCSid("$Id: mouse.c,v 1.133.2.3 2012/10/27 02:24:37 sfeam Exp $");
}


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

x86 assembly (clang, -O2):
<RCSid>:
jmp    1100 <RCSid>

LLVM IR (-O0):
@.str = [57 x i8] c"$Id: mouse.c,v 1.133.2.3 2012/10/27 02:24:37 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
void __hv_div_f(float bIn0, float bIn1, float *bOut) {
  *bOut = (bIn1 != 0.0f) ? (bIn0 / bIn1) : 0.0f;
}


x86 assembly (clang, -O0):
<__hv_div_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    112e <__hv_div_f+0x2e>
jp     112e <__hv_div_f+0x2e>
jmp    1142 <__hv_div_f+0x42>
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    114f <__hv_div_f+0x4f>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    114f <__hv_div_f+0x4f>
movss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hv_div_f>:
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm1
jne    110a <__hv_div_f+0xa>
jnp    1111 <__hv_div_f+0x11>
divss  %xmm1,%xmm0
movaps %xmm0,%xmm2
movss  %xmm2,(%rdi)
ret

LLVM IR (-O0):
define void @__hv_div_f(float %0, float %1, float* %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float*
store float %0, float* %4
store float %1, float* %5
store float* %2, float** %6
%7 = load float, float* %5
%8 = fcmp une float %7, 0.000000e+00
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load float, float* %4
%11 = load float, float* %5
%12 = fdiv float %10, %11
br label %14
13: ; preds = %3
br label %14
14: ; preds = %13, %9
%15 = phi float [ %12, %9 ], [ 0.000000e+00, %13 ]
%16 = load float*, float** %6
store float %15, float* %16
ret void
}

LLVM IR (-O2):
define void @__hv_div_f(float %0, float %1, float* nocapture writeonly %2) {
%4 = fcmp une float %1, 0.000000e+00
%5 = fdiv float %0, %1
%6 = select i1 %4, float %5, float 0.000000e+00
store float %6, float* %2
ret void
}
/* Variables and functions */
unsigned int __builtin_cmpb(unsigned int, unsigned int);
unsigned int do_compare(unsigned int a, unsigned int b) {
  return __builtin_cmpb(a, b);
}


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

x86 assembly (clang, -O2):
<do_compare>:
jmp    1030 <__builtin_cmpb@plt>

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

LLVM IR (-O2):
define i32 @do_compare(i32 %0, i32 %1) {
%3 = tail call i32 @__builtin_cmpb(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
uint32_t __int8_t_encoded_array_size(const int8_t *p, uint32_t elements) {
  (void)p;
  return (1) * elements;
}


x86 assembly (clang, -O0):
<__int8_t_encoded_array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x0,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__int8_t_encoded_array_size(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 1, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @__int8_t_encoded_array_size(i32* nocapture readnone %0, i32 returned %1) {
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void rbtree_string_free(void *a) { free((char *)a); }


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

x86 assembly (clang, -O2):
<rbtree_string_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @rbtree_string_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_raw(int len, char *buf) {
  int i;
  for (i = 0; i < len; i++)
    printf("%02x ", (unsigned char)buf[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115a <print_raw+0x4a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <print_raw+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_raw>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1158 <print_raw+0x38>
mov    %rsi,%r15
mov    %edi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_raw+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%02x \00"
define void @print_raw(i32 %0, i8* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
scalar_t__ strlen(char const *);
long strtol(char const *, char **, int /*<<< orphan*/);
bool check_parse_long(const char *number, long *result) {
  char *endptr;
  if (strlen(number) == 0)
    return false;
  *result = strtol(number, &endptr, 0);
  return *endptr == '\0';
}


x86 assembly (clang, -O0):
<check_parse_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jne    114f <check_parse_long+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    117d <check_parse_long+0x5d>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
xor    %edx,%edx
call   1040 <strtol@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_parse_long>:
push   %rbx
sub    $0x10,%rsp
cmpb   $0x0,(%rdi)
je     113b <check_parse_long+0x2b>
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %rax,(%rbx)
mov    0x8(%rsp),%rcx
xor    %eax,%eax
cmpb   $0x0,(%rcx)
sete   %al
jmp    113d <check_parse_long+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @check_parse_long(i8* %0, i64* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = call i64 @strtol(i8* %0, i8** %3, i32 0)
store i64 %8, i64* %1
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %2, %7
%14 = phi i32 [ %12, %7 ], [ 0, %2 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int system(char *);
int do_iptables_cmd(char *cmd) {
  int result = 0;
  char ip_cmd[1024];
  sprintf(ip_cmd, "iptables %s", cmd);
  debug("iptables command:%s\n", ip_cmd);
  result = system(ip_cmd);
  return result;
}


x86 assembly (clang, -O0):
<do_iptables_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xea8(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x410(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <debug@plt>
lea    -0x410(%rbp),%rdi
call   1040 <system@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_iptables_cmd>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rdx
lea    0xebe(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
call   1030 <debug@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"iptables %s\00"
@.str.1 = [21 x i8] c"iptables command:%s\0A\00"
define i32 @do_iptables_cmd(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [1024 x i8]
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%9 = call i32 @debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%11 = call i32 @system(i8* %10)
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [12 x i8] c"iptables %s\00"
@.str.1 = [21 x i8] c"iptables command:%s\0A\00"
define i32 @do_iptables_cmd(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = call i32 @system(i8* %3)
ret i32 %6
}
int fun676() { return 676; }


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

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

LLVM IR (-O0):
define i32 @fun676() {
ret i32 676
}

LLVM IR (-O2):
define i32 @fun676() {
ret i32 676
}
/* Variables and functions */
int sqliterkGetMaxVarintLength() { return 9; }


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

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

LLVM IR (-O0):
define i32 @sqliterkGetMaxVarintLength() {
ret i32 9
}

LLVM IR (-O2):
define i32 @sqliterkGetMaxVarintLength() {
ret i32 9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void nph_header(char *status) {
  printf("HTTP/1.0 %s\n", status);
  printf("Server: CGI using cgihtml\n");
}


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

x86 assembly (clang, -O2):
<nph_header>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"HTTP/1.0 %s\0A\00"
@.str.1 = [27 x i8] c"Server: CGI using cgihtml\0A\00"
define void @nph_header(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"HTTP/1.0 %s\0A\00"
@str = [26 x i8] c"Server: CGI using cgihtml\00"
define void @nph_header(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long GetBorderSize67();
unsigned long getbordersize() { return GetBorderSize67(); }


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

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

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

LLVM IR (-O2):
define i64 @getbordersize() {
%1 = tail call i64 (...) @GetBorderSize67()
ret i64 %1
}
int isnand(long double x) {
  unsigned int xexp;
  unsigned long long int mant;
  xexp = ((*(unsigned long long *)(&x)) >> (52)) & 0x7ff;
  mant = ((*(unsigned long long *)(&x)) & 0xFFFFFFFFFFFFF);
  return ((xexp == 2047) && (mant != 0));
}


x86 assembly (clang, -O0):
<isnand>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x34,%rax
and    $0x7ff,%rax
mov    %eax,-0x14(%rbp)
movabs $0xfffffffffffff,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmpl   $0x7ff,-0x14(%rbp)
mov    %al,-0x21(%rbp)
jne    114a <isnand+0x4a>
cmpq   $0x0,-0x20(%rbp)
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnand>:
mov    0x8(%rsp),%rax
mov    %rax,%rcx
not    %rcx
movabs $0x7ff0000000000000,%rdx
test   %rdx,%rcx
sete   %cl
shl    $0xc,%rax
setne  %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @isnand(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca i32
%4 = alloca i64
store x86_fp80 %0, x86_fp80* %2
%5 = bitcast x86_fp80* %2 to i64*
%6 = load i64, i64* %5
%7 = lshr i64 %6, 52
%8 = and i64 %7, 2047
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
%10 = bitcast x86_fp80* %2 to i64*
%11 = load i64, i64* %10
%12 = and i64 %11, 4503599627370495
store i64 %12, i64* %4
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 2047
br i1 %14, label %15, label %18
15: ; preds = %1
%16 = load i64, i64* %4
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %15, %1
%19 = phi i1 [ false, %1 ], [ %17, %15 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @isnand(x86_fp80 %0) {
%2 = bitcast x86_fp80 %0 to i80
%3 = trunc i80 %2 to i64
%4 = and i64 %3, 4503599627370495
%5 = and i64 %3, 9218868437227405312
%6 = icmp eq i64 %5, 9218868437227405312
%7 = icmp ne i64 %4, 0
%8 = and i1 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
long rand();
long rand_range_long(long min_n, long max_n) {
  return rand() % (max_n - min_n + 1) + min_n;
}


x86 assembly (clang, -O0):
<rand_range_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x10(%rbp),%rcx
sub    -0x8(%rbp),%rcx
add    $0x1,%rcx
cqto
idiv   %rcx
mov    %rdx,%rax
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_range_long>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <rand@plt>
sub    %r14,%rbx
add    $0x1,%rbx
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     113e <rand_range_long+0x2e>
cqto
idiv   %rbx
mov    %rdx,%rax
jmp    1144 <rand_range_long+0x34>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @rand_range_long(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 (...) @rand()
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = srem i64 %5, %9
%11 = load i64, i64* %3
%12 = add nsw i64 %10, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @rand_range_long(i64 %0, i64 %1) {
%3 = tail call i64 (...) @rand()
%4 = sub i64 1, %0
%5 = add i64 %4, %1
%6 = srem i64 %3, %5
%7 = add nsw i64 %6, %0
ret i64 %7
}
void free_matr(m) double **m;
{
  free(m[0]);
  free(m);
}


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

x86 assembly (clang, -O2):
<free_matr>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_matr(double** %0) {
%2 = alloca double**
store double** %0, double*** %2
%3 = load double**, double*** %2
%4 = getelementptr inbounds double*, double** %3, i64 0
%5 = load double*, double** %4
%6 = bitcast double* %5 to i8*
%7 = load double**, double*** %2
%8 = bitcast double** %7 to i8*
ret void
}

LLVM IR (-O2):
define void @free_matr(double** nocapture %0) {
%2 = bitcast double** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast double** %0 to i8*
tail call void @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void putk(int c) {
  char ch = c;
  if (c == 0)
    return;
  if (c == '\n')
    putk('\r');
  (void)write(2, &ch, 1);
}


x86 assembly (clang, -O0):
<putk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1140 <putk+0x20>
jmp    1167 <putk+0x47>
cmpl   $0xa,-0x4(%rbp)
jne    1154 <putk+0x34>
mov    $0xd,%edi
call   1040 <putk@plt>
mov    $0x2,%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putk>:
push   %rax
mov    %dil,0x6(%rsp)
test   %edi,%edi
je     114c <putk+0x3c>
cmp    $0xa,%edi
jne    1138 <putk+0x28>
movb   $0xd,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x2,%edi
mov    $0x1,%edx
call   1030 <write@plt>
lea    0x6(%rsp),%rsi
mov    $0x2,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @putk(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
store i8 %5, i8* %3
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %15
9: ; preds = %1
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 10
br i1 %11, label %12, label %13
12: ; preds = %9
br label %13
13: ; preds = %12, %9
%14 = call i32 @write(i32 2, i8* %3, i32 1)
br label %15
15: ; preds = %13, %8
ret void
}

LLVM IR (-O2):
define void @putk(i32 %0) {
%2 = alloca i8
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
switch i32 %0, label %7 [
i32 0, label %9
i32 10, label %5
]
5: ; preds = %1
store i8 13, i8* %2
%6 = call i32 @write(i32 2, i8* %2, i32 1)
br label %7
7: ; preds = %1, %5
%8 = call i32 @write(i32 2, i8* %3, i32 1)
br label %9
9: ; preds = %1, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ to_point(int /*<<< orphan*/, int);
int /*<<< orphan*/ turn(int /*<<< orphan*/);
int turn_up() {
  turn(to_point(0, 1));
  return 1;
}


x86 assembly (clang, -O0):
<turn_up>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <turn@plt>
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @turn_up() {
%1 = call i32 @to_point(i32 0, i32 1)
%2 = call i32 @turn(i32 %1)
ret i32 1
}

LLVM IR (-O2):
define i32 @turn_up() {
%1 = tail call i32 @to_point(i32 0, i32 1)
%2 = tail call i32 @turn(i32 %1)
ret i32 1
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int random_standard_complex(double *re, double *im) {
  int *a, *b, fail;
  double c[2];
  fail = _ada_use_c2phc(280, a, b, c);
  *re = c[0];
  *im = c[1];
  return fail;
}


x86 assembly (clang, -O0):
<random_standard_complex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x40(%rbp),%rcx
mov    $0x118,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x24(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x24(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_standard_complex>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rcx
mov    $0x118,%edi
call   1030 <_ada_use_c2phc@plt>
movsd  (%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @random_standard_complex(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca [2 x double]
store double* %0, double** %3
store double* %1, double** %4
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%12 = call i32 @_ada_use_c2phc(i32 280, i32* %9, i32* %10, double* %11)
store i32 %12, i32* %7
%13 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%14 = load double, double* %13
%15 = load double*, double** %3
store double %14, double* %15
%16 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 1
%17 = load double, double* %16
%18 = load double*, double** %4
store double %17, double* %18
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @random_standard_complex(double* nocapture writeonly %0, double* nocapture writeonly %1) {
%3 = alloca [2 x double]
%4 = bitcast [2 x double]* %3 to i8*
%5 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%6 = call i32 @_ada_use_c2phc(i32 280, i32* undef, i32* undef, double* %5)
%7 = load double, double* %5
store double %7, double* %0
%8 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 1
%9 = load double, double* %8
store double %9, double* %1
ret i32 %6
}
void bit_set(int *tbl, int l, unsigned int bit) {
  int b;
  b = bit % 32;
  bit = bit / 32;
  tbl[bit % l] |= 1 << b;
}


x86 assembly (clang, -O0):
<bit_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x5,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    -0x20(%rbp),%rax
mov    %edx,%ecx
mov    -0x18(%rbp),%edx
mov    %ecx,%ecx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_set>:
mov    %edx,%ecx
mov    %edx,%eax
shr    $0x5,%eax
mov    $0x1,%r8d
shl    %cl,%r8d
xor    %edx,%edx
div    %esi
or     %r8d,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @bit_set(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
%8 = load i32, i32* %6
%9 = urem i32 %8, 32
store i32 %9, i32* %7
%10 = load i32, i32* %6
%11 = udiv i32 %10, 32
store i32 %11, i32* %6
%12 = load i32, i32* %7
%13 = shl i32 1, %12
%14 = load i32*, i32** %4
%15 = load i32, i32* %6
%16 = load i32, i32* %5
%17 = urem i32 %15, %16
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %14, i64 %18
%20 = load i32, i32* %19
%21 = or i32 %20, %13
store i32 %21, i32* %19
ret void
}

LLVM IR (-O2):
define void @bit_set(i32* nocapture %0, i32 %1, i32 %2) {
%4 = and i32 %2, 31
%5 = lshr i32 %2, 5
%6 = shl nuw i32 1, %4
%7 = urem i32 %5, %1
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = or i32 %10, %6
store i32 %11, i32* %9
ret void
}
/* Variables and functions */
int pow(int, int);
int lengthof(char *i) {
  int j;
  for (j = 0; (j < (pow(2, sizeof(int)))) && (i[j] != '\0'); ++j)
    ;
  return j;
}


x86 assembly (clang, -O0):
<lengthof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x2,%edi
mov    $0x4,%esi
call   1030 <pow@plt>
mov    -0x14(%rbp),%ecx
mov    %eax,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0xd(%rbp)
jge    115f <lengthof+0x4f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    116f <lengthof+0x5f>
jmp    1182 <lengthof+0x72>
jmp    1174 <lengthof+0x64>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <lengthof+0x13>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lengthof>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x2,%edi
mov    $0x4,%esi
call   1030 <pow@plt>
xor    %ebx,%ebx
test   %eax,%eax
jle    1151 <lengthof+0x41>
nopl   0x0(%rax)
cmpb   $0x0,(%r14,%rbx,1)
je     1151 <lengthof+0x41>
add    $0x1,%rbx
mov    $0x2,%edi
mov    $0x4,%esi
call   1030 <pow@plt>
cltq
cmp    %rax,%rbx
jl     1130 <lengthof+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @lengthof(i8* nocapture %0) {
%2 = tail call i32 @pow(i32 2, i32 4)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %17
4: ; preds = %1, %9
%5 = phi i64 [ %10, %9 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %4
%10 = add nuw nsw i64 %5, 1
%11 = tail call i32 @pow(i32 2, i32 4)
%12 = sext i32 %11 to i64
%13 = icmp slt i64 %10, %12
br i1 %13, label %4, label %14
14: ; preds = %9, %4
%15 = phi i64 [ %5, %4 ], [ %10, %9 ]
%16 = trunc i64 %15 to i32
br label %17
17: ; preds = %14, %1
%18 = phi i32 [ 0, %1 ], [ %16, %14 ]
ret i32 %18
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, void const *, size_t);
void memcpyx(char *target, const void *source, uint32_t ct,
             const char extra_char) {
  memcpy(target, source, ct);
  target[ct] = extra_char;
}


x86 assembly (clang, -O0):
<memcpyx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x19(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpyx>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rdi,%rbp
call   1030 <memcpy@plt>
mov    %r14b,0x0(%rbp,%rbx,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @memcpyx(i8* %0, i8* %1, i64 %2, i8 signext %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i8 %3, i8* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = call i32 @memcpy(i8* %9, i8* %10, i64 %11)
%13 = load i8, i8* %8
%14 = load i8*, i8** %5
%15 = load i64, i64* %7
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8 %13, i8* %16
ret void
}

LLVM IR (-O2):
define void @memcpyx(i8* %0, i8* %1, i64 %2, i8 signext %3) {
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
%6 = getelementptr inbounds i8, i8* %0, i64 %2
store i8 %3, i8* %6
ret void
}