xunge/DecIR huggingface dataset:
void rop3_154_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = T & stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_154_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_154_0_1>:
mov    %esi,%eax
not    %eax
movzbl (%rdi),%r8d
and    %edx,%eax
mov    %r8d,%ecx
xor    %eax,%ecx
and    %ecx,%esi
not    %edx
and    %ecx,%edx
and    %r8d,%eax
or     %esi,%eax
or     %edx,%eax
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_154_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %1 to i32
%5 = xor i32 %4, -1
%6 = zext i8 %2 to i32
%7 = trunc i32 %5 to i8
%8 = and i8 %7, %2
%9 = load i8, i8* %0
%10 = zext i8 %9 to i32
%11 = xor i8 %9, %8
%12 = zext i8 %11 to i32
%13 = and i8 %11, %1
%14 = zext i8 %13 to i32
%15 = xor i32 %6, -1
%16 = and i32 %12, %15
%17 = and i32 %6, %5
%18 = and i32 %17, %10
%19 = or i32 %18, %14
%20 = or i32 %19, %16
%21 = trunc i32 %20 to i8
store i8 %21, i8* %0
ret void
}
void ff_hevc_put_hevc_uni_w_qpel_v16_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_v16_10_sse4() {
ret void
}
/* Variables and functions */
void *calloc(int, size_t);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ log_msg(int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void *xalloc_zero(size_t size) {
  void *result = calloc(1, size);
  if (!result) {
    log_msg(1, "calloc failed: %s", strerror(errno));
    exit(1);
  }
  return result;
}


x86 assembly (clang, -O0):
<xalloc_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1194 <xalloc_zero+0x54>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe7b(%rip),%rsi
call   1040 <log_msg@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xalloc_zero>:
push   %rax
mov    %rdi,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
test   %rax,%rax
je     1155 <xalloc_zero+0x15>
pop    %rcx
ret
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe96(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
call   1040 <log_msg@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"calloc failed: %s\00"
@errno = global i32 0
define i8* @xalloc_zero(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @log_msg(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret i8* %2
}
int xor (int p, int q) { return (p || q) && !(p && q); }


x86 assembly (clang, -O0):
<xor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1123 <xor+0x23>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1144 <xor+0x44>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xa(%rbp)
je     113c <xor+0x3c>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor>:
mov    %esi,%eax
or     %edi,%eax
setne  %al
test   %esi,%esi
sete   %cl
test   %edi,%edi
sete   %dl
or     %cl,%dl
and    %al,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @xor(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 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %7, %2
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %13, %10
%17 = phi i1 [ false, %10 ], [ %15, %13 ]
%18 = xor i1 %17, true
br label %19
19: ; preds = %16, %7
%20 = phi i1 [ false, %7 ], [ %18, %16 ]
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @xor(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp ne i32 %3, 0
%5 = icmp eq i32 %1, 0
%6 = icmp eq i32 %0, 0
%7 = or i1 %6, %5
%8 = and i1 %4, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
float vec2_dist2(const float a[2], const float b[2]) {
  float u[2];
  vec2_sub(a, b, u);
  return vec2_norm2(u);
}


x86 assembly (clang, -O0):
<vec2_dist2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1040 <vec2_sub@plt>
lea    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <vec2_norm2@plt>
cvtsi2ss %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_dist2>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <vec2_sub@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <vec2_norm2@plt>
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @vec2_dist2(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca [2 x float]
store float* %0, float** %3
store float* %1, float** %4
%6 = load float*, float** %3
%7 = load float*, float** %4
%8 = getelementptr inbounds [2 x float], [2 x float]* %5, i64 0, i64 0
%9 = call i32 (float*, float*, float*, ...) bitcast (i32 (...)* @vec2_sub to i32 (float*, float*, float*, ...)*)(float* %6, float* %7, float* %8)
%10 = getelementptr inbounds [2 x float], [2 x float]* %5, i64 0, i64 0
%11 = call i32 (float*, ...) bitcast (i32 (...)* @vec2_norm2 to i32 (float*, ...)*)(float* %10)
%12 = sitofp i32 %11 to float
ret float %12
}

LLVM IR (-O2):
define float @vec2_dist2(float* %0, float* %1) {
%3 = alloca [2 x float]
%4 = bitcast [2 x float]* %3 to i8*
%5 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 0
%6 = call i32 (float*, float*, float*, ...) bitcast (i32 (...)* @vec2_sub to i32 (float*, float*, float*, ...)*)(float* %0, float* %1, float* %5)
%7 = call i32 (float*, ...) bitcast (i32 (...)* @vec2_norm2 to i32 (float*, ...)*)(float* %5)
%8 = sitofp i32 %7 to float
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __aos_mem_free(void *buf) { free(buf); }


x86 assembly (clang, -O0):
<__aos_mem_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):
<__aos_mem_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @__aos_mem_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 @__aos_mem_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct pci_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pci_disable_device(struct pci_dev *);
int /*<<< orphan*/ pci_release_regions(struct pci_dev *);
void comedi_pci_disable(struct pci_dev *pdev) {
  pci_release_regions(pdev);
  pci_disable_device(pdev);
}


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

x86 assembly (clang, -O2):
<comedi_pci_disable>:
push   %rbx
mov    %rdi,%rbx
call   1030 <pci_release_regions@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <pci_disable_device@plt>

LLVM IR (-O0):
%struct.pci_dev = type { i32 }
define void @comedi_pci_disable(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
%3 = load %struct.pci_dev*, %struct.pci_dev** %2
%4 = call i32 @pci_release_regions(%struct.pci_dev* %3)
%5 = load %struct.pci_dev*, %struct.pci_dev** %2
%6 = call i32 @pci_disable_device(%struct.pci_dev* %5)
ret void
}

LLVM IR (-O2):
%struct.pci_dev = type { i32 }
define void @comedi_pci_disable(%struct.pci_dev* %0) {
%2 = tail call i32 @pci_release_regions(%struct.pci_dev* %0)
%3 = tail call i32 @pci_disable_device(%struct.pci_dev* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void helper() { puts("helper"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"helper\00"
define void @helper() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
main() {
  int *p = (int[]){1, 2, 3};
  struct A {
    int i, j, k[2];
  } a = {
      .k[1] = 3,
      .j = 3,
  };
  return p[1] + a.k[1] + a.k[0] + a.j;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x2,-0x18(%rbp)
movl   $0x3,-0x14(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
add    -0x24(%rbp),%eax
add    -0x28(%rbp),%eax
add    -0x2c(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.A = type { i32, i32, [2 x i32] }
@__const.main.a = %struct.A { i32 0, i32 3, [2 x i32] [i32 0, i32 3] }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [3 x i32]
%4 = alloca %struct.A
store i32 0, i32* %1
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
store i32 1, i32* %5
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 2, i32* %6
%7 = getelementptr inbounds i32, i32* %6, i64 1
store i32 3, i32* %7
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
store i32* %8, i32** %2
%9 = bitcast %struct.A* %4 to i8*
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = getelementptr inbounds %struct.A, %struct.A* %4, i32 0, i32 2
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 1
%15 = load i32, i32* %14
%16 = add nsw i32 %12, %15
%17 = getelementptr inbounds %struct.A, %struct.A* %4, i32 0, i32 2
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %17, i64 0, i64 0
%19 = load i32, i32* %18
%20 = add nsw i32 %16, %19
%21 = getelementptr inbounds %struct.A, %struct.A* %4, i32 0, i32 1
%22 = load i32, i32* %21
%23 = add nsw i32 %20, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @main() {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: list [-lR] [-m days] [-I ext] [dir...]\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"Usage: list [-lR] [-m days] [-I ext] [dir...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"Usage: list [-lR] [-m days] [-I ext] [dir...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
void fc238(int n) {
a : {
  typedef int(*b)[n];
  {
    typedef int(*c)[n];
    0;
  }
  {
    typedef int(*d)[n];
    0;
  };
  typedef int(*e)[n];
  0;
};
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  goto a;
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc238>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc238+0x7>

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

LLVM IR (-O0):
define void @fc238(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
%18 = load i32, i32* %2
%19 = zext i32 %18 to i64
br label %3
20: ; No predecessors!
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc238(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void _setcursortype(int cursortype) {}


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

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

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

LLVM IR (-O2):
define void @_setcursortype(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int ioctl(int, unsigned long, char *);
int xioctl(int fd, unsigned long request, char *arg) {
  int i;
  while ((i = ioctl(fd, request, arg)) == -1 && errno == EINTR)
    ;
  return i;
}


x86 assembly (clang, -O0):
<xioctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <ioctl@plt>
mov    %eax,%ecx
mov    %ecx,-0x1c(%rbp)
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x1d(%rbp)
jne    1160 <xioctl+0x50>
mov    0x2e93(%rip),%rax
mov    (%rax),%rax
mov    0x2e81(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1170 <xioctl+0x60>
jmp    1175 <xioctl+0x65>
jmp    1123 <xioctl+0x13>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xioctl>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    114b <xioctl+0x3b>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <xioctl+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @xioctl(i32 %0, i64 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i8* %2, i8** %6
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i64, i64* %5
%11 = load i8*, i8** %6
%12 = call i32 @ioctl(i32 %9, i64 %10, i8* %11)
store i32 %12, i32* %7
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %18
14: ; preds = %8
%15 = load i64, i64* @errno
%16 = load i64, i64* @EINTR
%17 = icmp eq i64 %15, %16
br label %18
18: ; preds = %14, %8
%19 = phi i1 [ false, %8 ], [ %17, %14 ]
br i1 %19, label %20, label %21
20: ; preds = %18
br label %8
21: ; preds = %18
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @xioctl(i32 %0, i64 %1, i8* %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @ioctl(i32 %0, i64 %1, i8* %2)
%6 = icmp eq i32 %5, -1
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
scalar_t__ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ unix_error(char *);
void Sigaddset(sigset_t *set, int signum) {
  if (sigaddset(set, signum) < 0)
    unix_error("Sigaddset error");
  return;
}


x86 assembly (clang, -O0):
<Sigaddset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <sigaddset@plt>
cmp    $0x0,%rax
jge    1151 <Sigaddset+0x31>
lea    0xeb4(%rip),%rdi
call   1030 <unix_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sigaddset>:
push   %rax
call   1040 <sigaddset@plt>
test   %rax,%rax
js     112d <Sigaddset+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <unix_error@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Sigaddset error\00"
define void @Sigaddset(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 i64 @sigaddset(i32* %5, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @unix_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Sigaddset error\00"
define void @Sigaddset(i32* %0, i32 %1) {
%3 = tail call i64 @sigaddset(i32* %0, i32 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @unix_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ start_process();
int main(int argc, char const *argv[]) {
  start_process();
  return 0;
}


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 <start_process@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <start_process@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @start_process()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @start_process()
ret i32 0
}
unsigned int closestPow2(unsigned int num) {
  unsigned a, p = 0;
  do {
    a = 1 << ++p;
  } while (a <= num);
  return a;
}


x86 assembly (clang, -O0):
<closestPow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jbe    110e <closestPow2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<closestPow2>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x1,%eax
shl    %cl,%eax
add    $0x1,%ecx
cmp    %edi,%eax
jbe    1110 <closestPow2+0x10>
ret

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

LLVM IR (-O2):
define i32 @closestPow2(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %4, %2 ]
%4 = add i32 %3, 1
%5 = shl nuw i32 1, %4
%6 = icmp ugt i32 %5, %0
br i1 %6, label %7, label %2
7: ; preds = %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
int /*<<< orphan*/ reverse_memcpy(void *, void *, int);
double bytes_to_double_float(const unsigned char bytes[8], int switch_endian) {
  double dest_num;
  void *dest_ptr = (void *)&dest_num;
  if (switch_endian) {
    reverse_memcpy(dest_ptr, (void *)bytes, 8);
  } else {
    memcpy(dest_ptr, (void *)bytes, 8);
  }
  return dest_num;
}


x86 assembly (clang, -O0):
<bytes_to_double_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1158 <bytes_to_double_float+0x38>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1030 <reverse_memcpy@plt>
jmp    116a <bytes_to_double_float+0x4a>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytes_to_double_float>:
push   %rax
mov    %rdi,%rax
mov    %rsp,%rdi
test   %esi,%esi
je     113a <bytes_to_double_float+0x1a>
mov    %rax,%rsi
mov    $0x8,%edx
call   1030 <reverse_memcpy@plt>
jmp    1147 <bytes_to_double_float+0x27>
mov    %rax,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @bytes_to_double_float(i8* %0, i32 %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = icmp eq i32 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = call i32 @reverse_memcpy(i8* %4, i8* %0, i32 8)
br label %10
8: ; preds = %2
%9 = call i32 @memcpy(i8* %4, i8* %0, i32 8)
br label %10
10: ; preds = %8, %6
%11 = load double, double* %3
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int /*<<< orphan*/, int);
int main() {
  int i = 1;
  printf("%d %d %d", i++, i++, i);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LRDP(char *);
void uc9_set_subdl() { LRDP("uc9:set_subdl IGNORED\n"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"uc9:set_subdl IGNORED\0A\00"
define void @uc9_set_subdl() {
%1 = call i32 @LRDP(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"uc9:set_subdl IGNORED\0A\00"
define void @uc9_set_subdl() {
%1 = tail call i32 @LRDP(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t
hci_event_connection_complete_get_encryption_enabled(const uint8_t *event) {
  return event[12];
}


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

x86 assembly (clang, -O2):
<hci_event_connection_complete_get_encryption_enabled>:
mov    0x30(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @hci_event_connection_complete_get_encryption_enabled(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 12
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
double exp(double);
double myexp(double in) {
  if (in > 2.0e2)
    in = 200.0;
  if (in < -2.0e2)
    in = -200.0;
  return exp(in);
}


x86 assembly (clang, -O0):
<myexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1141 <myexp+0x31>
movsd  0xec4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xebf(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1161 <myexp+0x51>
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myexp>:
movsd  0xee8(%rip),%xmm1
minsd  %xmm0,%xmm1
movsd  0xee4(%rip),%xmm0
maxsd  %xmm1,%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @myexp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 2.000000e+02
br i1 %4, label %5, label %6
5: ; preds = %1
store double 2.000000e+02, double* %2
br label %6
6: ; preds = %5, %1
%7 = load double, double* %2
%8 = fcmp olt double %7, -2.000000e+02
br i1 %8, label %9, label %10
9: ; preds = %6
store double -2.000000e+02, double* %2
br label %10
10: ; preds = %9, %6
%11 = load double, double* %2
%12 = call double @exp(double %11)
ret double %12
}

LLVM IR (-O2):
define double @myexp(double %0) {
%2 = fcmp ogt double %0, 2.000000e+02
%3 = select i1 %2, double 2.000000e+02, double %0
%4 = fcmp olt double %3, -2.000000e+02
%5 = select i1 %4, double -2.000000e+02, double %3
%6 = tail call double @exp(double %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rightrot(int, int);
int main() { printf("%d\n", rightrot(257, 4)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x101,%edi
mov    $0x4,%esi
call   1040 <rightrot@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @rightrot(i32 257, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ si_signo;
};
typedef TYPE_1__ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ psignal(int /*<<< orphan*/, char const *);
void psiginfo(const siginfo_t *si, const char *msg) {
  psignal(si->si_signo, msg);
}


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

x86 assembly (clang, -O2):
<psiginfo>:
mov    (%rdi),%edi
jmp    1030 <psignal@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define void @psiginfo(%struct.TYPE_3__* %0, i8* %1) {
%3 = alloca %struct.TYPE_3__*
%4 = alloca i8*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %3
store i8* %1, i8** %4
%5 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = call i32 @psignal(i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define void @psiginfo(%struct.TYPE_3__* nocapture %0, i8* %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i32 @psignal(i32 %4, i8* %1)
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void neubot_timeval_now(struct timeval *tv) {
  if (gettimeofday(tv, NULL) != 0)
    abort();
}


x86 assembly (clang, -O0):
<neubot_timeval_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
cmp    $0x0,%rax
je     114a <neubot_timeval_now+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<neubot_timeval_now>:
push   %rax
xor    %esi,%esi
call   1040 <gettimeofday@plt>
test   %rax,%rax
jne    112f <neubot_timeval_now+0xf>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @neubot_timeval_now(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i64 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @neubot_timeval_now(%struct.timeval* nocapture %0) {
%2 = tail call i64 @gettimeofday(%struct.timeval* %0, i32* null)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
int test_imm_D7int16_reg(short val) {
  return ((val) & (-0xD7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D7int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff29,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D7int16_reg>:
test   $0xff29,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D7int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -215
%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_D7int16_reg(i16 signext %0) {
%2 = and i16 %0, -215
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void find_remote_shell(shell) char *shell;
{
  char *value;
  value = (char *)getenv("RSH");
  if (value) {
    strcpy(shell, value);
    return;
  }
  strcpy(shell, "rsh");
  return;
}


x86 assembly (clang, -O0):
<find_remote_shell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <getenv@plt>
cltq
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115d <find_remote_shell+0x3d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
jmp    116d <find_remote_shell+0x4d>
mov    -0x8(%rbp),%rdi
lea    0xe9c(%rip),%rsi
call   1040 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_remote_shell>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <getenv@plt>
test   %eax,%eax
je     1142 <find_remote_shell+0x22>
movslq %eax,%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strcpy@plt>
movl   $0x687372,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"RSH\00"
@.str.1 = [4 x i8] c"rsh\00"
define void @find_remote_shell(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @getenv to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = load i8*, i8** %3
%12 = call i8* @strcpy(i8* %10, i8* %11)
br label %16
13: ; preds = %1
%14 = load i8*, i8** %2
%15 = call i8* @strcpy(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"RSH\00"
define void @find_remote_shell(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @getenv to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* %6)
br label %10
8: ; preds = %1
%9 = bitcast i8* %0 to i32*
store i32 6845298, i32* %9
br label %10
10: ; preds = %8, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ puts(char *);
void a(void) {
  FILE *ofPtr;
  if ((ofPtr = fopen("oldmast.dat", "r")) == NULL) {
    puts("File oldmast.dat non trovato");
  } else {
    puts("File oldmast.dat letto");
  }
  fclose(ofPtr);
  return;
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    116a <a+0x3a>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
jmp    1176 <a+0x46>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
lea    0xebd(%rip),%rax
lea    0xed3(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fclose@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"oldmast.dat\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [29 x i8] c"File oldmast.dat non trovato\00"
@.str.3 = [23 x i8] c"File oldmast.dat letto\00"
define void @a() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = load i32*, i32** %1
%10 = call i32 @fclose(i32* %9)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"oldmast.dat\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [29 x i8] c"File oldmast.dat non trovato\00"
@.str.3 = [23 x i8] c"File oldmast.dat letto\00"
define void @a() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
%5 = tail call i32 @fclose(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MySound_Start();
int /*<<< orphan*/ StartUpTimeAdjust();
void LeaveSpeedStopped(void) {
  MySound_Start();
  StartUpTimeAdjust();
}


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

x86 assembly (clang, -O2):
<LeaveSpeedStopped>:
push   %rax
xor    %eax,%eax
call   1030 <MySound_Start@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <StartUpTimeAdjust@plt>

LLVM IR (-O0):
define void @LeaveSpeedStopped() {
%1 = call i32 (...) @MySound_Start()
%2 = call i32 (...) @StartUpTimeAdjust()
ret void
}

LLVM IR (-O2):
define void @LeaveSpeedStopped() {
%1 = tail call i32 (...) @MySound_Start()
%2 = tail call i32 (...) @StartUpTimeAdjust()
ret void
}
int cdfOpenFile(const char *filename, const char *mode, int *filetype) {
  int ncid = -1;
  return (ncid);
}


x86 assembly (clang, -O0):
<cdfOpenFile>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cdfOpenFile(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 -1, i32* %7
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @cdfOpenFile(i8* nocapture readnone %0, i8* nocapture readnone %1, i32* nocapture readnone %2) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bitfn_swap64(int /*<<< orphan*/);
void array_swap64(uint64_t *d, uint64_t *s, uint32_t nb) {
  while (nb--)
    *d++ = bitfn_swap64(*s++);
}


x86 assembly (clang, -O0):
<array_swap64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     1165 <array_swap64+0x55>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%edi
call   1030 <bitfn_swap64@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
jmp    1123 <array_swap64+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_swap64>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
je     1146 <array_swap64+0x36>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
call   1030 <bitfn_swap64@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1130 <array_swap64+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @array_swap64(i32* nocapture writeonly %0, i32* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %15, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %2, %3 ]
%7 = phi i32* [ %10, %5 ], [ %1, %3 ]
%8 = phi i32* [ %13, %5 ], [ %0, %3 ]
%9 = add nsw i32 %6, -1
%10 = getelementptr inbounds i32, i32* %7, i64 1
%11 = load i32, i32* %7
%12 = tail call i32 @bitfn_swap64(i32 %11)
%13 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %12, i32* %8
%14 = icmp eq i32 %9, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %3
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *sgettext(const char *msgid) {
  const char *msgval = ((const char *)(msgid));
  if (msgval == msgid)
    msgval = strrchr(msgid, '|') + 1;
  return msgval;
}


x86 assembly (clang, -O0):
<sgettext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jne    1148 <sgettext+0x38>
mov    -0x8(%rbp),%rdi
mov    $0x7c,%esi
call   1030 <strrchr@plt>
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgettext>:
push   %rax
mov    $0x7c,%esi
call   1030 <strrchr@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @sgettext(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8*, i8** %2
%7 = icmp eq i8* %5, %6
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i8* @strrchr(i8* %9, i8 signext 124)
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %3
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @sgettext(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 124)
%3 = getelementptr inbounds i8, i8* %2, i64 1
ret i8* %3
}
int main() {
  volatile unsigned int *address = 0x64101404;
  *address = 0xbbbbbbbb;
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
movl   $0xbbbbbbbb,0x64101404
bb bb bb bb
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
store i32* inttoptr (i64 1678775300 to i32*), i32** %2
%3 = load i32*, i32** %2
store volatile i32 -1145324613, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
store volatile i32 -1145324613, i32* inttoptr (i64 1678775300 to i32*)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void i2sStartRecord(void) {
  printf("IIS start recording...\n");
  *((volatile unsigned int *)((0xB0020000 + 0x20))) = 0x1;
  *((volatile unsigned int *)((0xB0020000 + 0x04))) =
      (*((volatile unsigned int *)((0xB0020000 + 0x04)))) | (1 << 6);
}


x86 assembly (clang, -O0):
<i2sStartRecord>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xb0020020,%eax
movl   $0x1,(%rax)
mov    $0xb0020004,%eax
mov    (%rax),%ecx
or     $0x40,%ecx
mov    $0xb0020004,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2sStartRecord>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xb0020004,%eax
movl   $0x1,0x1c(%rax)
orl    $0x40,(%rax)
pop    %rax
ret

LLVM IR (-O0):
@.str = [24 x i8] c"IIS start recording...\0A\00"
define void @i2sStartRecord() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store volatile i32 1, i32* inttoptr (i64 2952921120 to i32*)
%2 = load volatile i32, i32* inttoptr (i64 2952921092 to i32*)
%3 = or i32 %2, 64
store volatile i32 %3, i32* inttoptr (i64 2952921092 to i32*)
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"IIS start recording...\00"
define void @i2sStartRecord() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
store volatile i32 1, i32* inttoptr (i64 2952921120 to i32*)
%2 = load volatile i32, i32* inttoptr (i64 2952921092 to i32*)
%3 = or i32 %2, 64
store volatile i32 %3, i32* inttoptr (i64 2952921092 to i32*)
ret void
}
void map_setbox(int which) {}


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

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

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

LLVM IR (-O2):
define void @map_setbox(i32 %0) {
ret void
}