xunge/DecIR huggingface dataset:
/* Type definitions */
struct dirent {
  int dummy;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int ENOSYS;
int /*<<< orphan*/ __set_errno(int);
int __readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) {
  __set_errno(ENOSYS);
  *result = NULL;
  return ENOSYS;
}


x86 assembly (clang, -O0):
<__readdir_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__readdir_r>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    0x2eca(%rip),%r14
mov    (%r14),%edi
call   1030 <__set_errno@plt>
movq   $0x0,(%rbx)
mov    (%r14),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
@ENOSYS = global i32 0
define i32 @__readdir_r(i32* %0, %struct.dirent* %1, %struct.dirent** %2) {
%4 = alloca i32*
%5 = alloca %struct.dirent*
%6 = alloca %struct.dirent**
store i32* %0, i32** %4
store %struct.dirent* %1, %struct.dirent** %5
store %struct.dirent** %2, %struct.dirent*** %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
%9 = load %struct.dirent**, %struct.dirent*** %6
store %struct.dirent* null, %struct.dirent** %9
%10 = load i32, i32* @ENOSYS
ret i32 %10
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@ENOSYS = global i32 0
define i32 @__readdir_r(i32* nocapture readnone %0, %struct.dirent* nocapture readnone %1, %struct.dirent** nocapture writeonly %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
store %struct.dirent* null, %struct.dirent** %2
%6 = load i32, i32* @ENOSYS
ret i32 %6
}
/* Variables and functions */
double sin(double);
double SineEaseOut(double p) {
  return sin(p * 3.14159265358979323846264338327 / 2);
}


x86 assembly (clang, -O0):
<SineEaseOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SineEaseOut>:
mulsd  0xee8(%rip),%xmm0
mulsd  0xee8(%rip),%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @SineEaseOut(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x400921FB54442D18
%5 = fdiv double %4, 2.000000e+00
%6 = call double @sin(double %5)
ret double %6
}

LLVM IR (-O2):
define double @SineEaseOut(double %0) {
%2 = fmul double %0, 0x400921FB54442D18
%3 = fmul double %2, 5.000000e-01
%4 = tail call double @sin(double %3)
ret double %4
}
void abort(void) { asm("hlt"); }


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
hlt

x86 assembly (clang, -O2):
<abort>:
hlt

LLVM IR (-O0):
define void @abort() {
unreachable
}

LLVM IR (-O2):
define void @abort() {
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int);
int main() { syscall(0x41414141); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x41414141,%edi
call   1030 <syscall@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x41414141,%edi
call   1030 <syscall@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @syscall(i32 1094795585)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @syscall(i32 1094795585)
ret i32 0
}
/* Variables and functions */
scalar_t__ is_end_of_line(char);
bool is_whitespace(char c) {
  return ((c == ' ') || (c == '\t') || is_end_of_line(c));
}


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1155 <is_whitespace+0x45>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     1155 <is_whitespace+0x45>
movsbl -0x1(%rbp),%edi
call   1030 <is_end_of_line@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
mov    $0x1,%eax
cmp    $0x9,%dil
je     1121 <is_whitespace+0x11>
cmp    $0x20,%dil
jne    1122 <is_whitespace+0x12>
ret
push   %rax
movsbl %dil,%edi
call   1030 <is_end_of_line@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @is_whitespace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = call i64 @is_end_of_line(i8 signext %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %6
i8 9, label %6
]
2: ; preds = %1
%3 = tail call i64 @is_end_of_line(i8 signext %0)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %1, %1, %2
%7 = phi i32 [ 1, %1 ], [ %5, %2 ], [ 1, %1 ]
ret i32 %7
}
unsigned int startV86(unsigned char *path) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @startV86(i8* nocapture readnone %0) {
ret i32 0
}
void test_add_fixit_insert_formatted_multiline(void) {
  if (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @test_add_fixit_insert_formatted_multiline() {
ret void
}
void b_speaker_off(void) { asm volatile("call 0x00100058"); }


x86 assembly (clang, -O0):
<b_speaker_off>:
push   %rbp
mov    %rsp,%rbp
call   100058 <completed.0+0xfc038>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_speaker_off>:
call   100058 <completed.0+0xfc038>
ret

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

LLVM IR (-O2):
define void @b_speaker_off() {
tail call void asm sideeffect "call 0x00100058", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a;
  a = 1 + 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 3, i32* %1
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
void example4(void) {
  int array1[5];
  int *ptr = &array1;
  int *end = &(array1[5]);
  while (ptr <= end) {
    *ptr = 42;
    assert(*ptr == 42);
    ptr++;
  }
}


x86 assembly (clang, -O0):
<example4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
ja     116b <example4+0x5b>
mov    -0x28(%rbp),%rax
movl   $0x2a,(%rax)
mov    -0x28(%rbp),%rax
cmpl   $0x2a,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
jmp    112c <example4+0x1c>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<example4>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsp,%rbx
lea    0x14(%rsp),%r14
nop
movl   $0x2a,(%rbx)
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
add    $0x4,%rbx
cmp    %r14,%rbx
jbe    1120 <example4+0x10>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @example4() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 5
br label %5
5: ; preds = %0, %5
%6 = phi i32* [ %3, %0 ], [ %8, %5 ]
store i32 42, i32* %6
%7 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = icmp ugt i32* %8, %4
br i1 %9, label %10, label %5
10: ; preds = %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ av_free(void *);
void av_freep(void *arg) {
  void **ptr = (void **)arg;
  av_free(*ptr);
  *ptr = NULL;
}


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

x86 assembly (clang, -O2):
<av_freep>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <av_free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @av_freep(i8* %0) {
%2 = alloca i8*
%3 = alloca i8**
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i8**
store i8** %5, i8*** %3
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = call i32 @av_free(i8* %7)
%9 = load i8**, i8*** %3
store i8* null, i8** %9
ret void
}

LLVM IR (-O2):
define void @av_freep(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @av_free(i8* %3)
store i8* null, i8** %2
ret void
}
int Object_init(void *self) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @Object_init(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_get_sessions(char ***sessions) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_get_sessions>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_get_sessions>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_get_sessions(i8*** %0) {
%2 = alloca i8***
store i8*** %0, i8**** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_get_sessions(i8*** nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int stringmatchlen(char const *, int, char const *, int, int);
int strlen(char const *);
int stringmatch(const char *pattern, const char *string, int nocase) {
  int patternLen = strlen(pattern);
  int stringLen = strlen(string);
  return stringmatchlen(pattern, patternLen, string, stringLen, nocase);
}


x86 assembly (clang, -O0):
<stringmatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1040 <stringmatchlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringmatch>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1030 <strlen@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
mov    %r14d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <stringmatchlen@plt>

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

LLVM IR (-O2):
define i32 @stringmatch(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @strlen(i8* %1)
%6 = tail call i32 @stringmatchlen(i8* %0, i32 %4, i8* %1, i32 %5, i32 %2)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ const uint32_t;

/* Variables and functions */
uint32_t get_32(const uint8_t **pp) {
  const uint32_t v = *(const uint32_t *)(*pp);
  (*pp) += 4;
  return v;
}


x86 assembly (clang, -O0):
<get_32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x10,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_32>:
mov    (%rdi),%rcx
mov    (%rcx),%eax
add    $0x10,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i32 @get_32(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32**, i32*** %2
%8 = load i32*, i32** %7
%9 = getelementptr inbounds i32, i32* %8, i64 4
store i32* %9, i32** %7
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_32(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %2, i64 4
store i32* %4, i32** %0
ret i32 %3
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRC3_set(void) { return U_WMRCORENONE_set("U_WMRC3"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRC3\00"
define i8* @U_WMRC3_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRC3\00"
define i8* @U_WMRC3_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t load32_be(const uint8_t src[4]) {
  uint32_t w = (uint32_t)src[3];
  w |= (uint32_t)src[2] << 8;
  w |= (uint32_t)src[1] << 16;
  w |= (uint32_t)src[0] << 24;
  return w;
}


x86 assembly (clang, -O0):
<load32_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x18,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<load32_be>:
mov    0x10(%rdi),%ecx
shl    $0x8,%ecx
or     0x18(%rdi),%ecx
mov    (%rdi),%eax
mov    0x8(%rdi),%edx
shl    $0x10,%edx
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @load32_be(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = getelementptr inbounds i64, i64* %4, i64 3
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
%8 = load i64*, i64** %2
%9 = getelementptr inbounds i64, i64* %8, i64 2
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 8
%13 = load i32, i32* %3
%14 = or i32 %13, %12
store i32 %14, i32* %3
%15 = load i64*, i64** %2
%16 = getelementptr inbounds i64, i64* %15, i64 1
%17 = load i64, i64* %16
%18 = trunc i64 %17 to i32
%19 = shl i32 %18, 16
%20 = load i32, i32* %3
%21 = or i32 %20, %19
store i32 %21, i32* %3
%22 = load i64*, i64** %2
%23 = getelementptr inbounds i64, i64* %22, i64 0
%24 = load i64, i64* %23
%25 = trunc i64 %24 to i32
%26 = shl i32 %25, 24
%27 = load i32, i32* %3
%28 = or i32 %27, %26
store i32 %28, i32* %3
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @load32_be(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 3
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = getelementptr inbounds i64, i64* %0, i64 2
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i64, i64* %0, i64 1
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 16
%14 = or i32 %9, %13
%15 = load i64, i64* %0
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 24
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int read_int(int);
int get_max() {
  int fd = open("/sys/class/backlight/gmux_backlight/max_brightness", O_RDONLY);
  int max = read_int(fd);
  close(fd);
  return max;
}


x86 assembly (clang, -O0):
<get_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <read_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_max>:
push   %rbp
push   %rbx
push   %rax
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
lea    0xebd(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <read_int@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <close@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [51 x i8] c"/sys/class/backlight/gmux_backlight/max_brightness\00"
@O_RDONLY = global i32 0
define i32 @get_max() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @O_RDONLY
%4 = call i32 @open(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @read_int(i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %1
%8 = call i32 @close(i32 %7)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str = [51 x i8] c"/sys/class/backlight/gmux_backlight/max_brightness\00"
@O_RDONLY = global i32 0
define i32 @get_max() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @read_int(i32 %2)
%4 = tail call i32 @close(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ atmel_atmega8_PB5_toggle__E();
void pollen_hardware_Led_toggle__E() { atmel_atmega8_PB5_toggle__E(); }


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

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

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

LLVM IR (-O2):
define void @pollen_hardware_Led_toggle__E() {
%1 = tail call i32 (...) @atmel_atmega8_PB5_toggle__E()
ret void
}
/* Variables and functions */
int xtoi_eol(char const *, int /*<<< orphan*/);
int xtoi(const char *str) { return xtoi_eol(str, 0); }


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

x86 assembly (clang, -O2):
<xtoi>:
xor    %esi,%esi
jmp    1030 <xtoi_eol@plt>

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

LLVM IR (-O2):
define i32 @xtoi(i8* %0) {
%2 = tail call i32 @xtoi_eol(i8* %0, i32 0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int64_t;
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int /*<<< orphan*/ __get_unaligned_be64(int /*<<< orphan*/ const *);
u_int64_t get_unaligned_be64(const void *p) {
  return __get_unaligned_be64((const u_char *)p);
}


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

x86 assembly (clang, -O2):
<get_unaligned_be64>:
jmp    1030 <__get_unaligned_be64@plt>

LLVM IR (-O0):
define i32 @get_unaligned_be64(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @__get_unaligned_be64(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_unaligned_be64(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @__get_unaligned_be64(i32* %2)
ret i32 %3
}
/* Variables and functions */
char *leftTrim(int /*<<< orphan*/);
int /*<<< orphan*/ rightTrim(char *);
char *trim(char *str) { return leftTrim(rightTrim(str)); }


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <rightTrim@plt>
mov    %eax,%edi
call   1030 <leftTrim@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
push   %rax
call   1040 <rightTrim@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <leftTrim@plt>

LLVM IR (-O0):
define i8* @trim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @rightTrim(i8* %3)
%5 = call i8* @leftTrim(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @trim(i8* %0) {
%2 = tail call i32 @rightTrim(i8* %0)
%3 = tail call i8* @leftTrim(i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void print(long int x) { printf("%ld\n", x); }


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

x86 assembly (clang, -O2):
<print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define void @print(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
const char *ls_cost_nm4_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  case 1:
    return "i1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ls_cost_nm4_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <ls_cost_nm4_name_in+0x2b>
jmp    111a <ls_cost_nm4_name_in+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <ls_cost_nm4_name_in+0x3b>
jmp    114b <ls_cost_nm4_name_in+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_cost_nm4_name_in+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_cost_nm4_name_in+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm4_name_in>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @ls_cost_nm4_name_in(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @ls_cost_nm4_name_in(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
int score_state_pause(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @score_state_pause() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void check(unsigned x, unsigned y, unsigned w, unsigned h) {
  assert(x < w);
  assert(y < h);
  (void)x;
  (void)y;
  (void)w;
  (void)h;
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %esi,%ebp
xor    %eax,%eax
cmp    %edx,%edi
setb   %al
mov    %eax,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmp    %ebx,%ebp
setb   %dil
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @check(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = icmp ult i32 %9, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %6
%15 = load i32, i32* %8
%16 = icmp ult i32 %14, %15
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = load i32, i32* %8
ret void
}

LLVM IR (-O2):
define void @check(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp ult i32 %0, %2
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = icmp ult i32 %1, %3
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doNext(int);
int /*<<< orphan*/ printf(char *);
int main() {
  doNext(3);
  printf("\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1040 <doNext@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @doNext(i32 3)
%2 = tail call i32 @putchar(i32 10)
ret i32 0
}
long long str_len(const char *s) {
  long long i;
  for (i = 0; s[i]; ++i)
    ;
  return i;
}


x86 assembly (clang, -O0):
<str_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1138 <str_len+0x38>
jmp    1127 <str_len+0x27>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <str_len+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_len>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <str_len+0x10>
ret

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

LLVM IR (-O2):
define i64 @str_len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw nsw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
void _nos_wait(void) {
  __asm volatile("nop");
  __asm volatile("nop");
}


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

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

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

LLVM IR (-O2):
define void @_nos_wait() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int fwrite(char *, int, int, int /*<<< orphan*/ *);
int writeFile(const char *filename, char *data, int size) {
  FILE *f = fopen(filename, "wb");
  int written = fwrite(data, sizeof(char), size, f);
  fclose(f);
  return written;
}


x86 assembly (clang, -O0):
<writeFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fwrite@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeFile>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
lea    0xebf(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1030 <fclose@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"wb\00"
define i32 @writeFile(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %10, i32** %7
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = load i32*, i32** %7
%14 = call i32 @fwrite(i8* %11, i32 1, i32 %12, i32* %13)
store i32 %14, i32* %8
%15 = load i32*, i32** %7
%16 = call i32 @fclose(i32* %15)
%17 = load i32, i32* %8
ret i32 %17
}

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
define i32 @writeFile(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fwrite(i8* %1, i32 1, i32 %2, i32* %4)
%6 = tail call i32 @fclose(i32* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ round(double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double x;
  scanf("%lf", &x);
  printf("%d\n", (int)round(x * 5280 / 4.854));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xeb1(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xe9c(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1050 <round@plt>
mov    %eax,%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
mulsd  0xeb3(%rip),%xmm0
divsd  0xeb3(%rip),%xmm0
call   1050 <round@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%4 = load double, double* %2
%5 = fmul double %4, 5.280000e+03
%6 = fdiv double %5, 4.854000e+00
%7 = call i64 @round(double %6)
%8 = trunc i64 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, 5.280000e+03
%6 = fdiv double %5, 4.854000e+00
%7 = call i64 @round(double %6)
%8 = trunc i64 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
float ColorTableBlue(float c) {
  if (c < 0.33)
    return 1.0;
  if (c < 0.67)
    return 1.0 - (c - 0.33) / (0.67 - 0.33);
  return 0.0;
}


x86 assembly (clang, -O0):
<ColorTableBlue>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <ColorTableBlue+0x36>
movss  0xef4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1194 <ColorTableBlue+0x94>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec1(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    118c <ColorTableBlue+0x8c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe9e(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xeaa(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe96(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1194 <ColorTableBlue+0x94>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ColorTableBlue>:
cvtss2sd %xmm0,%xmm1
movsd  0xefc(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    111b <ColorTableBlue+0x1b>
movss  0xee6(%rip),%xmm0
ret
xorpd  %xmm0,%xmm0
movsd  0xee9(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    114c <ColorTableBlue+0x4c>
addsd  0xee3(%rip),%xmm1
divsd  0xee3(%rip),%xmm1
addsd  0xee3(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @ColorTableBlue(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp olt double %5, 3.300000e-01
br i1 %6, label %7, label %8
7: ; preds = %1
store float 1.000000e+00, float* %2
br label %20
8: ; preds = %1
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = fcmp olt double %10, 6.700000e-01
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = fsub double %14, 3.300000e-01
%16 = fdiv double %15, 3.400000e-01
%17 = fsub double 1.000000e+00, %16
%18 = fptrunc double %17 to float
store float %18, float* %2
br label %20
19: ; preds = %8
store float 0.000000e+00, float* %2
br label %20
20: ; preds = %19, %12, %7
%21 = load float, float* %2
ret float %21
}

LLVM IR (-O2):
define float @ColorTableBlue(float %0) {
%2 = fpext float %0 to double
%3 = fcmp olt double %2, 3.300000e-01
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = fcmp olt double %2, 6.700000e-01
br i1 %5, label %6, label %11
6: ; preds = %4
%7 = fadd double %2, -3.300000e-01
%8 = fdiv double %7, 3.400000e-01
%9 = fsub double 1.000000e+00, %8
%10 = fptrunc double %9 to float
br label %11
11: ; preds = %4, %1, %6
%12 = phi float [ %10, %6 ], [ 1.000000e+00, %1 ], [ 0.000000e+00, %4 ]
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x93() {
  Assert_real((isalpha(147) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              740, ("isalpha should be 0 for 0x93"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x93>:
push   %rbp
mov    %rsp,%rbp
mov    $0x93,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2e4,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x93>:
push   %rax
mov    $0x93,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2e4,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x93\00"
define void @t_isalpha_0x93() {
%1 = call i64 @isalpha(i32 147)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 740, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x93\00"
define void @t_isalpha_0x93() {
%1 = tail call i64 @isalpha(i32 147)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 740, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __print_float(float);
int main() {
  float a;
  a = 5.5;
  __print_float(a += 3.5);
  __print_float(a -= 4.2);
  __print_float(a *= 2.0);
  __print_float(a /= 1.2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xef9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xedb(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
call   1030 <__print_float@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb0(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
call   1030 <__print_float@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe85(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
call   1030 <__print_float@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe5a(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
call   1030 <__print_float@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xee7(%rip),%xmm0
call   1030 <__print_float@plt>
movss  0xede(%rip),%xmm0
call   1030 <__print_float@plt>
movss  0xed5(%rip),%xmm0
call   1030 <__print_float@plt>
movss  0xecc(%rip),%xmm0
call   1030 <__print_float@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 5.500000e+00, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fadd double %4, 3.500000e+00
%6 = fptrunc double %5 to float
store float %6, float* %2
%7 = call i32 @__print_float(float %6)
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = fsub double %9, 4.200000e+00
%11 = fptrunc double %10 to float
store float %11, float* %2
%12 = call i32 @__print_float(float %11)
%13 = load float, float* %2
%14 = fpext float %13 to double
%15 = fmul double %14, 2.000000e+00
%16 = fptrunc double %15 to float
store float %16, float* %2
%17 = call i32 @__print_float(float %16)
%18 = load float, float* %2
%19 = fpext float %18 to double
%20 = fdiv double %19, 1.200000e+00
%21 = fptrunc double %20 to float
store float %21, float* %2
%22 = call i32 @__print_float(float %21)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_float(float 9.000000e+00)
%2 = tail call i32 @__print_float(float 0x4013333340000000)
%3 = tail call i32 @__print_float(float 0x4023333340000000)
%4 = tail call i32 @__print_float(float 8.000000e+00)
ret i32 0
}
void byteorder_swap_pointer_16(unsigned char *p) {
  unsigned char c;
  c = p[1];
  p[1] = p[0];
  p[0] = c;
}


x86 assembly (clang, -O0):
<byteorder_swap_pointer_16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteorder_swap_pointer_16>:
rolw   $0x8,(%rdi)
ret

LLVM IR (-O0):
define void @byteorder_swap_pointer_16(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %9, i8* %11
%12 = load i8, i8* %3
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 %12, i8* %14
ret void
}

LLVM IR (-O2):
define void @byteorder_swap_pointer_16(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = load i8, i8* %0
store i8 %4, i8* %2
store i8 %3, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;
typedef int /*<<< orphan*/ idtype_t;
typedef int /*<<< orphan*/ id_t;

/* Variables and functions */
int __waitid(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *, int,
             int /*<<< orphan*/ *);
int waitid(idtype_t which, id_t id, siginfo_t *info, int options) {
  return __waitid(which, id, info, options, NULL);
}


x86 assembly (clang, -O0):
<waitid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <__waitid@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitid>:
xor    %r8d,%r8d
jmp    1030 <__waitid@plt>

LLVM IR (-O0):
define i32 @waitid(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32*, i32** %7
%12 = load i32, i32* %8
%13 = call i32 @__waitid(i32 %9, i32 %10, i32* %11, i32 %12, i32* null)
ret i32 %13
}

LLVM IR (-O2):
define i32 @waitid(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @__waitid(i32 %0, i32 %1, i32* %2, i32 %3, i32* null)
ret i32 %5
}
/* Variables and functions */
void *SSL_new(void *);
void *__ustream_ssl_session_new(void *ctx) { return SSL_new(ctx); }


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

x86 assembly (clang, -O2):
<__ustream_ssl_session_new>:
jmp    1030 <SSL_new@plt>

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

LLVM IR (-O2):
define i8* @__ustream_ssl_session_new(i8* %0) {
%2 = tail call i8* @SSL_new(i8* %0)
ret i8* %2
}
/* Variables and functions */
void *hmac_ctx_init(unsigned char *, int);
void *crypto_setup_mac_context(int mac, unsigned char *key, int keylen) {
  return hmac_ctx_init(key, keylen);
}


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

x86 assembly (clang, -O2):
<crypto_setup_mac_context>:
mov    %rsi,%rdi
mov    %edx,%esi
jmp    1030 <hmac_ctx_init@plt>

LLVM IR (-O0):
define i8* @crypto_setup_mac_context(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 i8*, i8** %5
%8 = load i32, i32* %6
%9 = call i8* @hmac_ctx_init(i8* %7, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @crypto_setup_mac_context(i32 %0, i8* %1, i32 %2) {
%4 = tail call i8* @hmac_ctx_init(i8* %1, i32 %2)
ret i8* %4
}