xunge/DecIR huggingface dataset:
/* Variables and functions */
void stub1(double, short);
void testClosureDSrV(void (*closure)(double, short), double a1, short a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureDSrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1132 <testClosureDSrV+0x32>
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm0
movswl -0x12(%rbp),%edi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureDSrV>:
test   %rdi,%rdi
je     110d <testClosureDSrV+0xd>
mov    %rdi,%rax
movswl %si,%edi
jmp    *%rax
ret

LLVM IR (-O0):
define void @testClosureDSrV(void (double, i16)* %0, double %1, i16 signext %2) {
%4 = alloca void (double, i16)*
%5 = alloca double
%6 = alloca i16
store void (double, i16)* %0, void (double, i16)** %4
store double %1, double* %5
store i16 %2, i16* %6
%7 = load void (double, i16)*, void (double, i16)** %4
%8 = icmp ne void (double, i16)* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load void (double, i16)*, void (double, i16)** %4
%11 = load double, double* %5
%12 = load i16, i16* %6
br label %13
13: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
define void @testClosureDSrV(void (double, i16)* %0, double %1, i16 signext %2) {
%4 = icmp eq void (double, i16)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(double %1, i16 signext %2)
br label %6
6: ; preds = %5, %3
ret void
}
double *dvector(nl, nh)
int nl, nh;
{
  double *v;
  v = (double *)malloc((unsigned)(nh - nl + 1) * sizeof(double));
  if (!v)
    nrerror("allocation failure in dvector()");
  return v - nl;
}


x86 assembly (clang, -O0):
<dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
mov    %eax,%edi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1161 <dvector+0x41>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <nrerror@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvector>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
sub    %edi,%esi
lea    0x1(%rsi),%edi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1149 <dvector+0x29>
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1030 <nrerror@plt>
movslq %ebp,%rax
shl    $0x3,%rax
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in dvector()\00"
define double* @dvector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = zext i32 %9 to i64
%11 = mul i64 %10, 8
%12 = call i8* @malloc(i64 %11)
%13 = bitcast i8* %12 to double*
store double* %13, double** %5
%14 = load double*, double** %5
%15 = icmp ne double* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @nrerror to i32 (i8*, ...)*)(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load double*, double** %5
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = sub i64 0, %21
%23 = getelementptr inbounds double, double* %19, i64 %22
ret double* %23
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in dvector()\00"
define double* @dvector(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = zext i32 %4 to i64
%6 = shl nuw nsw i64 %5, 3
%7 = tail call i8* @malloc(i64 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @nrerror to i32 (i8*, ...)*)(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
%12 = bitcast i8* %7 to double*
%13 = sext i32 %0 to i64
%14 = sub nsw i64 0, %13
%15 = getelementptr inbounds double, double* %12, i64 %14
ret double* %15
}
unsigned long hash_long(unsigned long val, unsigned int bits) {
  unsigned long hash = val;
  hash *= 0x9e370001UL;
  return hash >> (32 - bits);
}


x86 assembly (clang, -O0):
<hash_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movabs $0x9e370001,%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x20,%ecx
sub    -0xc(%rbp),%ecx
mov    %ecx,%ecx
shr    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_long>:
mov    $0x9e370001,%eax
imul   %rdi,%rax
lea    0x20(%rsi),%ecx
neg    %ecx
shr    %cl,%rax
ret

LLVM IR (-O0):
define i64 @hash_long(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i64
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i64, i64* %3
store i64 %6, i64* %5
%7 = load i64, i64* %5
%8 = mul i64 %7, 2654404609
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = load i32, i32* %4
%11 = sub i32 32, %10
%12 = zext i32 %11 to i64
%13 = lshr i64 %9, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @hash_long(i64 %0, i32 %1) {
%3 = mul i64 %0, 2654404609
%4 = sub i32 32, %1
%5 = zext i32 %4 to i64
%6 = lshr i64 %3, %5
ret i64 %6
}
char *_nl_find_language(const char *name) {
  while (name[0] != '\0' && name[0] != '_' && name[0] != '@' && name[0] != '.')
    ++name;
  return (char *)name;
}


x86 assembly (clang, -O0):
<_nl_find_language>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1157 <_nl_find_language+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x5f,%ecx
mov    %al,-0x9(%rbp)
je     1157 <_nl_find_language+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x40,%ecx
mov    %al,-0x9(%rbp)
je     1157 <_nl_find_language+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1167 <_nl_find_language+0x67>
jmp    1178 <_nl_find_language+0x78>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <_nl_find_language+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nl_find_language>:
mov    %rdi,%rax
movabs $0x2000000040001,%rcx
nopl   (%rax)
movzbl (%rax),%edx
lea    -0x2e(%rdx),%esi
cmp    $0x31,%sil
ja     1126 <_nl_find_language+0x26>
movzbl %sil,%esi
bt     %rsi,%rcx
jb     1130 <_nl_find_language+0x30>
test   %dl,%dl
je     1130 <_nl_find_language+0x30>
add    $0x1,%rax
jmp    1110 <_nl_find_language+0x10>
ret

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

LLVM IR (-O2):
define i8* @_nl_find_language(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 95, label %7
i8 64, label %7
i8 46, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2, %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int bn_rand_range(int /*<<< orphan*/, int /*<<< orphan*/ *,
                  int /*<<< orphan*/ const *);
int BN_rand_range(BIGNUM *r, const BIGNUM *range) {
  return bn_rand_range(0, r, range);
}


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

x86 assembly (clang, -O2):
<BN_rand_range>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <bn_rand_range@plt>

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

LLVM IR (-O2):
define i32 @BN_rand_range(i32* %0, i32* %1) {
%3 = tail call i32 @bn_rand_range(i32 0, i32* %0, i32* %1)
ret i32 %3
}
/* Type definitions */
struct sigaction {
  int /*<<< orphan*/ sa_flags;
  int /*<<< orphan*/ sa_mask;
  void *sa_handler;
};

/* Variables and functions */
int /*<<< orphan*/ SA_NODEFER;
int /*<<< orphan*/ sigaction(int, struct sigaction *, int /*<<< orphan*/ *);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
void catch_sig(int sig, void *func) {
  struct sigaction act;
  act.sa_handler = func;
  sigemptyset(&act.sa_mask);
  act.sa_flags = SA_NODEFER;
  sigaction(sig, &act, NULL);
}


x86 assembly (clang, -O0):
<catch_sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
add    $0x4,%rdi
call   1040 <sigemptyset@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catch_sig>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %rsi,0x8(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <sigemptyset@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    %rsp,%rsi
mov    %ebx,%edi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sigaction = type { i32, i32, i8* }
@SA_NODEFER = global i32 0
define void @catch_sig(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.sigaction
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 2
store i8* %6, i8** %7
%8 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 1
%9 = call i32 @sigemptyset(i32* %8)
%10 = load i32, i32* @SA_NODEFER
%11 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 0
store i32 %10, i32* %11
%12 = load i32, i32* %3
%13 = call i32 @sigaction(i32 %12, %struct.sigaction* %5, i32* null)
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { i32, i32, i8* }
@SA_NODEFER = global i32 0
define void @catch_sig(i32 %0, i8* %1) {
%3 = alloca %struct.sigaction
%4 = bitcast %struct.sigaction* %3 to i8*
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 2
store i8* %1, i8** %5
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 1
%7 = call i32 @sigemptyset(i32* %6)
%8 = load i32, i32* @SA_NODEFER
%9 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 0
store i32 %8, i32* %9
%10 = call i32 @sigaction(i32 %0, %struct.sigaction* %3, i32* null)
ret void
}
unsigned int scan_ulong(s, u)
register char *s;
register unsigned long *u;
{
  register unsigned int pos;
  register unsigned long result;
  register unsigned long c;
  pos = 0;
  result = 0;
  while ((c = (unsigned long)(unsigned char)(s[pos] - '0')) < 10) {
    result = result * 10 + c;
    ++pos;
  }
  *u = result;
  return pos;
}


x86 assembly (clang, -O0):
<scan_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
sub    $0x30,%eax
movzbl %al,%eax
mov    %rax,-0x28(%rbp)
cmp    $0xa,%rax
jae    1155 <scan_ulong+0x55>
imul   $0xa,-0x20(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <scan_ulong+0x1b>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_ulong>:
mov    (%rdi),%dl
add    $0xd0,%dl
cmp    $0x9,%dl
ja     112e <scan_ulong+0x2e>
xor    %eax,%eax
xor    %ecx,%ecx
xchg   %ax,%ax
movzbl %dl,%edx
lea    (%rcx,%rcx,4),%rcx
lea    (%rdx,%rcx,2),%rcx
add    $0x1,%eax
movzbl (%rdi,%rax,1),%edx
add    $0xd0,%dl
cmp    $0xa,%dl
jb     1110 <scan_ulong+0x10>
mov    %rcx,(%rsi)
ret
xor    %ecx,%ecx
xor    %eax,%eax
mov    %rcx,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @scan_ulong(i8* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %19
6: ; preds = %2, %6
%7 = phi i8 [ %17, %6 ], [ %4, %2 ]
%8 = phi i32 [ %13, %6 ], [ 0, %2 ]
%9 = phi i64 [ %12, %6 ], [ 0, %2 ]
%10 = zext i8 %7 to i64
%11 = mul i64 %9, 10
%12 = add i64 %11, %10
%13 = add i32 %8, 1
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = add i8 %16, -48
%18 = icmp ult i8 %17, 10
br i1 %18, label %6, label %19
19: ; preds = %6, %2
%20 = phi i64 [ 0, %2 ], [ %12, %6 ]
%21 = phi i32 [ 0, %2 ], [ %13, %6 ]
store i64 %20, i64* %1
ret i32 %21
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
double decode_angle(uint8_t v) { return (double)v * 360.0 / 128.0; }


x86 assembly (clang, -O0):
<decode_angle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_angle>:
cvtsi2sd %rdi,%xmm0
mulsd  0xef3(%rip),%xmm0
mulsd  0xef3(%rip),%xmm0
ret

LLVM IR (-O0):
define double @decode_angle(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = fmul double %4, 3.600000e+02
%6 = fdiv double %5, 1.280000e+02
ret double %6
}

LLVM IR (-O2):
define double @decode_angle(i64 %0) {
%2 = sitofp i64 %0 to double
%3 = fmul double %2, 3.600000e+02
%4 = fmul double %3, 7.812500e-03
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int inotify_init1(int /*<<< orphan*/);
int main(void) {
  int fd;
  fd = inotify_init1(0);
  if (fd < 0) {
    return -1;
  }
  (void)close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <inotify_init1@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    114f <main+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <main+0x3e>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <inotify_init1@plt>
test   %eax,%eax
js     1137 <main+0x17>
mov    %eax,%edi
call   1030 <close@plt>
jmp    113c <main+0x1c>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @inotify_init1(i32 0)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %10
7: ; preds = %0
%8 = load i32, i32* %2
%9 = call i32 @close(i32 %8)
store i32 0, i32* %1
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @inotify_init1(i32 0)
%2 = icmp slt i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @close(i32 %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 0, %3 ], [ -1, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_NULL() { free(NULL); }


x86 assembly (clang, -O0):
<free_NULL>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <free@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_NULL>:
xor    %edi,%edi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_NULL() {
%1 = call i32 @free(i32* null)
ret void
}

LLVM IR (-O2):
define void @free_NULL() {
%1 = tail call i32 @free(i32* null)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void LCDRasterSubPanelDisable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000038))) &= ~0x80000000;
}


x86 assembly (clang, -O0):
<LCDRasterSubPanelDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x38,%eax
cltq
mov    (%rax),%ecx
and    $0x7fffffff,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDRasterSubPanelDisable>:
movslq %edi,%rax
andl   $0x7fffffff,0x38(%rax)
ret

LLVM IR (-O0):
define void @LCDRasterSubPanelDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 56
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 2147483647
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @LCDRasterSubPanelDisable(i32 %0) {
%2 = add nsw i32 %0, 56
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 2147483647
store volatile i32 %6, i32* %4
ret void
}
/* Variables and functions */
void *halloc(int /*<<< orphan*/, size_t);
void *memset(void *, int /*<<< orphan*/, size_t);
void *h_calloc(size_t n, size_t len) {
  void *ptr = halloc(0, len *= n);
  return ptr ? memset(ptr, 0, len) : NULL;
}


x86 assembly (clang, -O0):
<h_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
imul   -0x10(%rbp),%rsi
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1040 <halloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1173 <h_calloc+0x53>
mov    -0x18(%rbp),%rdi
mov    %rdi,-0x28(%rbp)
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    117e <h_calloc+0x5e>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    117e <h_calloc+0x5e>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
imul   %rdi,%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1040 <halloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     114a <h_calloc+0x2a>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @h_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %7, %6
store i64 %8, i64* %4
%9 = call i8* @halloc(i32 0, i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = load i64, i64* %4
br label %16
15: ; preds = %2
br label %16
16: ; preds = %15, %12
%17 = phi i8* [ %13, %12 ], [ null, %15 ]
ret i8* %17
}

LLVM IR (-O2):
define i8* @h_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @halloc(i32 0, i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %2
tail call void @llvm.memset.p0i8.i64(i8* align 1 %4, i8 0, i64 %3, i1 false)
br label %7
7: ; preds = %2, %6
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ m47_reset();
int /*<<< orphan*/ mmc3init(int /*<<< orphan*/ *, int /*<<< orphan*/,
                            int /*<<< orphan*/ *, int /*<<< orphan*/,
                            int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void m47_init(uint8_t *prgROMin, uint32_t prgROMsizeIn, uint8_t *prgRAMin,
              uint32_t prgRAMsizeIn, uint8_t *chrROMin, uint32_t chrROMsizeIn) {
  mmc3init(prgROMin, prgROMsizeIn, prgRAMin, prgRAMsizeIn, chrROMin,
           chrROMsizeIn);
  m47_reset();
  printf("Mapper 47 (Mapper 4 Game Select) inited\n");
}


x86 assembly (clang, -O0):
<m47_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1030 <mmc3init@plt>
mov    $0x0,%al
call   1050 <m47_reset@plt>
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m47_init>:
push   %rax
call   1030 <mmc3init@plt>
xor    %eax,%eax
call   1050 <m47_reset@plt>
lea    0xebc(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Mapper 47 (Mapper 4 Game Select) inited\0A\00"
define void @m47_init(i32* %0, i32 %1, i32* %2, i32 %3, i32* %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32* %2, i32** %9
store i32 %3, i32* %10
store i32* %4, i32** %11
store i32 %5, i32* %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = load i32*, i32** %9
%16 = load i32, i32* %10
%17 = load i32*, i32** %11
%18 = load i32, i32* %12
%19 = call i32 @mmc3init(i32* %13, i32 %14, i32* %15, i32 %16, i32* %17, i32 %18)
%20 = call i32 (...) @m47_reset()
%21 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [40 x i8] c"Mapper 47 (Mapper 4 Game Select) inited\00"
define void @m47_init(i32* %0, i32 %1, i32* %2, i32 %3, i32* %4, i32 %5) {
%7 = tail call i32 @mmc3init(i32* %0, i32 %1, i32* %2, i32 %3, i32* %4, i32 %5)
%8 = tail call i32 (...) @m47_reset()
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret void
}
int roundTo(int x, int y) {
  if (y == 0)
    y = 1;
  return (x / y) * y;
}


x86 assembly (clang, -O0):
<roundTo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111b <roundTo+0x1b>
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundTo>:
test   %esi,%esi
mov    $0x1,%ecx
cmovne %esi,%ecx
mov    %edi,%eax
cltd
idiv   %ecx
sub    %edx,%edi
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @roundTo(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 1, i32 %1
%5 = srem i32 %0, %4
%6 = sub i32 %0, %5
ret i32 %6
}
void destroyIntABO(void *e) {}


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

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

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

LLVM IR (-O2):
define void @destroyIntABO(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ ldexp(double, int);
float ldexpf(float x, int _exp) { return (float)ldexp((double)x, _exp); }


x86 assembly (clang, -O0):
<ldexpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x8(%rbp),%edi
call   1030 <ldexp@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexpf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <ldexp@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ldexpf(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = load i32, i32* %4
%8 = call i64 @ldexp(double %6, i32 %7)
%9 = sitofp i64 %8 to float
ret float %9
}

LLVM IR (-O2):
define float @ldexpf(float %0, i32 %1) {
%3 = fpext float %0 to double
%4 = tail call i64 @ldexp(double %3, i32 %1)
%5 = sitofp i64 %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("Hello, ");
  printf("World!");
  printf("\n");
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Hello, \00"
@.str.1 = [7 x i8] c"World!\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"Hello, \00"
@.str.1 = [7 x i8] c"World!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Type definitions */
struct vm_area_struct {
  int dummy;
};
struct kobject {
  int dummy;
};
struct bin_attribute {
  int dummy;
};

/* Variables and functions */
int pci_mmap_resource(struct kobject *, struct bin_attribute *,
                      struct vm_area_struct *, int /*<<< orphan*/);
int pci_mmap_resource_dense(struct kobject *kobj, struct bin_attribute *attr,
                            struct vm_area_struct *vma) {
  return pci_mmap_resource(kobj, attr, vma, 0);
}


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

x86 assembly (clang, -O2):
<pci_mmap_resource_dense>:
xor    %ecx,%ecx
jmp    1030 <pci_mmap_resource@plt>

LLVM IR (-O0):
%struct.kobject = type { i32 }
%struct.bin_attribute = type { i32 }
%struct.vm_area_struct = type { i32 }
define i32 @pci_mmap_resource_dense(%struct.kobject* %0, %struct.bin_attribute* %1, %struct.vm_area_struct* %2) {
%4 = alloca %struct.kobject*
%5 = alloca %struct.bin_attribute*
%6 = alloca %struct.vm_area_struct*
store %struct.kobject* %0, %struct.kobject** %4
store %struct.bin_attribute* %1, %struct.bin_attribute** %5
store %struct.vm_area_struct* %2, %struct.vm_area_struct** %6
%7 = load %struct.kobject*, %struct.kobject** %4
%8 = load %struct.bin_attribute*, %struct.bin_attribute** %5
%9 = load %struct.vm_area_struct*, %struct.vm_area_struct** %6
%10 = call i32 @pci_mmap_resource(%struct.kobject* %7, %struct.bin_attribute* %8, %struct.vm_area_struct* %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.kobject = type { i32 }
%struct.bin_attribute = type { i32 }
%struct.vm_area_struct = type { i32 }
define i32 @pci_mmap_resource_dense(%struct.kobject* %0, %struct.bin_attribute* %1, %struct.vm_area_struct* %2) {
%4 = tail call i32 @pci_mmap_resource(%struct.kobject* %0, %struct.bin_attribute* %1, %struct.vm_area_struct* %2, i32 0)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
scalar_t__ write_registers(int, int /*<<< orphan*/ *, int);
void write_long_register(uint32_t addr, uint32_t value) {
  if (write_registers(addr, (uint8_t *)&value, sizeof(uint32_t)) != 0)
    fprintf(stderr, "error: writing %08x\n", addr);
}


x86 assembly (clang, -O0):
<write_long_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <write_registers@plt>
cmp    $0x0,%rax
je     1161 <write_long_register+0x41>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_long_register>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %esi,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1040 <write_registers@plt>
test   %rax,%rax
je     1156 <write_long_register+0x36>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"error: writing %08x\0A\00"
define void @write_long_register(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i64 @write_registers(i32 %5, i32* %4, i32 4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i32, i32* %3
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"error: writing %08x\0A\00"
define void @write_long_register(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i64 @write_registers(i32 %0, i32* %3, i32 4)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %9
9: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  system("java -jar ShootPlane.jar");
  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)
lea    0xed3(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"java -jar ShootPlane.jar\00"
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 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"java -jar ShootPlane.jar\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
__attribute__((always_)) void bitmap_copy(unsigned long *dst,
                                          const unsigned long *src, int nbits) {
  if ((__builtin_constant_p(nbits) && (nbits) <= 32))
    *dst = *src;
  else {
    int len = (((nbits) + (8 * sizeof(long)) - 1) / (8 * sizeof(long))) *
              sizeof(unsigned long);
    __builtin_memcpy(dst, src, len);
  }
}


x86 assembly (clang, -O0):
<bitmap_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movslq -0x14(%rbp),%rax
add    $0x40,%rax
sub    $0x1,%rax
shr    $0x6,%rax
shl    $0x3,%rax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_copy>:
movslq %edx,%rax
shl    $0x1d,%rax
movabs $0x7e0000000,%rdx
add    %rax,%rdx
sar    $0x20,%rdx
and    $0xfffffffffffffff8,%rdx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @bitmap_copy(i64* %0, i64* %1, i32 %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i32
%7 = alloca i32
store i64* %0, i64** %4
store i64* %1, i64** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i1 @llvm.is.constant.i32(i32 %8)
br i1 %9, label %10, label %17
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp sle i32 %11, 32
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i64*, i64** %5
%15 = load i64, i64* %14
%16 = load i64*, i64** %4
store i64 %15, i64* %16
br label %31
17: ; preds = %10, %3
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = add i64 %19, 64
%21 = sub i64 %20, 1
%22 = udiv i64 %21, 64
%23 = mul i64 %22, 8
%24 = trunc i64 %23 to i32
store i32 %24, i32* %7
%25 = load i64*, i64** %4
%26 = bitcast i64* %25 to i8*
%27 = load i64*, i64** %5
%28 = bitcast i64* %27 to i8*
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
br label %31
31: ; preds = %17, %13
ret void
}

LLVM IR (-O2):
define void @bitmap_copy(i64* nocapture writeonly %0, i64* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = bitcast i64* %0 to i8*
%6 = bitcast i64* %1 to i8*
%7 = shl nsw i64 %4, 29
%8 = add nsw i64 %7, 33822867456
%9 = ashr i64 %8, 32
%10 = and i64 %9, -8
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %5, i8* align 8 %6, i64 %10, i1 false)
ret void
}
/* Type definitions */
typedef char *ssize_t;

/* Variables and functions */
char *set_errno(int);
ssize_t read(int fd, char *buffer, size_t length) {
  int r;
  __asm__ __volatile__("\tmov $3, %%eax\n"
                       "\tint $0x80\n"
                       : "=a"(r)
                       : "b"(fd), "c"(buffer), "d"(length)
                       : "memory");
  return set_errno(r);
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x28,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0xc(%rbp),%ebx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rdx
mov    $0x3,%eax
int    $0x80
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
call   1030 <set_errno@plt>
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
push   %rbx
mov    %rsi,%rcx
mov    %edi,%ebx
mov    $0x3,%eax
int    $0x80
mov    %eax,%edi
pop    %rbx
jmp    1030 <set_errno@plt>

LLVM IR (-O0):
define i8* @read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 asm sideeffect "\09mov $$3, %eax\0A\09int $$0x80\0A", "={ax},{bx},{cx},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %8, i8* %9, i64 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i8* @set_errno(i32 %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @read(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 asm sideeffect "\09mov $$3, %eax\0A\09int $$0x80\0A", "={ax},{bx},{cx},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i64 %2)
%5 = tail call i8* @set_errno(i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, char *);
void swap(char *s, int i, int j) {
  char temp = s[i];
  printf("\nSwapping %d and %d in %s", i, j, s);
  s[i] = s[j];
  s[j] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rdi,%rbx
movslq %esi,%rbp
mov    (%rdi,%rbp,1),%r15b
lea    0xed5(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rcx
call   1030 <printf@plt>
movslq %r14d,%rax
mov    (%rbx,%rax,1),%cl
mov    %cl,(%rbx,%rbp,1)
mov    %r15b,(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"\0ASwapping %d and %d in %s\00"
define void @swap(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
store i8 %12, i8* %7
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = load i8*, i8** %4
%16 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14, i8* %15)
%17 = load i8*, i8** %4
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = load i8*, i8** %4
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
store i8 %21, i8* %25
%26 = load i8, i8* %7
%27 = load i8*, i8** %4
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
store i8 %26, i8* %30
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"\0ASwapping %d and %d in %s\00"
define void @swap(i8* %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i8* %0)
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
store i8 %10, i8* %5
store i8 %6, i8* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __analyzer_eval(int);
int unknown_result();
void test_16c_a(void) {
  int i, j;
  i = unknown_result();
  j = unknown_result();
  __analyzer_eval(i == j);
}


x86 assembly (clang, -O0):
<test_16c_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <unknown_result@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <unknown_result@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_16c_a>:
push   %rbx
xor    %eax,%eax
call   1030 <unknown_result@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <unknown_result@plt>
xor    %edi,%edi
cmp    %eax,%ebx
sete   %dil
pop    %rbx
jmp    1040 <__analyzer_eval@plt>

LLVM IR (-O0):
define void @test_16c_a() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @unknown_result()
store i32 %3, i32* %1
%4 = call i32 (...) @unknown_result()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @__analyzer_eval(i32 %8)
ret void
}

LLVM IR (-O2):
define void @test_16c_a() {
%1 = tail call i32 (...) @unknown_result()
%2 = tail call i32 (...) @unknown_result()
%3 = icmp eq i32 %1, %2
%4 = zext i1 %3 to i32
%5 = tail call i32 @__analyzer_eval(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ deviceIf_useGroff();
int /*<<< orphan*/ initColours();
int /*<<< orphan*/ startWorld();
int /*<<< orphan*/ twoDsim_drawCollisionFrames(int, int);
int /*<<< orphan*/ twoDsim_fps(double);
void _M2_rboxes_init(__attribute__((unused)) int argc,
                     __attribute__((unused)) char *argv[]) {
  deviceIf_useGroff();
  twoDsim_drawCollisionFrames((1 == 1), (1 == 1));
  twoDsim_fps(80.0);
  initColours();
  startWorld();
}


x86 assembly (clang, -O0):
<_M2_rboxes_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <deviceIf_useGroff@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1070 <twoDsim_drawCollisionFrames@plt>
movsd  0xe86(%rip),%xmm0
call   1060 <twoDsim_fps@plt>
mov    $0x0,%al
call   1050 <initColours@plt>
mov    $0x0,%al
call   1040 <startWorld@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_M2_rboxes_init>:
push   %rax
xor    %eax,%eax
call   1030 <deviceIf_useGroff@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1070 <twoDsim_drawCollisionFrames@plt>
movsd  0xe91(%rip),%xmm0
call   1060 <twoDsim_fps@plt>
xor    %eax,%eax
call   1050 <initColours@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <startWorld@plt>

LLVM IR (-O0):
define void @_M2_rboxes_init(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @deviceIf_useGroff()
%6 = call i32 @twoDsim_drawCollisionFrames(i32 1, i32 1)
%7 = call i32 @twoDsim_fps(double 8.000000e+01)
%8 = call i32 (...) @initColours()
%9 = call i32 (...) @startWorld()
ret void
}

LLVM IR (-O2):
define void @_M2_rboxes_init(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @deviceIf_useGroff()
%4 = tail call i32 @twoDsim_drawCollisionFrames(i32 1, i32 1)
%5 = tail call i32 @twoDsim_fps(double 8.000000e+01)
%6 = tail call i32 (...) @initColours()
%7 = tail call i32 (...) @startWorld()
ret void
}
void ScaleSumSamples_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleSumSamples_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _quick_sort(int *, int /*<<< orphan*/, int);
void quick_sort(int a[], int n) { _quick_sort(a, 0, n - 1); }


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <_quick_sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <_quick_sort@plt>

LLVM IR (-O0):
define void @quick_sort(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 = sub nsw i32 %6, 1
%8 = call i32 @_quick_sort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @_quick_sort(i32* %0, i32 0, i32 %3)
ret void
}
/* Type definitions */
struct context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ut_setup1(struct context *);
int /*<<< orphan*/ ut_setup2(struct context *);
int /*<<< orphan*/ ut_setup3(struct context *);
int /*<<< orphan*/ ut_setup4(struct context *);
int /*<<< orphan*/ ut_setup5(struct context *);
struct context *ut_setup7(struct context *cxt) {
  ut_setup3(cxt);
  ut_setup5(cxt);
  ut_setup2(cxt);
  ut_setup4(cxt);
  ut_setup1(cxt);
  return cxt;
}


x86 assembly (clang, -O0):
<ut_setup7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ut_setup3@plt>
mov    -0x8(%rbp),%rdi
call   1050 <ut_setup5@plt>
mov    -0x8(%rbp),%rdi
call   1060 <ut_setup2@plt>
mov    -0x8(%rbp),%rdi
call   1070 <ut_setup4@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ut_setup1@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ut_setup7>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ut_setup3@plt>
mov    %rbx,%rdi
call   1050 <ut_setup5@plt>
mov    %rbx,%rdi
call   1060 <ut_setup2@plt>
mov    %rbx,%rdi
call   1070 <ut_setup4@plt>
mov    %rbx,%rdi
call   1030 <ut_setup1@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.context = type { i32 }
define %struct.context* @ut_setup7(%struct.context* %0) {
%2 = alloca %struct.context*
store %struct.context* %0, %struct.context** %2
%3 = load %struct.context*, %struct.context** %2
%4 = call i32 @ut_setup3(%struct.context* %3)
%5 = load %struct.context*, %struct.context** %2
%6 = call i32 @ut_setup5(%struct.context* %5)
%7 = load %struct.context*, %struct.context** %2
%8 = call i32 @ut_setup2(%struct.context* %7)
%9 = load %struct.context*, %struct.context** %2
%10 = call i32 @ut_setup4(%struct.context* %9)
%11 = load %struct.context*, %struct.context** %2
%12 = call i32 @ut_setup1(%struct.context* %11)
%13 = load %struct.context*, %struct.context** %2
ret %struct.context* %13
}

LLVM IR (-O2):
%struct.context = type { i32 }
define %struct.context* @ut_setup7(%struct.context* returned %0) {
%2 = tail call i32 @ut_setup3(%struct.context* %0)
%3 = tail call i32 @ut_setup5(%struct.context* %0)
%4 = tail call i32 @ut_setup2(%struct.context* %0)
%5 = tail call i32 @ut_setup4(%struct.context* %0)
%6 = tail call i32 @ut_setup1(%struct.context* %0)
ret %struct.context* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_header(void) {
  printf("---------------------------------------------------------------------"
         "-----\n");
}


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

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

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

LLVM IR (-O2):
@str = [75 x i8] c"--------------------------------------------------------------------------\00"
define void @print_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str, i64 0, i64 0))
ret void
}