xunge/DecIR huggingface dataset:
void clear_page_b(void *page) {
  asm volatile("movl $4096,%%ecx\n\t"
               "xorl %%eax,%%eax\n\t"
               "rep stosb\n\t" ::"D"(page));
}


x86 assembly (clang, -O0):
<clear_page_b>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1000,%ecx
xor    %eax,%eax
rep stos %al,%es:(%rdi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_page_b>:
mov    $0x1000,%ecx
xor    %eax,%eax
rep stos %al,%es:(%rdi)
ret

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

LLVM IR (-O2):
define void @clear_page_b(i8* %0) {
tail call void asm sideeffect "movl $$4096,%ecx\0A\09xorl %eax,%eax\0A\09rep stosb\0A\09", "{di},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
double i_hyperloglogGetAlpha(unsigned int k) {
  switch (k) {
  case 16:
    return 0.673f;
  case 32:
    return 0.697f;
  case 64:
    return 0.709f;
  }
  return 0.7213 / (1.0 + 1.079 / (float)k);
}


x86 assembly (clang, -O0):
<i_hyperloglogGetAlpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x10,%eax
je     113d <i_hyperloglogGetAlpha+0x3d>
jmp    111b <i_hyperloglogGetAlpha+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x20,%eax
je     114f <i_hyperloglogGetAlpha+0x4f>
jmp    112c <i_hyperloglogGetAlpha+0x2c>
mov    -0x10(%rbp),%eax
sub    $0x40,%eax
je     1161 <i_hyperloglogGetAlpha+0x61>
jmp    1173 <i_hyperloglogGetAlpha+0x73>
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a8 <i_hyperloglogGetAlpha+0xa8>
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a8 <i_hyperloglogGetAlpha+0xa8>
movsd  0xe97(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a8 <i_hyperloglogGetAlpha+0xa8>
mov    -0xc(%rbp),%eax
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea1(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xe8d(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe79(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_hyperloglogGetAlpha>:
cmp    $0x10,%edi
je     1118 <i_hyperloglogGetAlpha+0x18>
cmp    $0x40,%edi
je     1121 <i_hyperloglogGetAlpha+0x21>
cmp    $0x20,%edi
jne    112a <i_hyperloglogGetAlpha+0x2a>
movsd  0xef9(%rip),%xmm0
ret
movsd  0xee0(%rip),%xmm0
ret
movsd  0xedf(%rip),%xmm0
ret
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xedb(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xed7(%rip),%xmm1
movsd  0xed7(%rip),%xmm0
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @i_hyperloglogGetAlpha(i32 %0) {
%2 = alloca double
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 16, label %5
i32 32, label %6
i32 64, label %7
]
5: ; preds = %1
store double 0x3FE5893740000000, double* %2
br label %15
6: ; preds = %1
store double 0x3FE64DD300000000, double* %2
br label %15
7: ; preds = %1
store double 0x3FE6B020C0000000, double* %2
br label %15
8: ; preds = %1
%9 = load i32, i32* %3
%10 = uitofp i32 %9 to float
%11 = fpext float %10 to double
%12 = fdiv double 1.079000e+00, %11
%13 = fadd double 1.000000e+00, %12
%14 = fdiv double 7.213000e-01, %13
store double %14, double* %2
br label %15
15: ; preds = %8, %7, %6, %5
%16 = load double, double* %2
ret double %16
}

LLVM IR (-O2):
define double @i_hyperloglogGetAlpha(i32 %0) {
switch i32 %0, label %4 [
i32 16, label %10
i32 32, label %2
i32 64, label %3
]
2: ; preds = %1
br label %10
3: ; preds = %1
br label %10
4: ; preds = %1
%5 = uitofp i32 %0 to float
%6 = fpext float %5 to double
%7 = fdiv double 1.079000e+00, %6
%8 = fadd double %7, 1.000000e+00
%9 = fdiv double 7.213000e-01, %8
br label %10
10: ; preds = %1, %4, %3, %2
%11 = phi double [ %9, %4 ], [ 0x3FE6B020C0000000, %3 ], [ 0x3FE64DD300000000, %2 ], [ 0x3FE5893740000000, %1 ]
ret double %11
}
/* Variables and functions */
unsigned long Read_LE_Uint32_unsigned(unsigned char const *);
unsigned long Read_LE_Uint32(const char *p) {
  return Read_LE_Uint32_unsigned((const unsigned char *)p);
}


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

x86 assembly (clang, -O2):
<Read_LE_Uint32>:
jmp    1030 <Read_LE_Uint32_unsigned@plt>

LLVM IR (-O0):
define i64 @Read_LE_Uint32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @Read_LE_Uint32_unsigned(i8* %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @Read_LE_Uint32(i8* %0) {
%2 = tail call i64 @Read_LE_Uint32_unsigned(i8* %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) { printf("Hello, make!\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello, make!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int isblank(int c) { return c == '\t' || c == ' '; }


x86 assembly (clang, -O0):
<isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <isblank+0x20>
cmpl   $0x20,-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):
<isblank>:
cmp    $0x9,%edi
sete   %al
cmp    $0x20,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isblank(i32 %0) {
%2 = icmp eq i32 %0, 9
%3 = icmp eq i32 %0, 32
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("NO ISA 2.07 SUPPORT\n");
  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 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"NO ISA 2.07 SUPPORT\0A\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 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"NO ISA 2.07 SUPPORT\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  int *pointer;
  printf("pointer=%p\n", pointer);
  printf("*pointer=%d\n", *pointer);
  int foo;
  printf("foo=%d\n", foo);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"pointer=%p\0A\00"
@.str.1 = [13 x i8] c"*pointer=%d\0A\00"
@.str.2 = [8 x i8] c"foo=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* undef)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 undef)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int usage(char *const *argv) {
  printf("usage:-\n\n");
  printf("%s <hboot> <source.zip> <output keyfile>\n", argv[0]);
  return -1;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rsi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"usage:-\0A\0A\00"
@.str.1 = [42 x i8] c"%s <hboot> <source.zip> <output keyfile>\0A\00"
define i32 @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 -1
}

LLVM IR (-O2):
@.str.1 = [42 x i8] c"%s <hboot> <source.zip> <output keyfile>\0A\00"
@str = [9 x i8] c"usage:-\0A\00"
define i32 @usage(i8** nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%3 = load i8*, i8** %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ SSLEAY_VERSION;
char const *SSLeay_version(int /*<<< orphan*/);
const char *openssl_version_str(void) { return SSLeay_version(SSLEAY_VERSION); }


x86 assembly (clang, -O0):
<openssl_version_str>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
call   1030 <SSLeay_version@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<openssl_version_str>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <SSLeay_version@plt>

LLVM IR (-O0):
@SSLEAY_VERSION = global i32 0
define i8* @openssl_version_str() {
%1 = load i32, i32* @SSLEAY_VERSION
%2 = call i8* @SSLeay_version(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@SSLEAY_VERSION = global i32 0
define i8* @openssl_version_str() {
%1 = load i32, i32* @SSLEAY_VERSION
%2 = tail call i8* @SSLeay_version(i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
int /*<<< orphan*/ get_int(int, int *);
int /*<<< orphan*/ send_int(int, int);
int ping_server(int sock) {
  int event;
  send_int(sock, 0x19);
  if (!get_int(sock, &event))
    fatal("Error when receiving pong response.");
  return event == 0x0b ? 1 : 0;
}


x86 assembly (clang, -O0):
<ping_server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x19,%esi
call   1030 <send_int@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1050 <get_int@plt>
cmp    $0x0,%eax
jne    1169 <ping_server+0x39>
lea    0xe9c(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x8(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0xb,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ping_server>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    $0x19,%esi
call   1030 <send_int@plt>
lea    0xc(%rsp),%rsi
mov    %ebx,%edi
call   1050 <get_int@plt>
test   %eax,%eax
jne    115d <ping_server+0x2d>
lea    0xea8(%rip),%rdi
call   1040 <fatal@plt>
xor    %eax,%eax
cmpl   $0xb,0xc(%rsp)
sete   %al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Error when receiving pong response.\00"
define i32 @ping_server(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @send_int(i32 %4, i32 25)
%6 = load i32, i32* %2
%7 = call i32 @get_int(i32 %6, i32* %3)
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @fatal(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 11
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1, i32 0
ret i32 %15
}

LLVM IR (-O2):
@.str = [36 x i8] c"Error when receiving pong response.\00"
define i32 @ping_server(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @send_int(i32 %0, i32 25)
%5 = call i32 @get_int(i32 %0, i32* %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @fatal(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 11
%12 = zext i1 %11 to i32
ret i32 %12
}
double read_sign(const char **sptr) {
  double sign = 1.0;
  switch (**sptr) {
  case '-':
    sign = -1.0;
  case '+':
    ++(*sptr);
  default:
    return sign;
  }
}


x86 assembly (clang, -O0):
<read_sign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x3ff0000000000000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x2b,%eax
je     114f <read_sign+0x4f>
jmp    1131 <read_sign+0x31>
mov    -0x14(%rbp),%eax
sub    $0x2d,%eax
jne    115d <read_sign+0x5d>
jmp    1142 <read_sign+0x42>
movsd  0xeb6(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_sign>:
mov    (%rdi),%rax
movsbl (%rax),%ecx
movsd  0xef2(%rip),%xmm0
cmp    $0x2b,%ecx
je     1120 <read_sign+0x20>
cmp    $0x2d,%ecx
jne    1127 <read_sign+0x27>
movsd  0xee8(%rip),%xmm0
add    $0x1,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define double @read_sign(i8** %0) {
%2 = alloca i8**
%3 = alloca double
store i8** %0, i8*** %2
store double 1.000000e+00, double* %3
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %13 [
i32 45, label %8
i32 43, label %9
]
8: ; preds = %1
store double -1.000000e+00, double* %3
br label %9
9: ; preds = %1, %8
%10 = load i8**, i8*** %2
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %10
br label %13
13: ; preds = %1, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @read_sign(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
switch i32 %4, label %9 [
i32 45, label %5
i32 43, label %6
]
5: ; preds = %1
br label %6
6: ; preds = %1, %5
%7 = phi double [ 1.000000e+00, %1 ], [ -1.000000e+00, %5 ]
%8 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %8, i8** %0
br label %9
9: ; preds = %1, %6
%10 = phi double [ 1.000000e+00, %1 ], [ %7, %6 ]
ret double %10
}
int iAdd(int a, int b) { return a + b; }


x86 assembly (clang, -O0):
<iAdd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iAdd>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @iAdd(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @iAdd(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
const char *get_usage(void) {
  return "spc_scr_enc usage:\n"
         "\t--cpumem     | -c <cpu memory configuration filepath>\n"
         "\t--dict       | -d <dictionary filepath>\n"
         "\t--rom        | -r <rom filepath>\n"
         "\t--script     | -s <input xml script filepath>\n"
         "\t--table      | -t <table filepath>\n"
         "\t--version    | -v <version>\n"
         "\t--help       | -h <aide>\n";
}


x86 assembly (clang, -O0):
<get_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_usage>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [288 x i8] c"spc_scr_enc usage:\0A\09--cpumem | -c <cpu memory configuration filepath>\0A\09--dict | -d <dictionary filepath>\0A\09--rom | -r <rom filepath>\0A\09--script | -s <input xml script filepath>\0A\09--table | -t <table filepath>\0A\09--version | -v <version>\0A\09--help | -h <aide>\0A\00"
define i8* @get_usage() {
ret i8* getelementptr inbounds ([288 x i8], [288 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [288 x i8] c"spc_scr_enc usage:\0A\09--cpumem | -c <cpu memory configuration filepath>\0A\09--dict | -d <dictionary filepath>\0A\09--rom | -r <rom filepath>\0A\09--script | -s <input xml script filepath>\0A\09--table | -t <table filepath>\0A\09--version | -v <version>\0A\09--help | -h <aide>\0A\00"
define i8* @get_usage() {
ret i8* getelementptr inbounds ([288 x i8], [288 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ sio_write_cas_header(int /*<<< orphan*/ *, char const *);
int sio_create_cassette(const char *filename, const char *description) {
  FILE *fp;
  fp = fopen(filename, "wb");
  if (!fp)
    return -1;
  sio_write_cas_header(fp, description);
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<sio_create_cassette>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116b <sio_create_cassette+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1188 <sio_create_cassette+0x58>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <sio_write_cas_header@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sio_create_cassette>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1162 <sio_create_cassette+0x32>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <sio_write_cas_header@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
jmp    1167 <sio_create_cassette+0x37>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"wb\00"
define i32 @sio_create_cassette(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %6
%9 = load i32*, i32** %6
%10 = icmp ne i32* %9, null
br i1 %10, label %12, label %11
11: ; preds = %2
store i32 -1, i32* %3
br label %18
12: ; preds = %2
%13 = load i32*, i32** %6
%14 = load i8*, i8** %5
%15 = call i32 @sio_write_cas_header(i32* %13, i8* %14)
%16 = load i32*, i32** %6
%17 = call i32 @fclose(i32* %16)
store i32 0, i32* %3
br label %18
18: ; preds = %12, %11
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
define i32 @sio_create_cassette(i8* nocapture %0, i8* %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @sio_write_cas_header(i32* %3, i8* %1)
%7 = tail call i32 @fclose(i32* %3)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void cmp_eax_imm32(unsigned long imm32) {
  put8(0x3D);
  put32(imm32);
}


x86 assembly (clang, -O0):
<cmp_eax_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x3d,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rdi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_eax_imm32>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3d,%edi
call   1030 <put8@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @cmp_eax_imm32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @put8(i32 61)
%4 = load i64, i64* %2
%5 = call i32 @put32(i64 %4)
ret void
}

LLVM IR (-O2):
define void @cmp_eax_imm32(i64 %0) {
%2 = tail call i32 @put8(i32 61)
%3 = tail call i32 @put32(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
__attribute__((unused)) void CYMEMZERO(void *s, size_t n) {
  (void)memset(s, 0, n);
}


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

x86 assembly (clang, -O2):
<CYMEMZERO>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @CYMEMZERO(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}
int testBorder(int pozice, int leftright) {
  switch (pozice) {
  case 0:
  case 1:
    return (leftright ? 1 : 2);
    break;
  case 2:
    return 4;
    break;
  case 3:
  case 4:
    return (leftright ? 2 : 1);
    break;
  case 5:
    return 4;
    break;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<testBorder>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x5,%rax
ja     117d <testBorder+0x7d>
mov    -0x18(%rbp),%rax
lea    0xeda(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0xc(%rbp),%edx
mov    $0x2,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <testBorder+0x84>
movl   $0x4,-0x4(%rbp)
jmp    1184 <testBorder+0x84>
mov    -0xc(%rbp),%edx
mov    $0x1,%eax
mov    $0x2,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <testBorder+0x84>
movl   $0x4,-0x4(%rbp)
jmp    1184 <testBorder+0x84>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testBorder>:
cmp    $0x5,%edi
ja     1136 <testBorder+0x36>
mov    $0x3,%eax
bt     %edi,%eax
jb     112a <testBorder+0x2a>
mov    $0x4,%eax
mov    $0x18,%ecx
bt     %edi,%ecx
jae    1138 <testBorder+0x38>
cmp    $0x1,%esi
mov    $0x2,%eax
sbb    $0x0,%eax
ret
cmp    $0x1,%esi
mov    $0x1,%eax
adc    $0x0,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @testBorder(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
switch i32 %6, label %19 [
i32 0, label %7
i32 1, label %7
i32 2, label %12
i32 3, label %13
i32 4, label %13
i32 5, label %18
]
7: ; preds = %2, %2
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 2
store i32 %11, i32* %3
br label %20
12: ; preds = %2
store i32 4, i32* %3
br label %20
13: ; preds = %2, %2
%14 = load i32, i32* %5
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 2, i32 1
store i32 %17, i32* %3
br label %20
18: ; preds = %2
store i32 4, i32* %3
br label %20
19: ; preds = %2
store i32 0, i32* %3
br label %20
20: ; preds = %19, %18, %13, %12, %7
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @testBorder(i32 %0, i32 %1) {
switch i32 %0, label %9 [
i32 0, label %3
i32 1, label %3
i32 2, label %10
i32 3, label %6
i32 4, label %6
i32 5, label %10
]
3: ; preds = %2, %2
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i32 2, i32 1
br label %10
6: ; preds = %2, %2
%7 = icmp eq i32 %1, 0
%8 = select i1 %7, i32 1, i32 2
br label %10
9: ; preds = %2
br label %10
10: ; preds = %2, %2, %9, %6, %3
%11 = phi i32 [ 0, %9 ], [ %8, %6 ], [ %5, %3 ], [ 4, %2 ], [ 4, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *parent_dir_name(char const *);
int /*<<< orphan*/ strcmp(char *, char const *);
int parent_dir_name_is(const char *path, const char *str) {
  char *parent_dir;
  int result;
  parent_dir = parent_dir_name(path);
  if (!parent_dir)
    return 0;
  result = !strcmp(parent_dir, str);
  free(parent_dir);
  return result;
}


x86 assembly (clang, -O0):
<parent_dir_name_is>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <parent_dir_name@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1164 <parent_dir_name_is+0x34>
movl   $0x0,-0x4(%rbp)
jmp    1190 <parent_dir_name_is+0x60>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent_dir_name_is>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbp
call   1040 <parent_dir_name@plt>
test   %rax,%rax
je     1160 <parent_dir_name_is+0x30>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %rbp,%rsi
call   1050 <strcmp@plt>
xor    %ebp,%ebp
test   %eax,%eax
sete   %bpl
mov    %rbx,%rdi
call   1030 <free@plt>
jmp    1162 <parent_dir_name_is+0x32>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @parent_dir_name_is(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call i8* @parent_dir_name(i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %2
store i32 0, i32* %3
br label %23
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = load i8*, i8** %5
%16 = call i32 @strcmp(i8* %14, i8* %15)
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
store i32 %19, i32* %7
%20 = load i8*, i8** %6
%21 = call i32 @free(i8* %20)
%22 = load i32, i32* %7
store i32 %22, i32* %3
br label %23
23: ; preds = %13, %12
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @parent_dir_name_is(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @parent_dir_name(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i32 @strcmp(i8* %3, i8* dereferenceable(1) %1)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @free(i8* %3)
br label %10
10: ; preds = %2, %5
%11 = phi i32 [ %8, %5 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int rom_present(char *);
int xebec_available(void) {
  return (rom_present(L"roms/hdd/st506/ibm_xebec_62x0822_1985.bin"));
}


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

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

LLVM IR (-O0):
@.str = [42 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 104, i32 100, i32 100, i32 47, i32 115, i32 116, i32 53, i32 48, i32 54, i32 47, i32 105, i32 98, i32 109, i32 95, i32 120, i32 101, i32 98, i32 101, i32 99, i32 95, i32 54, i32 50, i32 120, i32 48, i32 56, i32 50, i32 50, i32 95, i32 49, i32 57, i32 56, i32 53, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @xebec_available() {
%1 = call i32 @rom_present(i8* bitcast ([42 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [42 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 104, i32 100, i32 100, i32 47, i32 115, i32 116, i32 53, i32 48, i32 54, i32 47, i32 105, i32 98, i32 109, i32 95, i32 120, i32 101, i32 98, i32 101, i32 99, i32 95, i32 54, i32 50, i32 120, i32 48, i32 56, i32 50, i32 50, i32 95, i32 49, i32 57, i32 56, i32 53, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @xebec_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([42 x i32]* @.str to i8*))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void free_int_vec(int *vec) { free(vec); }


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

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

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

LLVM IR (-O2):
define void @free_int_vec(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int ez_net_close_socket(int s) {
  if (s > 0)
    close(s);
  return 0;
}


x86 assembly (clang, -O0):
<ez_net_close_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112d <ez_net_close_socket+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ez_net_close_socket>:
test   %edi,%edi
jle    111e <ez_net_close_socket+0xe>
push   %rax
call   1030 <close@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ez_net_close_socket(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret i32 0
}
/* Variables and functions */
int getpid();
int snprintf(char *, size_t, char *, int, unsigned long);
int loghead_build_free(char *str, size_t str_size, const void *addr,
                       size_t size) {
  return snprintf(str, str_size, "%d\tfree\t0x%08lx\t0", getpid(),
                  (unsigned long)addr);
}


x86 assembly (clang, -O0):
<loghead_build_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %eax,%ecx
mov    -0x18(%rbp),%r8
lea    0xe9c(%rip),%rdx
call   1040 <snprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loghead_build_free>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec4(%rip),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %eax,%ecx
mov    %r14,%r8
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <snprintf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%d\09free\090x%08lx\090\00"
define i32 @loghead_build_free(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 (...) @getpid()
%12 = load i8*, i8** %7
%13 = ptrtoint i8* %12 to i64
%14 = call i32 @snprintf(i8* %9, i64 %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %11, i64 %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [18 x i8] c"%d\09free\090x%08lx\090\00"
define i32 @loghead_build_free(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i32 (...) @getpid()
%6 = ptrtoint i8* %2 to i64
%7 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void imprimir(int *w, int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%d\n", w[i]);
  }
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @imprimir(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_and_si128(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_andnot_si128(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_or_si128(int /*<<< orphan*/, int /*<<< orphan*/);
extern __attribute__((__gnu___, __always___, __artificial__)) __m128i
_MM_BLENDV_EPI8(__m128i a, __m128i b, __m128i mask) {
  __m128i a_masked, b_masked;
  b_masked = _mm_and_si128(mask, b);
  a_masked = _mm_andnot_si128(mask, a);
  return _mm_or_si128(a_masked, b_masked);
}


x86 assembly (clang, -O0):
<_MM_BLENDV_EPI8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <_mm_and_si128@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <_mm_andnot_si128@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <_mm_or_si128@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_MM_BLENDV_EPI8>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %edi,%r14d
mov    %edx,%edi
call   1050 <_mm_and_si128@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    %r14d,%esi
call   1040 <_mm_andnot_si128@plt>
mov    %eax,%edi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <_mm_or_si128@plt>

LLVM IR (-O0):
define i32 @_MM_BLENDV_EPI8(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = call i32 @_mm_and_si128(i32 %9, i32 %10)
store i32 %11, i32* %8
%12 = load i32, i32* %6
%13 = load i32, i32* %4
%14 = call i32 @_mm_andnot_si128(i32 %12, i32 %13)
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = call i32 @_mm_or_si128(i32 %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @_MM_BLENDV_EPI8(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_mm_and_si128(i32 %2, i32 %1)
%5 = tail call i32 @_mm_andnot_si128(i32 %2, i32 %0)
%6 = tail call i32 @_mm_or_si128(i32 %5, i32 %4)
ret i32 %6
}
unsigned int mask(unsigned int n) { return (1 << n) - 1; }


x86 assembly (clang, -O0):
<mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask>:
mov    %edi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @mask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
%5 = sub nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @mask(i32 %0) {
%2 = shl nsw i32 -1, %0
%3 = xor i32 %2, -1
ret i32 %3
}
int d_lt_cr2(double a1) { return !(((100) < (a1))); }


x86 assembly (clang, -O0):
<d_lt_cr2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_lt_cr2>:
xor    %eax,%eax
ucomisd 0xef6(%rip),%xmm0
setbe  %al
ret

LLVM IR (-O0):
define i32 @d_lt_cr2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double 1.000000e+02, %3
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @d_lt_cr2(double %0) {
%2 = fcmp ule double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
int main() {
  int a = 6;
  int b = 6;
  int c = 6;
  for (a = 0; a < 6; ++a) {
    for (b = 0; b < 6; ++b) {
      for (c = 0; c < 6; ++c) {
      }
    }
  }
  if (!(a == 6 && b == 6 && c == 6)) {
  ERROR:
    goto ERROR;
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
movl   $0x6,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    118c <main+0x8c>
movl   $0x0,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jge    1179 <main+0x79>
movl   $0x0,-0x10(%rbp)
cmpl   $0x6,-0x10(%rbp)
jge    1166 <main+0x66>
jmp    1158 <main+0x58>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1149 <main+0x49>
jmp    116b <main+0x6b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <main+0x38>
jmp    117e <main+0x7e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1127 <main+0x27>
cmpl   $0x6,-0x8(%rbp)
jne    11aa <main+0xaa>
cmpl   $0x6,-0xc(%rbp)
jne    11aa <main+0xaa>
cmpl   $0x6,-0x10(%rbp)
je     11b4 <main+0xb4>
jmp    11af <main+0xaf>
jmp    11af <main+0xaf>
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 6, i32* %2
store i32 6, i32* %3
store i32 6, i32* %4
store i32 0, i32* %2
br label %5
5: ; preds = %25, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 6
br i1 %7, label %8, label %28
8: ; preds = %5
store i32 0, i32* %3
br label %9
9: ; preds = %21, %8
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 6
br i1 %11, label %12, label %24
12: ; preds = %9
store i32 0, i32* %4
br label %13
13: ; preds = %17, %12
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 6
br i1 %15, label %16, label %20
16: ; preds = %13
br label %17
17: ; preds = %16
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %13
20: ; preds = %13
br label %21
21: ; preds = %20
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %9
24: ; preds = %9
br label %25
25: ; preds = %24
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %5
28: ; preds = %5
%29 = load i32, i32* %2
%30 = icmp eq i32 %29, 6
br i1 %30, label %31, label %37
31: ; preds = %28
%32 = load i32, i32* %3
%33 = icmp eq i32 %32, 6
br i1 %33, label %34, label %37
34: ; preds = %31
%35 = load i32, i32* %4
%36 = icmp eq i32 %35, 6
br i1 %36, label %39, label %37
37: ; preds = %34, %31, %28
br label %38
38: ; preds = %38, %37
br label %38
39: ; preds = %34
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ LOCK_SH;
int sw_flock(int, int /*<<< orphan*/);
int sw_sh_flock(int fd) { return sw_flock(fd, LOCK_SH); }


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

x86 assembly (clang, -O2):
<sw_sh_flock>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <sw_flock@plt>

LLVM IR (-O0):
@LOCK_SH = global i32 0
define i32 @sw_sh_flock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @LOCK_SH
%5 = call i32 @sw_flock(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@LOCK_SH = global i32 0
define i32 @sw_sh_flock(i32 %0) {
%2 = load i32, i32* @LOCK_SH
%3 = tail call i32 @sw_flock(i32 %0, i32 %2)
ret i32 %3
}
void INT_Excep_SCI0_ERI0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI0_ERI0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ili9341_WriteReg(int);
void ili9341_DisplayOn(void) { ili9341_WriteReg(0x29); }


x86 assembly (clang, -O0):
<ili9341_DisplayOn>:
push   %rbp
mov    %rsp,%rbp
mov    $0x29,%edi
call   1030 <ili9341_WriteReg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ili9341_DisplayOn>:
mov    $0x29,%edi
jmp    1030 <ili9341_WriteReg@plt>

LLVM IR (-O0):
define void @ili9341_DisplayOn() {
%1 = call i32 @ili9341_WriteReg(i32 41)
ret void
}

LLVM IR (-O2):
define void @ili9341_DisplayOn() {
%1 = tail call i32 @ili9341_WriteReg(i32 41)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int main(int argc, char const *argv[]) {
  printf("%s\n", argv[1]);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
struct uat_adsb_mdb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ maybe_send_air_position(struct uat_adsb_mdb *);
int /*<<< orphan*/ maybe_send_air_velocity(struct uat_adsb_mdb *);
int /*<<< orphan*/ maybe_send_callsign(struct uat_adsb_mdb *);
int /*<<< orphan*/ maybe_send_surface_position(struct uat_adsb_mdb *);
void generate_esnt(struct uat_adsb_mdb *mdb) {
  maybe_send_surface_position(mdb);
  maybe_send_air_position(mdb);
  maybe_send_air_velocity(mdb);
  maybe_send_callsign(mdb);
}


x86 assembly (clang, -O0):
<generate_esnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <maybe_send_surface_position@plt>
mov    -0x8(%rbp),%rdi
call   1050 <maybe_send_air_position@plt>
mov    -0x8(%rbp),%rdi
call   1040 <maybe_send_air_velocity@plt>
mov    -0x8(%rbp),%rdi
call   1060 <maybe_send_callsign@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_esnt>:
push   %rbx
mov    %rdi,%rbx
call   1030 <maybe_send_surface_position@plt>
mov    %rbx,%rdi
call   1050 <maybe_send_air_position@plt>
mov    %rbx,%rdi
call   1040 <maybe_send_air_velocity@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <maybe_send_callsign@plt>

LLVM IR (-O0):
%struct.uat_adsb_mdb = type { i32 }
define void @generate_esnt(%struct.uat_adsb_mdb* %0) {
%2 = alloca %struct.uat_adsb_mdb*
store %struct.uat_adsb_mdb* %0, %struct.uat_adsb_mdb** %2
%3 = load %struct.uat_adsb_mdb*, %struct.uat_adsb_mdb** %2
%4 = call i32 @maybe_send_surface_position(%struct.uat_adsb_mdb* %3)
%5 = load %struct.uat_adsb_mdb*, %struct.uat_adsb_mdb** %2
%6 = call i32 @maybe_send_air_position(%struct.uat_adsb_mdb* %5)
%7 = load %struct.uat_adsb_mdb*, %struct.uat_adsb_mdb** %2
%8 = call i32 @maybe_send_air_velocity(%struct.uat_adsb_mdb* %7)
%9 = load %struct.uat_adsb_mdb*, %struct.uat_adsb_mdb** %2
%10 = call i32 @maybe_send_callsign(%struct.uat_adsb_mdb* %9)
ret void
}

LLVM IR (-O2):
%struct.uat_adsb_mdb = type { i32 }
define void @generate_esnt(%struct.uat_adsb_mdb* %0) {
%2 = tail call i32 @maybe_send_surface_position(%struct.uat_adsb_mdb* %0)
%3 = tail call i32 @maybe_send_air_position(%struct.uat_adsb_mdb* %0)
%4 = tail call i32 @maybe_send_air_velocity(%struct.uat_adsb_mdb* %0)
%5 = tail call i32 @maybe_send_callsign(%struct.uat_adsb_mdb* %0)
ret void
}