xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void f1(int b, char a[]) { printf("%s %d\n", a, b); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s %d\0A\00"
define void @f1(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %0)
ret void
}
int qvers_(iftype)
int *iftype;
{ return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @qvers_(i32* nocapture readnone %0) {
ret i32 -1
}
void initializeRun() {}


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

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

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

LLVM IR (-O2):
define void @initializeRun() {
ret void
}
/* Variables and functions */
int strlen(char *);
char toupper(char);
int stoupper(char *input) {
  int i = 0;
  for (i = 0; i < strlen(input); i++) {
    *(input + i) = toupper(*(input + i));
  }
}


x86 assembly (clang, -O0):
<stoupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    1182 <stoupper+0x62>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113a <stoupper+0x1a>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stoupper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
jle    1161 <stoupper+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <stoupper+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @stoupper(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @toupper(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t osmo_a5_fn_count(uint32_t fn) {
  int t1 = fn / (26 * 51);
  int t2 = fn % 26;
  int t3 = fn % 51;
  return (t1 << 11) | (t3 << 5) | t2;
}


x86 assembly (clang, -O0):
<osmo_a5_fn_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x52e,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x33,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shl    $0xb,%eax
mov    -0x10(%rbp),%ecx
shl    $0x5,%ecx
or     %ecx,%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<osmo_a5_fn_count>:
movslq %edi,%rax
imul   $0x62d90063,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x29,%rcx
add    %edx,%ecx
imul   $0x4ec4ec4f,%rax,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
shr    $0x20,%rdx
sar    $0x3,%edx
add    %esi,%edx
lea    (%rdx,%rdx,4),%esi
lea    (%rsi,%rsi,4),%esi
add    %edx,%esi
mov    %eax,%edx
sub    %esi,%edx
imul   $0xffffffffa0a0a0a1,%rax,%rsi
shr    $0x20,%rsi
add    %eax,%esi
mov    %esi,%edi
shr    $0x1f,%edi
shr    $0x5,%esi
add    %edi,%esi
imul   $0x33,%esi,%esi
sub    %esi,%eax
shl    $0xb,%ecx
or     %edx,%ecx
shl    $0x5,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @osmo_a5_fn_count(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 1326
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = srem i32 %8, 26
store i32 %9, i32* %4
%10 = load i32, i32* %2
%11 = srem i32 %10, 51
store i32 %11, i32* %5
%12 = load i32, i32* %3
%13 = shl i32 %12, 11
%14 = load i32, i32* %5
%15 = shl i32 %14, 5
%16 = or i32 %13, %15
%17 = load i32, i32* %4
%18 = or i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @osmo_a5_fn_count(i32 %0) {
%2 = sdiv i32 %0, 1326
%3 = srem i32 %0, 26
%4 = srem i32 %0, 51
%5 = shl i32 %2, 11
%6 = shl nsw i32 %4, 5
%7 = or i32 %6, %3
%8 = or i32 %7, %5
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ parambinder_free(void *);
void *unbind_binary_p1(void *code, void *f, void *arg) {
  if (code) {
    *(uint32_t *)arg = *(uint32_t *)((uint32_t)code + 6);
    *(uint32_t *)f =
        *(uint32_t *)((uint32_t)code + 11) + ((uint32_t)code + 11 + 4);
    parambinder_free(code);
  }
  return 0;
}


x86 assembly (clang, -O0):
<unbind_binary_p1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1165 <unbind_binary_p1+0x55>
mov    -0x8(%rbp),%rax
mov    0x6(%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    0xb(%rax),%rcx
mov    -0x8(%rbp),%rax
add    $0xb,%rax
add    $0x4,%rax
add    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <parambinder_free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unbind_binary_p1>:
test   %rdi,%rdi
je     1134 <unbind_binary_p1+0x24>
push   %rax
mov    0x6(%rdi),%rax
mov    %rax,(%rdx)
mov    0xb(%rdi),%rax
add    %rdi,%rax
add    $0xf,%rax
mov    %rax,(%rsi)
call   1030 <parambinder_free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @unbind_binary_p1(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %31
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = ptrtoint i8* %10 to i64
%12 = add nsw i64 %11, 6
%13 = inttoptr i64 %12 to i64*
%14 = load i64, i64* %13
%15 = load i8*, i8** %6
%16 = bitcast i8* %15 to i64*
store i64 %14, i64* %16
%17 = load i8*, i8** %4
%18 = ptrtoint i8* %17 to i64
%19 = add nsw i64 %18, 11
%20 = inttoptr i64 %19 to i64*
%21 = load i64, i64* %20
%22 = load i8*, i8** %4
%23 = ptrtoint i8* %22 to i64
%24 = add nsw i64 %23, 11
%25 = add nsw i64 %24, 4
%26 = add nsw i64 %21, %25
%27 = load i8*, i8** %5
%28 = bitcast i8* %27 to i64*
store i64 %26, i64* %28
%29 = load i8*, i8** %4
%30 = call i32 @parambinder_free(i8* %29)
br label %31
31: ; preds = %9, %3
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @unbind_binary_p1(i8* %0, i8* nocapture writeonly %1, i8* nocapture writeonly %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %18, label %5
5: ; preds = %3
%6 = ptrtoint i8* %0 to i64
%7 = add nsw i64 %6, 6
%8 = inttoptr i64 %7 to i64*
%9 = load i64, i64* %8
%10 = bitcast i8* %2 to i64*
store i64 %9, i64* %10
%11 = add nsw i64 %6, 11
%12 = inttoptr i64 %11 to i64*
%13 = load i64, i64* %12
%14 = add nsw i64 %6, 15
%15 = add nsw i64 %14, %13
%16 = bitcast i8* %1 to i64*
store i64 %15, i64* %16
%17 = tail call i32 @parambinder_free(i8* %0)
br label %18
18: ; preds = %5, %3
ret i8* null
}
/* Variables and functions */
bool gen_is_ivb(int devid) {
  return (devid == 0x0152 || devid == 0x0162 || devid == 0x0156 ||
          devid == 0x0166 || devid == 0x015a || devid == 0x016a);
}


x86 assembly (clang, -O0):
<gen_is_ivb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x152,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116e <gen_is_ivb+0x6e>
mov    $0x1,%al
cmpl   $0x162,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116e <gen_is_ivb+0x6e>
mov    $0x1,%al
cmpl   $0x156,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116e <gen_is_ivb+0x6e>
mov    $0x1,%al
cmpl   $0x166,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116e <gen_is_ivb+0x6e>
mov    $0x1,%al
cmpl   $0x15a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116e <gen_is_ivb+0x6e>
cmpl   $0x16a,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_is_ivb>:
lea    -0x152(%rdi),%ecx
rol    $0x1e,%ecx
cmp    $0x6,%ecx
jae    111d <gen_is_ivb+0x1d>
mov    $0x1,%eax
mov    $0x37,%edx
bt     %ecx,%edx
jb     1128 <gen_is_ivb+0x28>
xor    %eax,%eax
cmp    $0x16a,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @gen_is_ivb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 338
br i1 %4, label %20, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 354
br i1 %7, label %20, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 342
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 358
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 346
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 362
br label %20
20: ; preds = %17, %14, %11, %8, %5, %1
%21 = phi i1 [ true, %14 ], [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @gen_is_ivb(i32 %0) {
%2 = add i32 %0, -338
%3 = tail call i32 @llvm.fshl.i32(i32 %2, i32 %2, i32 30)
%4 = icmp ult i32 %3, 6
br i1 %4, label %8, label %5
5: ; preds = %8, %1
%6 = icmp eq i32 %0, 362
%7 = zext i1 %6 to i32
br label %13
8: ; preds = %1
%9 = trunc i32 %3 to i8
%10 = lshr i8 55, %9
%11 = and i8 %10, 1
%12 = icmp eq i8 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %8, %5
%14 = phi i32 [ %7, %5 ], [ 1, %8 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void banner() {
  printf("Prism Versioning\nRelease %s\nBy Jeff Armstrong "
         "<jeff@rainbow-100.com>\n",
         "0.1");
}


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

x86 assembly (clang, -O2):
<banner>:
lea    0xee9(%rip),%rdi
lea    0xf28(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [70 x i8] c"Prism Versioning\0ARelease %s\0ABy Jeff Armstrong <jeff@rainbow-100.com>\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
define void @banner() {
%1 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c"Prism Versioning\0ARelease %s\0ABy Jeff Armstrong <jeff@rainbow-100.com>\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
define void @banner() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int isLetter(char c) {
  return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z');
}


x86 assembly (clang, -O0):
<isLetter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     112d <isLetter+0x2d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    1156 <isLetter+0x56>
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x41,%ecx
cmp    %edx,%ecx
mov    %al,-0x3(%rbp)
jg     1150 <isLetter+0x50>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLetter>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isLetter(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 97, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 65, %12
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isLetter(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ write(int, char *, int);
void sig_alrm(int s) {
  write(1, "X", 1);
  alarm(3);
}


x86 assembly (clang, -O0):
<sig_alrm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edx
lea    0xec9(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    $0x3,%edi
call   1040 <alarm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_alrm>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x3,%edi
pop    %rax
jmp    1040 <alarm@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"X\00"
define void @sig_alrm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @alarm(i32 3)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"X\00"
define void @sig_alrm(i32 %0) {
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @alarm(i32 3)
ret void
}
int squared_dist(int x, int y, int other_x, int other_y) {
  return (x - other_x) * (x - other_x) + (y - other_y) * (y - other_y);
}


x86 assembly (clang, -O0):
<squared_dist>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0xc(%rbp),%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%ecx
sub    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%edx
sub    -0x10(%rbp),%edx
imul   %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<squared_dist>:
sub    %edx,%edi
imul   %edi,%edi
sub    %ecx,%esi
imul   %esi,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @squared_dist(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = sub nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = sub nsw i32 %12, %13
%15 = mul nsw i32 %11, %14
%16 = load i32, i32* %6
%17 = load i32, i32* %8
%18 = sub nsw i32 %16, %17
%19 = load i32, i32* %6
%20 = load i32, i32* %8
%21 = sub nsw i32 %19, %20
%22 = mul nsw i32 %18, %21
%23 = add nsw i32 %15, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @squared_dist(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = mul nsw i32 %5, %5
%7 = sub nsw i32 %1, %3
%8 = mul nsw i32 %7, %7
%9 = add nuw nsw i32 %8, %6
ret i32 %9
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
unsigned long long ts_usec(const struct timespec *ts) {
  return (unsigned long long)ts->tv_sec * 1000000ULL +
         (unsigned long long)ts->tv_nsec / 1000ULL;
}


x86 assembly (clang, -O0):
<ts_usec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xf4240,0x8(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_usec>:
imul   $0xf4240,0x8(%rdi),%rcx
mov    (%rdi),%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rdx
9b c4 20
mul    %rdx
shr    $0x4,%rdx
add    %rdx,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i64 @ts_usec(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = udiv i64 %9, 1000
%11 = add i64 %6, %10
ret i64 %11
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i64 @ts_usec(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = udiv i64 %6, 1000
%8 = add i64 %7, %4
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  if (a % 2 != 1) {
    printf("yes\n");
  } else {
    printf("no\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
je     1164 <main+0x44>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    1170 <main+0x50>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
cmp    $0x1,%eax
lea    0xeb7(%rip),%rax
lea    0xeb3(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"yes\0A\00"
@.str.2 = [4 x i8] c"no\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = srem i32 %4, 2
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [3 x i8] c"no\00"
@str.3 = [4 x i8] c"yes\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 1
%7 = select i1 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}
void cc_debugfs_global_init(void) {}


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

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

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

LLVM IR (-O2):
define void @cc_debugfs_global_init() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int endmntent(FILE *f) {
  if (f)
    fclose(f);
  return 1;
}


x86 assembly (clang, -O0):
<endmntent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <endmntent+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endmntent>:
test   %rdi,%rdi
je     111f <endmntent+0xf>
push   %rax
call   1030 <fclose@plt>
add    $0x8,%rsp
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @endmntent(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32*, i32** %2
%7 = call i32 @fclose(i32* %6)
br label %8
8: ; preds = %5, %1
ret i32 1
}

LLVM IR (-O2):
define i32 @endmntent(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @fclose(i32* %0)
br label %5
5: ; preds = %3, %1
ret i32 1
}
/* Variables and functions */
void *clientThread(void *arg) { return (NULL); }


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

x86 assembly (clang, -O2):
<clientThread>:
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @clientThread(i8* nocapture readnone %0) {
ret i8* null
}
adr0adr1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((*((double *)10000000)) <= (*((double *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adr0adr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    $0x989680,%eax
movsd  (%rax),%xmm1
mov    $0xa98ac7,%eax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     1144 <adr0adr1+0x44>
movl   $0x1,-0x4(%rbp)
jmp    114b <adr0adr1+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adr1>:
movsd  0xa98ac7,%xmm0
xor    %eax,%eax
ucomisd 0x989680,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @adr0adr1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double, double* inttoptr (i64 10000000 to double*)
%15 = load double, double* inttoptr (i64 11111111 to double*)
%16 = fcmp ole double %14, %15
br i1 %16, label %17, label %18
17: ; preds = %6
store i32 1, i32* %7
br label %19
18: ; preds = %6
store i32 0, i32* %7
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @adr0adr1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture readnone %5) {
%7 = load double, double* inttoptr (i64 10000000 to double*)
%8 = load double, double* inttoptr (i64 11111111 to double*)
%9 = fcmp ole double %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
void _M2_Builtins_init(void) {}


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

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

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

LLVM IR (-O2):
define void @_M2_Builtins_init() {
ret void
}
void cuckoo_print_entry_debug(char *entry) {

  ;
  if (*((int *)entry) == sizeof(int)) {

    ;
  } else {
    ;
  }

  ;
  if (*((int *)(&(entry[sizeof(int)]))) == sizeof(int)) {

    ;
  } else {
    ;
  };
}


x86 assembly (clang, -O0):
<cuckoo_print_entry_debug>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
cmp    $0x4,%rax
jne    111e <cuckoo_print_entry_debug+0x1e>
jmp    1123 <cuckoo_print_entry_debug+0x23>
jmp    1123 <cuckoo_print_entry_debug+0x23>
mov    -0x8(%rbp),%rax
movslq 0x4(%rax),%rax
cmp    $0x4,%rax
jne    113a <cuckoo_print_entry_debug+0x3a>
jmp    113f <cuckoo_print_entry_debug+0x3f>
jmp    113f <cuckoo_print_entry_debug+0x3f>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @cuckoo_print_entry_debug(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void log_close() { closelog(); }


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

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

LLVM IR (-O0):
define void @log_close() {
%1 = call i32 (...) @closelog()
ret void
}

LLVM IR (-O2):
define void @log_close() {
%1 = tail call i32 (...) @closelog()
ret void
}
int NoSoundDrv_CD_Init(void) { return 0; }


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

x86 assembly (clang, -O2):
<NoSoundDrv_CD_Init>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @NoSoundDrv_CD_Init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @NoSoundDrv_CD_Init() {
ret i32 0
}
/* Variables and functions */
scalar_t__ isValueLenOk(char *, int);
scalar_t__ noDodgyChars(char *);
int /*<<< orphan*/ setConfigTextValue(char *, char *);
int updateWebServerName(char *value) {
  if (isValueLenOk(value, 32) && noDodgyChars(value)) {
    setConfigTextValue("web.server_name", value);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<updateWebServerName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
call   1040 <isValueLenOk@plt>
cmp    $0x0,%rax
je     1183 <updateWebServerName+0x53>
mov    -0x10(%rbp),%rdi
call   1030 <noDodgyChars@plt>
cmp    $0x0,%rax
je     1183 <updateWebServerName+0x53>
mov    -0x10(%rbp),%rsi
lea    0xe8e(%rip),%rdi
call   1050 <setConfigTextValue@plt>
movl   $0x1,-0x4(%rbp)
jmp    118a <updateWebServerName+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateWebServerName>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x20,%esi
call   1040 <isValueLenOk@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     1168 <updateWebServerName+0x38>
mov    %rbx,%rdi
call   1030 <noDodgyChars@plt>
test   %rax,%rax
je     1168 <updateWebServerName+0x38>
lea    0xea5(%rip),%rdi
mov    %rbx,%rsi
call   1050 <setConfigTextValue@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"web.server_name\00"
define i32 @updateWebServerName(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @isValueLenOk(i8* %4, i32 32)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @noDodgyChars(i8* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = call i32 @setConfigTextValue(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 1, i32* %2
br label %15
14: ; preds = %7, %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [16 x i8] c"web.server_name\00"
define i32 @updateWebServerName(i8* %0) {
%2 = tail call i64 @isValueLenOk(i8* %0, i32 32)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i64 @noDodgyChars(i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @setConfigTextValue(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %1, %4, %7
%10 = phi i32 [ 1, %7 ], [ 0, %4 ], [ 0, %1 ]
ret i32 %10
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ window;
};
typedef TYPE_1__ XClientMessageEvent;

/* Variables and functions */
unsigned long get_XClientMessageEvent_window(void *_p) {
  return (unsigned long)((XClientMessageEvent *)_p)->window;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XClientMessageEvent_window(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XClientMessageEvent_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ VirtualFree(void *);
void MidFree(void *address) {
  if (address == 0)
    return;
  VirtualFree(address);
}


x86 assembly (clang, -O0):
<MidFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <MidFree+0x1c>
jmp    1135 <MidFree+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <VirtualFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MidFree>:
test   %rdi,%rdi
je     111a <MidFree+0xa>
jmp    1030 <VirtualFree@plt>
ret

LLVM IR (-O0):
define void @MidFree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @VirtualFree(i8* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @MidFree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @VirtualFree(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
bool sancus_get_u8ll(long long v, uint8_t *out) {
  if ((v >= 0) && (v <= 0xff)) {
    if (out != NULL)
      *out = (uint8_t)v;
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<sancus_get_u8ll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     1147 <sancus_get_u8ll+0x47>
cmpq   $0xff,-0x10(%rbp)
jg     1147 <sancus_get_u8ll+0x47>
cmpq   $0x0,-0x18(%rbp)
je     113b <sancus_get_u8ll+0x3b>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    114e <sancus_get_u8ll+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_get_u8ll>:
xor    %eax,%eax
cmp    $0xff,%rdi
ja     1118 <sancus_get_u8ll+0x18>
mov    $0x1,%eax
test   %rsi,%rsi
je     1118 <sancus_get_u8ll+0x18>
mov    %rdi,(%rsi)
ret

LLVM IR (-O0):
define i32 @sancus_get_u8ll(i64 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64*
store i64 %0, i64* %4
store i64* %1, i64** %5
%6 = load i64, i64* %4
%7 = icmp sge i64 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %2
%9 = load i64, i64* %4
%10 = icmp sle i64 %9, 255
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i64*, i64** %5
%13 = icmp ne i64* %12, null
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i64, i64* %4
%16 = load i64*, i64** %5
store i64 %15, i64* %16
br label %17
17: ; preds = %14, %11
store i32 1, i32* %3
br label %19
18: ; preds = %8, %2
store i32 0, i32* %3
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @sancus_get_u8ll(i64 %0, i64* writeonly %1) {
%3 = icmp ult i64 %0, 256
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = icmp eq i64* %1, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i64 %0, i64* %1
br label %7
7: ; preds = %2, %4, %6
%8 = phi i32 [ 1, %6 ], [ 1, %4 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
bool startsComment(char character) { return character == '#'; }


x86 assembly (clang, -O0):
<startsComment>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x23,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<startsComment>:
xor    %eax,%eax
cmp    $0x23,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @startsComment(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 35
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @startsComment(i8 signext %0) {
%2 = icmp eq i8 %0, 35
%3 = zext i1 %2 to i32
ret i32 %3
}
double berechne_zinsen(double zinssatz, double kredit) {
  zinssatz = kredit * zinssatz;
  return zinssatz;
}


x86 assembly (clang, -O0):
<berechne_zinsen>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<berechne_zinsen>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @berechne_zinsen(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fmul double %5, %6
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @berechne_zinsen(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
void fint(int *x) { printf("%s(%d)\n", __func__, *x); }


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

x86 assembly (clang, -O2):
<fint>:
mov    (%rdi),%edx
lea    0xee7(%rip),%rdi
lea    0xee8(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s(%d)\0A\00"
@__func__.fint = [5 x i8] c"fint\00"
define void @fint(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.fint, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ zwave_sendClassCommand(unsigned int, int, int,
                                          unsigned char *, int);
void zwavecmd_simple_av_learn(unsigned int id, unsigned int key) {
  unsigned char buf[4];
  buf[0] = key;
  zwave_sendClassCommand(id, 0x94, 0x20, buf, 1);
}


x86 assembly (clang, -O0):
<zwavecmd_simple_av_learn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0xc(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xc(%rbp),%rcx
mov    $0x94,%esi
mov    $0x20,%edx
mov    $0x1,%r8d
call   1030 <zwave_sendClassCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zwavecmd_simple_av_learn>:
push   %rax
mov    %sil,0x4(%rsp)
lea    0x4(%rsp),%rcx
mov    $0x94,%esi
mov    $0x20,%edx
mov    $0x1,%r8d
call   1030 <zwave_sendClassCommand@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @zwavecmd_simple_av_learn(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [4 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
store i8 %7, i8* %8
%9 = load i32, i32* %3
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%11 = call i32 @zwave_sendClassCommand(i32 %9, i32 148, i32 32, i8* %10, i32 1)
ret void
}

LLVM IR (-O2):
define void @zwavecmd_simple_av_learn(i32 %0, i32 %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = trunc i32 %1 to i8
store i8 %5, i8* %4
%6 = call i32 @zwave_sendClassCommand(i32 %0, i32 148, i32 32, i8* %4, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delmac(int);
int /*<<< orphan*/ do_kill();
int findmac(char *);
int /*<<< orphan*/ illname();
int /*<<< orphan*/ symname(char *);
void doundef(void) {
  int mp;
  char sname[33];
  if (!symname(sname)) {
    illname();
    do_kill();
    return;
  }
  if ((mp = findmac(sname)) != 0)
    delmac(mp);
  do_kill();
}


x86 assembly (clang, -O0):
<doundef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
call   1040 <symname@plt>
cmp    $0x0,%eax
jne    117d <doundef+0x2d>
mov    $0x0,%al
call   1070 <illname@plt>
mov    $0x0,%al
call   1060 <do_kill@plt>
jmp    11a1 <doundef+0x51>
lea    -0x30(%rbp),%rdi
call   1030 <findmac@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     119a <doundef+0x4a>
mov    -0x4(%rbp),%edi
call   1050 <delmac@plt>
mov    $0x0,%al
call   1060 <do_kill@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doundef>:
sub    $0x28,%rsp
mov    %rsp,%rdi
call   1040 <symname@plt>
test   %eax,%eax
je     1175 <doundef+0x25>
mov    %rsp,%rdi
call   1030 <findmac@plt>
test   %eax,%eax
je     117c <doundef+0x2c>
mov    %eax,%edi
call   1050 <delmac@plt>
jmp    117c <doundef+0x2c>
xor    %eax,%eax
call   1070 <illname@plt>
xor    %eax,%eax
call   1060 <do_kill@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @doundef() {
%1 = alloca i32
%2 = alloca [33 x i8]
%3 = getelementptr inbounds [33 x i8], [33 x i8]* %2, i64 0, i64 0
%4 = call i32 @symname(i8* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = call i32 (...) @illname()
%8 = call i32 (...) @do_kill()
br label %18
9: ; preds = %0
%10 = getelementptr inbounds [33 x i8], [33 x i8]* %2, i64 0, i64 0
%11 = call i32 @findmac(i8* %10)
store i32 %11, i32* %1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %1
%15 = call i32 @delmac(i32 %14)
br label %16
16: ; preds = %13, %9
%17 = call i32 (...) @do_kill()
br label %18
18: ; preds = %16, %6
ret void
}

LLVM IR (-O2):
define void @doundef() {
%1 = alloca [33 x i8]
%2 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%3 = call i32 @symname(i8* %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @illname()
br label %12
7: ; preds = %0
%8 = call i32 @findmac(i8* %2)
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = call i32 @delmac(i32 %8)
br label %12
12: ; preds = %7, %10, %5
%13 = call i32 (...) @do_kill()
ret void
}
int WeaponIsPlayerMine(int nId) {
  return (nId == 16) || (nId == 38) || (nId == 51);
}


x86 assembly (clang, -O0):
<WeaponIsPlayerMine>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x10,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <WeaponIsPlayerMine+0x2f>
mov    $0x1,%al
cmpl   $0x26,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <WeaponIsPlayerMine+0x2f>
cmpl   $0x33,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<WeaponIsPlayerMine>:
mov    $0x1,%eax
cmp    $0x10,%edi
je     110f <WeaponIsPlayerMine+0xf>
cmp    $0x26,%edi
jne    1110 <WeaponIsPlayerMine+0x10>
ret
xor    %eax,%eax
cmp    $0x33,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @WeaponIsPlayerMine(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 16
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 38
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 51
br label %11
11: ; preds = %8, %5, %1
%12 = phi i1 [ true, %5 ], [ true, %1 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @WeaponIsPlayerMine(i32 %0) {
switch i32 %0, label %2 [
i32 38, label %5
i32 16, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 51
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ cpm_free(void *);
void free(void *ptr) { cpm_free(ptr); }


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

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

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

LLVM IR (-O2):
define void @free(i8* %0) {
%2 = tail call i32 @cpm_free(i8* %0)
ret void
}
/* Variables and functions */
long double do_round(long double, int);
long double ceill(long double x) { return do_round(x, 0x800); }


x86 assembly (clang, -O0):
<ceill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
mov    $0x800,%edi
call   1030 <do_round@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceill>:
mov    $0x800,%edi
jmp    1030 <do_round@plt>

LLVM IR (-O0):
define x86_fp80 @ceill(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @do_round(x86_fp80 %3, i32 2048)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @ceill(x86_fp80 %0) {
%2 = tail call x86_fp80 @do_round(x86_fp80 %0, i32 2048)
ret x86_fp80 %2
}
int is_alive(int *generation, int length) {
  int i = 0;
  for (; i < length; i++) {
    if (generation[i] == 1) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_alive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    114f <is_alive+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    113c <is_alive+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1156 <is_alive+0x56>
jmp    1141 <is_alive+0x41>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <is_alive+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alive>:
test   %esi,%esi
jle    111f <is_alive+0x1f>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmpl   $0x1,(%rdi,%rcx,4)
je     1122 <is_alive+0x22>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <is_alive+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_alive(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %13, %5
br i1 %7, label %14, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %13, %6 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 1
%13 = add nuw nsw i64 %9, 1
br i1 %12, label %14, label %6
14: ; preds = %8, %6, %2
%15 = phi i32 [ 0, %2 ], [ 0, %6 ], [ 1, %8 ]
ret i32 %15
}
/* Variables and functions */
unsigned int bar();
void foo0x1(void) {
  unsigned int a = bar();
  if (a <= 0x1)
    bar();
}


x86 assembly (clang, -O0):
<foo0x1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
ja     1133 <foo0x1+0x23>
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo0x1>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
cmp    $0x1,%eax
ja     1125 <foo0x1+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bar@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @foo0x1() {
%1 = alloca i32
%2 = call i32 (...) @bar()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ule i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @bar()
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @foo0x1() {
%1 = tail call i32 (...) @bar()
%2 = icmp ult i32 %1, 2
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @bar()
br label %5
5: ; preds = %3, %0
ret void
}
unsigned f5(unsigned x, unsigned int y) {
  y &= 8 * 4 - 1;
  return (x << y) | (x >> (-y & (8 * 4 - 1)));
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x1f,%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f5(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 = and i32 %5, 31
store i32 %6, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = shl i32 %7, %8
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sub i32 0, %11
%13 = and i32 %12, 31
%14 = lshr i32 %10, %13
%15 = or i32 %9, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @f5(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 %1)
ret i32 %3
}