xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned char toupper(unsigned char);
void buff_to_upper(unsigned char *dest, unsigned char *source, int max) {
  int i;
  for (i = 0; i < max; i++)
    dest[i] = toupper(source[i]);
}


x86 assembly (clang, -O0):
<buff_to_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1162 <buff_to_upper+0x52>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <buff_to_upper+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buff_to_upper>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1147 <buff_to_upper+0x37>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <buff_to_upper+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @buff_to_upper(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = tail call zeroext i8 @toupper(i8 zeroext %10)
%12 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 %11, i8* %12
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int repeticao(int *, int);
int main() {
  int v[] = {1, 2, 3, 4};
  printf("%d", repeticao(v, 4));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1040 <repeticao@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1040 <repeticao@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.v = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
store i32 0, i32* %1
%3 = bitcast [4 x i32]* %2 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = call i32 @repeticao(i32* %4, i32 4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.v = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @repeticao(i32* %3, i32 4)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void sk_zero(void) {}


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

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

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

LLVM IR (-O2):
define void @sk_zero() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void sapi_inet_tcp_server_destroy(int sock) { close(sock); }


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

x86 assembly (clang, -O2):
<sapi_inet_tcp_server_destroy>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @sapi_inet_tcp_server_destroy(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Type definitions */
struct rescache {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(struct rescache *);
int /*<<< orphan*/ release(struct rescache *, void const *);
void rescache_release(struct rescache *cache, void const *data) {
  assert(cache);
  (void)release(cache, data);
}


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

x86 assembly (clang, -O2):
<rescache_release>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <release@plt>

LLVM IR (-O0):
%struct.rescache = type { i32 }
define void @rescache_release(%struct.rescache* %0, i8* %1) {
%3 = alloca %struct.rescache*
%4 = alloca i8*
store %struct.rescache* %0, %struct.rescache** %3
store i8* %1, i8** %4
%5 = load %struct.rescache*, %struct.rescache** %3
%6 = call i32 @assert(%struct.rescache* %5)
%7 = load %struct.rescache*, %struct.rescache** %3
%8 = load i8*, i8** %4
%9 = call i32 @release(%struct.rescache* %7, i8* %8)
ret void
}

LLVM IR (-O2):
%struct.rescache = type { i32 }
define void @rescache_release(%struct.rescache* %0, i8* %1) {
%3 = tail call i32 @assert(%struct.rescache* %0)
%4 = tail call i32 @release(%struct.rescache* %0, i8* %1)
ret void
}
unsigned long SPICRCPolGet(unsigned long ulBase) {

  ;
  return (*((volatile unsigned long *)(ulBase + 0x00000010)));
}


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

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

LLVM IR (-O0):
define i64 @SPICRCPolGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 16
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @SPICRCPolGet(i64 %0) {
%2 = add i64 %0, 16
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ board_flash_get_datafs_size();
int /*<<< orphan*/ board_flash_read_datafs(char *, int /*<<< orphan*/);
char *malloc(int /*<<< orphan*/);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int /*<<< orphan*/);
char *flash_read_datafs() {
  char *big_buf = malloc(board_flash_get_datafs_size());
  memset(big_buf, 0, board_flash_get_datafs_size());
  board_flash_read_datafs(big_buf, board_flash_get_datafs_size());
  return big_buf;
}


x86 assembly (clang, -O0):
<flash_read_datafs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1060 <board_flash_get_datafs_size@plt>
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <board_flash_get_datafs_size@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <board_flash_get_datafs_size@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1050 <board_flash_read_datafs@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_read_datafs>:
push   %rbx
xor    %eax,%eax
call   1060 <board_flash_get_datafs_size@plt>
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <board_flash_get_datafs_size@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1030 <memset@plt>
xor    %eax,%eax
call   1060 <board_flash_get_datafs_size@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <board_flash_read_datafs@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @flash_read_datafs() {
%1 = alloca i8*
%2 = call i32 (...) @board_flash_get_datafs_size()
%3 = call i8* @malloc(i32 %2)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 (...) @board_flash_get_datafs_size()
%6 = call i32 @memset(i8* %4, i32 0, i32 %5)
%7 = load i8*, i8** %1
%8 = call i32 (...) @board_flash_get_datafs_size()
%9 = call i32 @board_flash_read_datafs(i8* %7, i32 %8)
%10 = load i8*, i8** %1
ret i8* %10
}

LLVM IR (-O2):
define i8* @flash_read_datafs() {
%1 = tail call i32 (...) @board_flash_get_datafs_size()
%2 = tail call i8* @malloc(i32 %1)
%3 = tail call i32 (...) @board_flash_get_datafs_size()
%4 = tail call i32 @memset(i8* %2, i32 0, i32 %3)
%5 = tail call i32 (...) @board_flash_get_datafs_size()
%6 = tail call i32 @board_flash_read_datafs(i8* %2, i32 %5)
ret i8* %2
}
int fun_coverage_dowhile(int x) {
  int ret = 0;
  int iloop = 0;
  do {
    ret += 2;
    iloop++;
  } while (iloop < x);
  return ret;
}


x86 assembly (clang, -O0):
<fun_coverage_dowhile>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     1115 <fun_coverage_dowhile+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_coverage_dowhile>:
cmp    $0x2,%edi
mov    $0x1,%eax
cmovge %edi,%eax
add    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @fun_coverage_dowhile(i32 %0) {
%2 = call i32 @llvm.smax.i32(i32 %0, i32 1)
%3 = shl nuw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void space() { printf("\n\n\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"\0A\0A\00"
define void @space() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int checkArgs(int n, int argc) {
  if (n != argc) {
    printf("ERROR: wrong number of args\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<checkArgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1142 <checkArgs+0x32>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1149 <checkArgs+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkArgs>:
xor    %eax,%eax
cmp    %esi,%edi
je     112c <checkArgs+0x1c>
push   %rax
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"ERROR: wrong number of args\0A\00"
define i32 @checkArgs(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 ne i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@str = [28 x i8] c"ERROR: wrong number of args\00"
define i32 @checkArgs(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
double pop();
int /*<<< orphan*/ push(double);
void swap_first2(void) {
  double op1 = 0.0, op2 = 0.0;
  op1 = pop();
  op2 = pop();
  push(op1);
  push(op2);
}


x86 assembly (clang, -O0):
<swap_first2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <pop@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <push@plt>
movsd  -0x10(%rbp),%xmm0
call   1040 <push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_first2>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <push@plt>
movsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
jmp    1040 <push@plt>

LLVM IR (-O0):
define void @swap_first2() {
%1 = alloca double
%2 = alloca double
store double 0.000000e+00, double* %1
store double 0.000000e+00, double* %2
%3 = call double (...) @pop()
store double %3, double* %1
%4 = call double (...) @pop()
store double %4, double* %2
%5 = load double, double* %1
%6 = call i32 @push(double %5)
%7 = load double, double* %2
%8 = call i32 @push(double %7)
ret void
}

LLVM IR (-O2):
define void @swap_first2() {
%1 = tail call double (...) @pop()
%2 = tail call double (...) @pop()
%3 = tail call i32 @push(double %1)
%4 = tail call i32 @push(double %2)
ret void
}
/* Variables and functions */
int my_getnbr_base(char *, char *);
scalar_t__ my_strnbr(int, char *);
char *convert_base(char *nbr, char *base_from, char *base_to) {
  int nb;
  char *tab;
  nb = my_getnbr_base(nbr, base_from);
  tab = (char *)my_strnbr(nb, base_to);
  return (tab);
}


x86 assembly (clang, -O0):
<convert_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <my_getnbr_base@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <my_strnbr@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_base>:
push   %rbx
mov    %rdx,%rbx
call   1040 <my_getnbr_base@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <my_strnbr@plt>

LLVM IR (-O0):
define i8* @convert_base(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = call i32 @my_getnbr_base(i8* %9, i8* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i8*, i8** %6
%14 = call i64 @my_strnbr(i32 %12, i8* %13)
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %8
%16 = load i8*, i8** %8
ret i8* %16
}

LLVM IR (-O2):
define i8* @convert_base(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @my_getnbr_base(i8* %0, i8* %1)
%5 = tail call i64 @my_strnbr(i32 %4, i8* %2)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void sig_handler(int signo) { signal(SIGPIPE, SIG_IGN); }


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGPIPE
%4 = load i32, i32* @SIG_IGN
%5 = call i32 @signal(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define void @sig_handler(i32 %0) {
%2 = load i32, i32* @SIGPIPE
%3 = load i32, i32* @SIG_IGN
%4 = tail call i32 @signal(i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
int main(void) {
  unsigned char ch = 'M';
  printf("character: %c\n", ch);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"character: %c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 zeroext 77)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printIntArray(int *array, int n) {
  int i;
  for (i = 0; i < n; ++i) {
    printf("%d,", array[i]);
  }
}


x86 assembly (clang, -O0):
<printIntArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <printIntArray+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printIntArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printIntArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <printIntArray+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printIntArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d,\00"
define void @printIntArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void help_function(char *bin_name) {
  printf("%s <number of blocks>\n", bin_name);
  printf("each block is = 1kb\n");
}


x86 assembly (clang, -O0):
<help_function>:
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    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"%s <number of blocks>\0A\00"
@.str.1 = [21 x i8] c"each block is = 1kb\0A\00"
define void @help_function(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"%s <number of blocks>\0A\00"
@str = [20 x i8] c"each block is = 1kb\00"
define void @help_function(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
int cmpDoubles(double a, double b) {
  a -= b;
  if (a < -0.00000000001)
    return -1;
  if (a > 0.00000000001)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cmpDoubles>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed7(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1140 <cmpDoubles+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <cmpDoubles+0x6a>
movsd  -0x10(%rbp),%xmm0
movsd  0xebb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1163 <cmpDoubles+0x63>
movl   $0x1,-0x4(%rbp)
jmp    116a <cmpDoubles+0x6a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpDoubles>:
subsd  %xmm1,%xmm0
xor    %ecx,%ecx
ucomisd 0xef2(%rip),%xmm0
seta   %cl
movsd  0xeef(%rip),%xmm1
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmpDoubles(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fsub double %7, %6
store double %8, double* %4
%9 = load double, double* %4
%10 = fcmp olt double %9, 0xBDA5FD7FE1796495
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %17
12: ; preds = %2
%13 = load double, double* %4
%14 = fcmp ogt double %13, 0x3DA5FD7FE1796495
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 1, i32* %3
br label %17
16: ; preds = %12
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @cmpDoubles(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fcmp olt double %3, 0xBDA5FD7FE1796495
%5 = fcmp ogt double %3, 0x3DA5FD7FE1796495
%6 = zext i1 %5 to i32
%7 = select i1 %4, i32 -1, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 1, *j = &i, **k = &j;
  printf("%d", **k);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ test_polyorcbintree();
int /*<<< orphan*/ test_polyorcmatcher();
int main(int argc, char **argv) {
  test_polyorcbintree();
  test_polyorcmatcher();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_polyorcbintree@plt>
mov    $0x0,%al
call   1040 <test_polyorcmatcher@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_polyorcbintree@plt>
xor    %eax,%eax
call   1040 <test_polyorcmatcher@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_polyorcbintree()
%7 = call i32 (...) @test_polyorcmatcher()
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_polyorcbintree()
%4 = tail call i32 (...) @test_polyorcmatcher()
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ msg(int, char *);
void deltas_start_thread(void) {
  msg(0x100, "deltas_start_thread called\n");
  exit(1);
}


x86 assembly (clang, -O0):
<deltas_start_thread>:
push   %rbp
mov    %rsp,%rbp
mov    $0x100,%edi
lea    0xed0(%rip),%rsi
call   1040 <msg@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<deltas_start_thread>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x100,%edi
call   1040 <msg@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"deltas_start_thread called\0A\00"
define void @deltas_start_thread() {
%1 = call i32 @msg(i32 256, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [28 x i8] c"deltas_start_thread called\0A\00"
define void @deltas_start_thread() {
%1 = tail call i32 @msg(i32 256, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ StabilizationSettingsHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void StabilizationSettingsLogging() {
  UAVObjLogging(StabilizationSettingsHandle());
}


x86 assembly (clang, -O0):
<StabilizationSettingsLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <StabilizationSettingsHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StabilizationSettingsLogging>:
push   %rax
xor    %eax,%eax
call   1040 <StabilizationSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @StabilizationSettingsLogging() {
%1 = call i32 (...) @StabilizationSettingsHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @StabilizationSettingsLogging() {
%1 = tail call i32 (...) @StabilizationSettingsHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
double pow(int, int);
int hiperfatorial(int n) {
  double ret = 1.0;
  do
    ret *= pow(n, n);
  while (n-- > 1);
  return (int)ret;
}


x86 assembly (clang, -O0):
<hiperfatorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movsd  0xedd(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <pow@plt>
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x1,%eax
jg     1128 <hiperfatorial+0x18>
cvttsd2si -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hiperfatorial>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movsd  0xee1(%rip),%xmm0
nop
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
mov    %ebx,%esi
call   1030 <pow@plt>
movsd  0x8(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
jg     1120 <hiperfatorial+0x10>
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hiperfatorial(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
store double 1.000000e+00, double* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = call double @pow(i32 %5, i32 %6)
%8 = load double, double* %3
%9 = fmul double %8, %7
store double %9, double* %3
br label %10
10: ; preds = %4
%11 = load i32, i32* %2
%12 = add nsw i32 %11, -1
store i32 %12, i32* %2
%13 = icmp sgt i32 %11, 1
br i1 %13, label %4, label %14
14: ; preds = %10
%15 = load double, double* %3
%16 = fptosi double %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @hiperfatorial(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %7, %2 ]
%4 = phi double [ 1.000000e+00, %1 ], [ %6, %2 ]
%5 = tail call double @pow(i32 %3, i32 %3)
%6 = fmul double %4, %5
%7 = add nsw i32 %3, -1
%8 = icmp sgt i32 %3, 1
br i1 %8, label %2, label %9
9: ; preds = %2
%10 = fptosi double %6 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ set_xy(int /*<<< orphan*/, int);
void fill_tilde(int start) {
  int i;
  for (i = start; i < 24; i++) {
    set_xy(0, i);
    printf("~");
  }
}


x86 assembly (clang, -O0):
<fill_tilde>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x18,-0x8(%rbp)
jge    115f <fill_tilde+0x3f>
mov    -0x8(%rbp),%esi
xor    %edi,%edi
call   1040 <set_xy@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <fill_tilde+0x11>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_tilde>:
push   %rbx
cmp    $0x17,%edi
jg     114b <fill_tilde+0x2b>
mov    %edi,%ebx
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
mov    %ebx,%esi
call   1040 <set_xy@plt>
mov    $0x7e,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x18,%ebx
jne    1130 <fill_tilde+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @fill_tilde(i32 %0) {
%2 = icmp slt i32 %0, 24
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = tail call i32 @set_xy(i32 0, i32 %4)
%6 = tail call i32 @putchar(i32 126)
%7 = add i32 %4, 1
%8 = icmp eq i32 %7, 24
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret void
}
/* Variables and functions */
scalar_t__ fmod(double, double);
int /*<<< orphan*/ link_failure_fmod();
void test_fmod(double d1, double d2) {
  if (fmod(d1, d2) != fmod(d1, d2))
    link_failure_fmod();
}


x86 assembly (clang, -O0):
<test_fmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <fmod@plt>
mov    %rax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <fmod@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     116b <test_fmod+0x4b>
mov    $0x0,%al
call   1040 <link_failure_fmod@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fmod>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
call   1030 <fmod@plt>
mov    %rax,%rbx
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1030 <fmod@plt>
cmp    %rax,%rbx
jne    1153 <test_fmod+0x33>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_fmod@plt>

LLVM IR (-O0):
define void @test_fmod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i64 @fmod(double %5, double %6)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = call i64 @fmod(double %8, double %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_fmod()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_fmod(double %0, double %1) {
%3 = tail call i64 @fmod(double %0, double %1)
%4 = tail call i64 @fmod(double %0, double %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_fmod()
br label %8
8: ; preds = %6, %2
ret void
}
int ptrace_sandbox_get_arg(struct pt_sandbox *p_sandbox, int arg,
                           unsigned long *p_out) {
  (void)p_sandbox;
  (void)arg;
  (void)p_out;
  return -1;
}


x86 assembly (clang, -O0):
<ptrace_sandbox_get_arg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pt_sandbox = type opaque
define i32 @ptrace_sandbox_get_arg(%struct.pt_sandbox* %0, i32 %1, i64* %2) {
%4 = alloca %struct.pt_sandbox*
%5 = alloca i32
%6 = alloca i64*
store %struct.pt_sandbox* %0, %struct.pt_sandbox** %4
store i32 %1, i32* %5
store i64* %2, i64** %6
%7 = load %struct.pt_sandbox*, %struct.pt_sandbox** %4
%8 = load i32, i32* %5
%9 = load i64*, i64** %6
ret i32 -1
}

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define i32 @ptrace_sandbox_get_arg(%struct.pt_sandbox* nocapture readnone %0, i32 %1, i64* nocapture readnone %2) {
ret i32 -1
}
char *fun(char *str1, const char *str2) {
  while (*str1++ = *str2++)
    ;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <fun+0x3b>
jmp    110c <fun+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <fun+0x10>
ret

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

LLVM IR (-O2):
define noalias i8* @fun(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* undef
}
void cw1200_debug_rxed_agg(struct cw1200_common *priv) {}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
%struct.cw1200_common = type opaque
define void @cw1200_debug_rxed_agg(%struct.cw1200_common* %0) {
%2 = alloca %struct.cw1200_common*
store %struct.cw1200_common* %0, %struct.cw1200_common** %2
ret void
}

LLVM IR (-O2):
%struct.cw1200_common = type opaque
define void @cw1200_debug_rxed_agg(%struct.cw1200_common* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void usage(char *prgname) { exit(1); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @usage(i8* nocapture readnone %0) {
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ removebag(int);
void removebags(int *clfirst, int *clcoll) {
  int next = clfirst[1];
  while (next != -1) {
    removebag(next - (0 + 1));
    next = clcoll[next];
  }
}


x86 assembly (clang, -O0):
<removebags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1152 <removebags+0x42>
mov    -0x14(%rbp),%edi
sub    $0x1,%edi
call   1030 <removebag@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
jmp    112a <removebags+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removebags>:
push   %r14
push   %rbx
push   %rax
mov    0x4(%rdi),%ebx
cmp    $0xffffffff,%ebx
je     1134 <removebags+0x24>
mov    %rsi,%r14
nop
lea    -0x1(%rbx),%edi
call   1030 <removebag@plt>
movslq %ebx,%rax
mov    (%r14,%rax,4),%ebx
cmp    $0xffffffff,%ebx
jne    1120 <removebags+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @removebags(i32* nocapture %0, i32* nocapture %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, -1
br i1 %5, label %14, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %12, %6 ], [ %4, %2 ]
%8 = add nsw i32 %7, -1
%9 = tail call i32 @removebag(i32 %8)
%10 = sext i32 %7 to i64
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
scalar_t__ mt_random();
double mt_normalize(void) {
  return (double)((double)mt_random() / (double)2147483648);
}


x86 assembly (clang, -O0):
<mt_normalize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mt_random@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_normalize>:
push   %rax
xor    %eax,%eax
call   1030 <mt_random@plt>
cvtsi2sd %rax,%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mt_normalize() {
%1 = call i64 (...) @mt_random()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 0x41E0000000000000
ret double %3
}

LLVM IR (-O2):
define double @mt_normalize() {
%1 = tail call i64 (...) @mt_random()
%2 = sitofp i64 %1 to double
%3 = fmul double %2, 0x3E00000000000000
ret double %3
}
/* Variables and functions */
char *__wstr_printf(char *, double);
int /*<<< orphan*/ assert(void const *);
char *wtypeDouble_toString(const void *element) {
  assert(element);
  return __wstr_printf("%lf", *(double *)element);
}


x86 assembly (clang, -O0):
<wtypeDouble_toString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xebc(%rip),%rdi
call   1040 <__wstr_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wtypeDouble_toString>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
movsd  (%rbx),%xmm0
lea    0xecc(%rip),%rdi
pop    %rbx
jmp    1040 <__wstr_printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define i8* @wtypeDouble_toString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to double*
%7 = load double, double* %6
%8 = call i8* @__wstr_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %7)
ret i8* %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i8* @wtypeDouble_toString(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = tail call i8* @__wstr_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %4)
ret i8* %5
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void I2CTxFIFOFlush(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000F04))) |= 0x00004000;
}


x86 assembly (clang, -O0):
<I2CTxFIFOFlush>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xf04(%rax),%rcx
or     $0x4000,%rcx
mov    %rcx,0xf04(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CTxFIFOFlush>:
orq    $0x4000,0xf04(%rdi)
ret

LLVM IR (-O0):
define void @I2CTxFIFOFlush(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 3844
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 16384
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @I2CTxFIFOFlush(i64 %0) {
%2 = add nsw i64 %0, 3844
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 16384
store volatile i64 %5, i64* %3
ret void
}
int test_imm_61int8_reg(signed char val) {
  return ((val) & (0x61 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_61int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x61,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_61int8_reg>:
test   $0x61,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_61int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 97
%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_61int8_reg(i8 signext %0) {
%2 = and i8 %0, 97
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) { printf("%s", "Platform is Linux\n"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [19 x i8] c"Platform is Linux\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [19 x i8] c"Platform is Linux\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
struct siginfoq *siginfoq_init(struct siginfoq *infoq) {
  return infoq;
}


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

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

LLVM IR (-O0):
%struct.siginfoq = type opaque
define %struct.siginfoq* @siginfoq_init(%struct.siginfoq* %0) {
%2 = alloca %struct.siginfoq*
store %struct.siginfoq* %0, %struct.siginfoq** %2
%3 = load %struct.siginfoq*, %struct.siginfoq** %2
ret %struct.siginfoq* %3
}

LLVM IR (-O2):
%struct.siginfoq = type opaque
define %struct.siginfoq* @siginfoq_init(%struct.siginfoq* readnone returned %0) {
ret %struct.siginfoq* %0
}