xunge/DecIR huggingface dataset:
int dna_to_idx(char c) {
  switch (c) {
  case 'A':
    return 0;
  case 'C':
    return 1;
  case 'G':
    return 2;
  case 'T':
    return 3;
  }
  return -1;
}


x86 assembly (clang, -O0):
<dna_to_idx>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x13,%eax
ja     1164 <dna_to_idx+0x64>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    116b <dna_to_idx+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    116b <dna_to_idx+0x6b>
movl   $0x2,-0x4(%rbp)
jmp    116b <dna_to_idx+0x6b>
movl   $0x3,-0x4(%rbp)
jmp    116b <dna_to_idx+0x6b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dna_to_idx>:
add    $0xffffffbf,%edi
cmp    $0x13,%edi
ja     1120 <dna_to_idx+0x20>
xor    %eax,%eax
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x1,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x2,%eax
ret
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @dna_to_idx(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 65, label %6
i32 67, label %7
i32 71, label %8
i32 84, label %9
]
6: ; preds = %1
store i32 0, i32* %2
br label %11
7: ; preds = %1
store i32 1, i32* %2
br label %11
8: ; preds = %1
store i32 2, i32* %2
br label %11
9: ; preds = %1
store i32 3, i32* %2
br label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @dna_to_idx(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 65, label %7
i32 67, label %3
i32 71, label %4
i32 84, label %5
]
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4, %3
%8 = phi i32 [ -1, %6 ], [ 3, %5 ], [ 2, %4 ], [ 1, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
long atol(char *);
long Type_toLong(char *val) { return atol(val); }


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

x86 assembly (clang, -O2):
<Type_toLong>:
jmp    1030 <atol@plt>

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

LLVM IR (-O2):
define i64 @Type_toLong(i8* nocapture %0) {
%2 = tail call i64 @atol(i8* %0)
ret i64 %2
}
void glmGenerateZeroVector4f(float *v) {
  v[0] = 0;
  v[1] = 0;
  v[2] = 0;
  v[3] = 0;
}


x86 assembly (clang, -O0):
<glmGenerateZeroVector4f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmGenerateZeroVector4f>:
xorps  %xmm0,%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @glmGenerateZeroVector4f(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
store float 0.000000e+00, float* %4
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 1
store float 0.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 2
store float 0.000000e+00, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 3
store float 0.000000e+00, float* %10
ret void
}

LLVM IR (-O2):
define void @glmGenerateZeroVector4f(float* nocapture writeonly %0) {
%2 = bitcast float* %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ step_hash(int);
unsigned short func_32(int p_33, short p_34) {
  unsigned l_141 = 3UL;
  step_hash(85);
  l_141 &= p_34;
  step_hash(86);
  return l_141;
}


x86 assembly (clang, -O0):
<func_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movl   $0x3,-0xc(%rbp)
mov    $0x55,%edi
call   1030 <step_hash@plt>
movswl -0x6(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x56,%edi
call   1030 <step_hash@plt>
mov    -0xc(%rbp),%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_32>:
push   %rbx
mov    %esi,%ebx
mov    $0x55,%edi
call   1030 <step_hash@plt>
and    $0x3,%ebx
mov    $0x56,%edi
call   1030 <step_hash@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @func_32(i32 %0, i16 signext %1) {
%3 = alloca i32
%4 = alloca i16
%5 = alloca i32
store i32 %0, i32* %3
store i16 %1, i16* %4
store i32 3, i32* %5
%6 = call i32 @step_hash(i32 85)
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = load i32, i32* %5
%10 = and i32 %9, %8
store i32 %10, i32* %5
%11 = call i32 @step_hash(i32 86)
%12 = load i32, i32* %5
%13 = trunc i32 %12 to i16
ret i16 %13
}

LLVM IR (-O2):
define zeroext i16 @func_32(i32 %0, i16 signext %1) {
%3 = tail call i32 @step_hash(i32 85)
%4 = and i16 %1, 3
%5 = tail call i32 @step_hash(i32 86)
ret i16 %4
}
/* Variables and functions */
char *h();
int /*<<< orphan*/ i(char *);
int /*<<< orphan*/ j(char *);
int main() {
  char *ptr = h();
  *ptr = 'a';
  j(ptr);
  i(ptr);
  *ptr = 'b';
  j(ptr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <h@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x61,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <j@plt>
mov    -0x8(%rbp),%rdi
call   1050 <i@plt>
mov    -0x8(%rbp),%rax
movb   $0x62,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <j@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <h@plt>
mov    %rax,%rbx
movb   $0x61,(%rax)
mov    %rax,%rdi
call   1030 <j@plt>
mov    %rbx,%rdi
call   1050 <i@plt>
movb   $0x62,(%rbx)
mov    %rbx,%rdi
call   1030 <j@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8*
%2 = call i8* (...) @h()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
store i8 97, i8* %3
%4 = load i8*, i8** %1
%5 = call i32 @j(i8* %4)
%6 = load i8*, i8** %1
%7 = call i32 @i(i8* %6)
%8 = load i8*, i8** %1
store i8 98, i8* %8
%9 = load i8*, i8** %1
%10 = call i32 @j(i8* %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* (...) @h()
store i8 97, i8* %1
%2 = tail call i32 @j(i8* %1)
%3 = tail call i32 @i(i8* %1)
store i8 98, i8* %1
%4 = tail call i32 @j(i8* %1)
ret i32 0
}
int notInstruction(int i) {
  int mask = 0xffffffff ^ i;
  return mask;
}


x86 assembly (clang, -O0):
<notInstruction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<notInstruction>:
mov    %edi,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @notInstruction(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = xor i32 -1, %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @notInstruction(i32 %0) {
%2 = xor i32 %0, -1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ sin16(int /*<<< orphan*/);
int32_t tri(uint16_t phase) { return sin16(phase); }


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

x86 assembly (clang, -O2):
<tri>:
jmp    1030 <sin16@plt>

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

LLVM IR (-O2):
define i32 @tri(i32 %0) {
%2 = tail call i32 @sin16(i32 %0)
ret i32 %2
}
void mutex_unlock(struct mutex *lock) { return; }


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

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

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

LLVM IR (-O2):
%struct.mutex = type opaque
define void @mutex_unlock(%struct.mutex* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct tcphdr {
  int /*<<< orphan*/ dest;
};

/* Variables and functions */
uint16_t tcphdr_dest(struct tcphdr *h) { return h->dest; }


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

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

LLVM IR (-O0):
%struct.tcphdr = type { i32 }
define i32 @tcphdr_dest(%struct.tcphdr* %0) {
%2 = alloca %struct.tcphdr*
store %struct.tcphdr* %0, %struct.tcphdr** %2
%3 = load %struct.tcphdr*, %struct.tcphdr** %2
%4 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.tcphdr = type { i32 }
define i32 @tcphdr_dest(%struct.tcphdr* nocapture %0) {
%2 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ core4_swap(char *, int);
void U_EMRSCALEWINDOWEXTEX_swap(char *record, int torev) {
  core4_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_EMRSCALEWINDOWEXTEX_swap>:
jmp    1030 <core4_swap@plt>

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

LLVM IR (-O2):
define void @U_EMRSCALEWINDOWEXTEX_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core4_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char var1;
  printf("Enter character: ");
  scanf("%c", &var1);
  printf("You entered %c.\n", var1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
movsbl 0x7(%rsp),%esi
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter character: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [17 x i8] c"You entered %c.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter character: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [17 x i8] c"You entered %c.\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
scalar_t__ MAP_FAILED;
void *mmap(void *addr, size_t length, int prot, int flags, int fd,
           off_t offset) {
  return (void *)MAP_FAILED;
}


x86 assembly (clang, -O0):
<mmap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmap>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@MAP_FAILED = global i64 0
define i8* @mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i64 %1, i64* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i64, i64* @MAP_FAILED
%14 = inttoptr i64 %13 to i8*
ret i8* %14
}

LLVM IR (-O2):
@MAP_FAILED = global i64 0
define i8* @mmap(i8* nocapture readnone %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = load i64, i64* @MAP_FAILED
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}
void Fold(str) char *str;
{
  while (*str) {
    if (isupper(*str))
      *str = *str - 'A' + 'a';
    str++;
  }
}


x86 assembly (clang, -O0):
<Fold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1164 <Fold+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isupper@plt>
cmp    $0x0,%eax
je     1153 <Fold+0x43>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <Fold+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fold>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%bpl
test   %bpl,%bpl
je     1153 <Fold+0x43>
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    113c <Fold+0x2c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx),%ebp
add    $0x1,%rbx
test   %bpl,%bpl
je     1153 <Fold+0x43>
movsbl %bpl,%edi
call   1030 <isupper@plt>
test   %eax,%eax
je     1130 <Fold+0x20>
add    $0x20,%bpl
mov    %bpl,-0x1(%rbx)
jmp    1130 <Fold+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Fold(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @isupper(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = add i8 %5, 32
store i8 %11, i8* %6
br label %12
12: ; preds = %10, %4
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
int begins_with(const char *str, const char *with) {
  return strncmp(str, with, strlen(with)) == 0;
}


x86 assembly (clang, -O0):
<begins_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<begins_with>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @begins_with(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @begins_with(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
char *read_seekable_stream(int /*<<< orphan*/ *, size_t *);
char *read_whole_file(const char filepath[], size_t *read) {
  char *content = NULL;
  FILE *fp;
  *read = 0U;
  if ((fp = fopen(filepath, "rb")) != NULL) {
    content = read_seekable_stream(fp, read);
    fclose(fp);
  }
  return content;
}


x86 assembly (clang, -O0):
<read_whole_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     118b <read_whole_file+0x5b>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <read_seekable_stream@plt>
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_whole_file>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
movq   $0x0,(%rsi)
lea    0xebb(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     116d <read_whole_file+0x3d>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <read_seekable_stream@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %r14,%rax
jmp    116f <read_whole_file+0x3f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i8* @read_whole_file(i8* nocapture %0, i64* %1) {
store i64 0, i64* %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 i8* @read_seekable_stream(i32* %3, i64* %1)
%7 = tail call i32 @fclose(i32* %3)
br label %8
8: ; preds = %5, %2
%9 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %9
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int x;
};
typedef TYPE_1__ XButtonReleasedEvent;

/* Variables and functions */
void set_XButtonReleasedEvent_x(void *_p, int _v) {
  ((XButtonReleasedEvent *)_p)->x = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XButtonReleasedEvent_x>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XButtonReleasedEvent_x(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void and_eax_imm32(unsigned long imm32) {
  put8(0x25);
  put32(imm32);
}


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

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

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

LLVM IR (-O2):
define void @and_eax_imm32(i64 %0) {
%2 = tail call i32 @put8(i32 37)
%3 = tail call i32 @put32(i64 %0)
ret void
}
int reverseFactorial(int number) {
  int faculty = 1;
  int isFaculty = 1;
  do {
    ++faculty;
    if (0 != number % faculty) {
      isFaculty = 0;
    } else {
      number /= faculty;
    }
  } while (1 == isFaculty && number >= faculty);
  if (0 == isFaculty) {
    faculty = -1;
  }
  return faculty;
}


x86 assembly (clang, -O0):
<reverseFactorial>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
xor    %eax,%eax
cmp    %edx,%eax
je     113b <reverseFactorial+0x3b>
movl   $0x0,-0xc(%rbp)
jmp    1147 <reverseFactorial+0x47>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    114c <reverseFactorial+0x4c>
xor    %eax,%eax
mov    $0x1,%ecx
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
jne    116b <reverseFactorial+0x6b>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setge  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1115 <reverseFactorial+0x15>
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
jne    1188 <reverseFactorial+0x88>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseFactorial>:
mov    %edi,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x2(%rcx),%esi
cltd
idiv   %esi
test   %edx,%edx
jne    1127 <reverseFactorial+0x27>
add    $0x1,%ecx
cmp    %ecx,%eax
jg     1110 <reverseFactorial+0x10>
add    $0x1,%ecx
mov    %ecx,%eax
ret
mov    $0xffffffff,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @reverseFactorial(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
store i32 1, i32* %4
br label %5
5: ; preds = %25, %1
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = srem i32 %8, %9
%11 = icmp ne i32 0, %10
br i1 %11, label %12, label %13
12: ; preds = %5
store i32 0, i32* %4
br label %17
13: ; preds = %5
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = sdiv i32 %15, %14
store i32 %16, i32* %2
br label %17
17: ; preds = %13, %12
br label %18
18: ; preds = %17
%19 = load i32, i32* %4
%20 = icmp eq i32 1, %19
br i1 %20, label %21, label %25
21: ; preds = %18
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = icmp sge i32 %22, %23
br label %25
25: ; preds = %21, %18
%26 = phi i1 [ false, %18 ], [ %24, %21 ]
br i1 %26, label %5, label %27
27: ; preds = %25
%28 = load i32, i32* %4
%29 = icmp eq i32 0, %28
br i1 %29, label %30, label %31
30: ; preds = %27
store i32 -1, i32* %3
br label %31
31: ; preds = %30, %27
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @reverseFactorial(i32 %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i32 [ %0, %1 ], [ %7, %9 ]
%4 = phi i32 [ 1, %1 ], [ %5, %9 ]
%5 = add nuw nsw i32 %4, 1
%6 = srem i32 %3, %5
%7 = sdiv i32 %3, %5
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = icmp sgt i32 %7, %4
br i1 %10, label %2, label %11
11: ; preds = %2, %9
%12 = phi i32 [ -1, %2 ], [ %5, %9 ]
ret i32 %12
}
unsigned long int cast_ushort_ulong(unsigned short int x) {
  return (unsigned long int)x;
}


x86 assembly (clang, -O0):
<cast_ushort_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast_ushort_ulong>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i64 @cast_ushort_ulong(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @cast_ushort_ulong(i16 zeroext %0) {
%2 = zext i16 %0 to i64
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int /*<<< orphan*/ SSL_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_shutdown(int /*<<< orphan*/ *);
void ShutdownSSL(SSL *ssl) {
  SSL_shutdown(ssl);
  SSL_free(ssl);
}


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

x86 assembly (clang, -O2):
<ShutdownSSL>:
push   %rbx
mov    %rdi,%rbx
call   1040 <SSL_shutdown@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <SSL_free@plt>

LLVM IR (-O0):
define void @ShutdownSSL(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @SSL_shutdown(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @SSL_free(i32* %5)
ret void
}

LLVM IR (-O2):
define void @ShutdownSSL(i32* %0) {
%2 = tail call i32 @SSL_shutdown(i32* %0)
%3 = tail call i32 @SSL_free(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("TTTTTTTTTT\n");
  printf("TTTTTTTTTT\n");
  printf("    TT\n");
  printf("    TT\n");
  printf("    TT\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str.2 = [11 x i8] c"TTTTTTTTTT\00"
@str.5 = [7 x i8] c" TT\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.2, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.5, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct cli_def {
  int dummy;
};

/* Variables and functions */
scalar_t__ strcasecmp(char *, char const *);
int transparent_validator(struct cli_def *cli, const char *name,
                          const char *value) {
  return strcasecmp("transparent", value) ? -1 : 0;
}


x86 assembly (clang, -O0):
<transparent_validator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1030 <strcasecmp@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transparent_validator>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rdx,%rsi
call   1030 <strcasecmp@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.cli_def = type { i32 }
@.str = [12 x i8] c"transparent\00"
define i32 @transparent_validator(%struct.cli_def* %0, i8* %1, i8* %2) {
%4 = alloca %struct.cli_def*
%5 = alloca i8*
%6 = alloca i8*
store %struct.cli_def* %0, %struct.cli_def** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i64 @strcasecmp(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 -1, i32 0
ret i32 %11
}

LLVM IR (-O2):
%struct.cli_def = type { i32 }
@.str = [12 x i8] c"transparent\00"
define i32 @transparent_validator(%struct.cli_def* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture %2) {
%4 = tail call i64 @strcasecmp(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = icmp ne i64 %4, 0
%6 = sext i1 %5 to i32
ret i32 %6
}
int test_imm_BAuint32_reg(unsigned int val) {
  return ((val) & (0xBA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BAuint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xba,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_BAuint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 186
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_BAuint32_reg(i32 %0) {
%2 = and i32 %0, 186
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ DrawTextlnXY128(char const *, unsigned long, unsigned long);
void drawtextlnxy(const char *s, unsigned long x, unsigned long y) {
  DrawTextlnXY128(s, x, y);
}


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

x86 assembly (clang, -O2):
<drawtextlnxy>:
jmp    1030 <DrawTextlnXY128@plt>

LLVM IR (-O0):
define void @drawtextlnxy(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call i32 @DrawTextlnXY128(i8* %7, i64 %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @drawtextlnxy(i8* %0, i64 %1, i64 %2) {
%4 = tail call i32 @DrawTextlnXY128(i8* %0, i64 %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usart_drdy();
unsigned char usart_getc();
unsigned char usart_wait_and_read(void) {
  while (!usart_drdy())
    ;
  return usart_getc();
}


x86 assembly (clang, -O0):
<usart_wait_and_read>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <usart_wait_and_read+0x9>
mov    $0x0,%al
call   1040 <usart_drdy@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1145 <usart_wait_and_read+0x25>
jmp    114a <usart_wait_and_read+0x2a>
jmp    1129 <usart_wait_and_read+0x9>
mov    $0x0,%al
call   1030 <usart_getc@plt>
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usart_wait_and_read>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <usart_drdy@plt>
test   %eax,%eax
je     1130 <usart_wait_and_read+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1030 <usart_getc@plt>

LLVM IR (-O0):
define zeroext i8 @usart_wait_and_read() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @usart_drdy()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = call zeroext i8 (...) @usart_getc()
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @usart_wait_and_read() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @usart_drdy()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call zeroext i8 (...) @usart_getc()
ret i8 %5
}
int funa(int a, int b) { return a + b; }


x86 assembly (clang, -O0):
<funa>:
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):
<funa>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @funa(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 @funa(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
scalar_t__ fileread(char *, void *, int);
int rbkeyget(void *key) {
  if (fileread(".xe"
               "/"
               "rb.key",
               key, 16)) {
    return 0x80003102;
  }
  return 0;
}


x86 assembly (clang, -O0):
<rbkeyget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x10,%edx
call   1030 <fileread@plt>
cmp    $0x0,%rax
je     1147 <rbkeyget+0x37>
movl   $0x80003102,-0x4(%rbp)
jmp    114e <rbkeyget+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rbkeyget>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
mov    $0x10,%edx
call   1030 <fileread@plt>
xor    %ecx,%ecx
test   %rax,%rax
mov    $0x80003102,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c".xe/rb.key\00"
define i32 @rbkeyget(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @fileread(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4, i32 16)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -2147471102, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [11 x i8] c".xe/rb.key\00"
define i32 @rbkeyget(i8* %0) {
%2 = tail call i64 @fileread(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i32 16)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 -2147471102
ret i32 %4
}
void inc_zcache_pers_ate_eph_failed(void) {}


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

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

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

LLVM IR (-O2):
define void @inc_zcache_pers_ate_eph_failed() {
ret void
}
double maxdbl(double x, double y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<maxdbl>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <maxdbl+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <maxdbl+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxdbl>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @maxdbl(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @maxdbl(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
int f18() {
  int x = 0;
  if (1)
    x = 10;
  while (1)
    x = 10;
  do
    x = 10;
  while (1);
  return (x = 10);
}


x86 assembly (clang, -O0):
<f18>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x4(%rbp)
movl   $0xa,-0x4(%rbp)
jmp    1112 <f18+0x12>

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

LLVM IR (-O0):
define i32 @f18() {
%1 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %1
br label %2
2: ; preds = %0, %2
store i32 10, i32* %1
br label %2
}

LLVM IR (-O2):
define i32 @f18() {
br label %1
1: ; preds = %1, %0
br label %1
}
void foo543() {}


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

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

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

LLVM IR (-O2):
define void @foo543() {
ret void
}
void foo032(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo032(i32 %0) {
ret void
}
/* Variables and functions */
int EINTR;
int /*<<< orphan*/ assert(int);
scalar_t__ close(int);
int errno;
int close_nointr(int fd) {
  assert(fd >= 0);
  if (close(fd) >= 0)
    return 0;
  if (errno == EINTR)
    return 0;
  return -errno;
}


x86 assembly (clang, -O0):
<close_nointr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
jl     115a <close_nointr+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    118c <close_nointr+0x6c>
mov    0x2e7f(%rip),%rax
mov    (%rax),%eax
mov    0x2e6e(%rip),%rcx
cmp    (%rcx),%eax
jne    117e <close_nointr+0x5e>
movl   $0x0,-0x4(%rbp)
jmp    118c <close_nointr+0x6c>
xor    %eax,%eax
mov    0x2e59(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_nointr>:
push   %rbx
mov    %edi,%ebx
not    %edi
shr    $0x1f,%edi
call   1040 <assert@plt>
mov    %ebx,%edi
call   1030 <close@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     1140 <close_nointr+0x20>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%ecx
mov    0x2e88(%rip),%rdx
mov    %ecx,%esi
neg    %esi
xor    %eax,%eax
cmp    (%rdx),%ecx
cmovne %esi,%eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
@EINTR = global i32 0
define i32 @close_nointr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %3
%9 = call i64 @close(i32 %8)
%10 = icmp sge i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 0, i32* %2
br label %20
12: ; preds = %1
%13 = load i32, i32* @errno
%14 = load i32, i32* @EINTR
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 0, i32* %2
br label %20
17: ; preds = %12
%18 = load i32, i32* @errno
%19 = sub nsw i32 0, %18
store i32 %19, i32* %2
br label %20
20: ; preds = %17, %16, %11
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@errno = global i32 0
@EINTR = global i32 0
define i32 @close_nointr(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @close(i32 %0)
%6 = icmp sgt i64 %5, -1
br i1 %6, label %13, label %7
7: ; preds = %1
%8 = load i32, i32* @errno
%9 = load i32, i32* @EINTR
%10 = icmp eq i32 %8, %9
%11 = sub nsw i32 0, %8
%12 = select i1 %10, i32 0, i32 %11
br label %13
13: ; preds = %7, %1
%14 = phi i32 [ 0, %1 ], [ %12, %7 ]
ret i32 %14
}
void gateGuard1() {}


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

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

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

LLVM IR (-O2):
define void @gateGuard1() {
ret void
}
/* Variables and functions */
char *ultoa(unsigned int, char *, int);
char *utoa(unsigned int val, char *buf, int radix) {
  return ultoa(val, buf, radix);
}


x86 assembly (clang, -O0):
<utoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ultoa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utoa>:
jmp    1030 <ultoa@plt>

LLVM IR (-O0):
define i8* @utoa(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i8* @ultoa(i32 %7, i8* %8, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @utoa(i32 %0, i8* %1, i32 %2) {
%4 = tail call i8* @ultoa(i32 %0, i8* %1, i32 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void release_all_buttons(void) { puts("bra ok"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"bra ok\00"
define void @release_all_buttons() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ c;

/* Variables and functions */
scalar_t__ read(int /*<<< orphan*/, unsigned char *, int);
int getch() {
  int r;
  unsigned char c;
  if ((r = (int)read(0, &c, sizeof(c))) < 0) {
    return r;
  } else {
    return c;
  }
}


x86 assembly (clang, -O0):
<getch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    113f <getch+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <getch+0x36>
movzbl -0x9(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch>:
push   %rax
lea    0x7(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
test   %eax,%eax
movzbl 0x7(%rsp),%ecx
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getch() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = call i64 @read(i32 0, i8* %3, i32 1)
%5 = trunc i64 %4 to i32
store i32 %5, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i32, i32* %2
store i32 %8, i32* %1
br label %12
9: ; preds = %0
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
store i32 %11, i32* %1
br label %12
12: ; preds = %9, %7
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @getch() {
%1 = alloca i8
%2 = call i64 @read(i32 0, i8* %1, i32 1)
%3 = trunc i64 %2 to i32
%4 = icmp slt i32 %3, 0
%5 = load i8, i8* %1
%6 = zext i8 %5 to i32
%7 = select i1 %4, i32 %3, i32 %6
ret i32 %7
}
/* Variables and functions */
long double cosl(long double);
long double expl(long double);
long double f_derivative(long double x) {
  return -expl(-x / 5.0L) / -5.0L - cosl(x);
}


x86 assembly (clang, -O0):
<f_derivative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fchs
flds   0xec7(%rip)
fld    %st(0)
fstpt  -0x28(%rbp)
fdivrp %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <expl@plt>
fldt   -0x28(%rbp)
fdivrp %st,%st(1)
fstpt  -0x1c(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <cosl@plt>
fldt   -0x1c(%rbp)
fsubp  %st,%st(1)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_derivative>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x1c(%rsp)
fdivs  0xecc(%rip)
fstpt  (%rsp)
call   1040 <expl@plt>
fdivs  0xec2(%rip)
fstpt  0x10(%rsp)
fldt   0x1c(%rsp)
fstpt  (%rsp)
call   1030 <cosl@plt>
fldt   0x10(%rsp)
fsubp  %st,%st(1)
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @f_derivative(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fneg x86_fp80 %3
%5 = fdiv x86_fp80 %4, 0xK4001A000000000000000
%6 = call x86_fp80 @expl(x86_fp80 %5)
%7 = fneg x86_fp80 %6
%8 = fdiv x86_fp80 %7, 0xKC001A000000000000000
%9 = load x86_fp80, x86_fp80* %2
%10 = call x86_fp80 @cosl(x86_fp80 %9)
%11 = fsub x86_fp80 %8, %10
ret x86_fp80 %11
}

LLVM IR (-O2):
define x86_fp80 @f_derivative(x86_fp80 %0) {
%2 = fdiv x86_fp80 %0, 0xKC001A000000000000000
%3 = tail call x86_fp80 @expl(x86_fp80 %2)
%4 = fdiv x86_fp80 %3, 0xK4001A000000000000000
%5 = tail call x86_fp80 @cosl(x86_fp80 %0)
%6 = fsub x86_fp80 %4, %5
ret x86_fp80 %6
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned long f6(unsigned long x,
                                              unsigned long y) {
  unsigned long r = x + y;
  if (r < y)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1141 <f6+0x31>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
push   %rbx
mov    %rdi,%rbx
add    %rsi,%rbx
jae    1120 <f6+0x10>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @f6(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = icmp ult i64 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i32 0)
br label %7
7: ; preds = %5, %2
ret i64 %3
}