xunge/DecIR huggingface dataset:
int calc_aica_pan(int x) {
  if (x == 0x80)
    return 0;
  else if (x < 0x80) {
    return 0x10 | ((0x7f - x) >> 3);
  } else {
    return (x - 0x80) >> 3;
  }
}


x86 assembly (clang, -O0):
<calc_aica_pan>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jne    1120 <calc_aica_pan+0x20>
movl   $0x0,-0x4(%rbp)
jmp    1151 <calc_aica_pan+0x51>
cmpl   $0x80,-0x8(%rbp)
jge    1143 <calc_aica_pan+0x43>
mov    $0x7f,%eax
sub    -0x8(%rbp),%eax
sar    $0x3,%eax
or     $0x10,%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <calc_aica_pan+0x51>
mov    -0x8(%rbp),%eax
sub    $0x80,%eax
sar    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_aica_pan>:
xor    %eax,%eax
cmp    $0x80,%edi
je     1122 <calc_aica_pan+0x22>
jge    111a <calc_aica_pan+0x1a>
mov    $0x7f,%eax
sub    %edi,%eax
shr    $0x3,%eax
or     $0x10,%eax
ret
add    $0xffffff80,%edi
shr    $0x3,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @calc_aica_pan(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 128
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %19
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 128
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %3
%12 = sub nsw i32 127, %11
%13 = ashr i32 %12, 3
%14 = or i32 16, %13
store i32 %14, i32* %2
br label %19
15: ; preds = %7
%16 = load i32, i32* %3
%17 = sub nsw i32 %16, 128
%18 = ashr i32 %17, 3
store i32 %18, i32* %2
br label %19
19: ; preds = %15, %10, %6
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @calc_aica_pan(i32 %0) {
%2 = icmp eq i32 %0, 128
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, 128
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = sub nsw i32 127, %0
%7 = lshr i32 %6, 3
%8 = or i32 %7, 16
br label %12
9: ; preds = %3
%10 = add nsw i32 %0, -128
%11 = lshr i32 %10, 3
br label %12
12: ; preds = %1, %9, %5
%13 = phi i32 [ %8, %5 ], [ %11, %9 ], [ 0, %1 ]
ret i32 %13
}
int test_imm_AAuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xAA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_AAuint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0xaa,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_AAuint64_midword_reg>:
test   $0xaa0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_AAuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 11141120
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void getClientTypeName(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               74, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<getClientTypeName>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4a,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getClientTypeName>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x4a,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.getClientTypeName = [18 x i8] c"getClientTypeName\00"
define void @getClientTypeName() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 74, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.getClientTypeName, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.getClientTypeName = [18 x i8] c"getClientTypeName\00"
define void @getClientTypeName() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 74, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.getClientTypeName, i64 0, i64 0))
ret void
}
int test_imm_E5int16_mem(short *val) {
  return ((*val) & (0xE5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E5int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xe5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E5int16_mem>:
testb  $0xe5,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E5int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 229
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int WMax(int w1, int w2) { return w1 > w2 ? w1 : w2; }


x86 assembly (clang, -O0):
<WMax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <WMax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <WMax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<WMax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @WMax(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @WMax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
int main() {
  if (fork() == 0) {
    sleep(3);
    exit(0);
  }
  sleep(10);
  wait(NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <fork@plt>
cmp    $0x0,%rax
jne    1166 <main+0x26>
mov    $0x3,%edi
call   1040 <sleep@plt>
xor    %edi,%edi
call   1030 <exit@plt>
mov    $0xa,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <wait@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
je     1162 <main+0x22>
mov    $0xa,%edi
call   1040 <sleep@plt>
xor    %edi,%edi
call   1050 <wait@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x3,%edi
call   1040 <sleep@plt>
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 @sleep(i32 3)
%5 = call i32 @exit(i32 0)
unreachable
6: ; preds = %0
%7 = call i32 @sleep(i32 10)
%8 = call i32 @wait(i32* null)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @sleep(i32 3)
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %0
%7 = tail call i32 @sleep(i32 10)
%8 = tail call i32 @wait(i32* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, long);
void stringPushBackInt(char *str, long num) {
  sprintf(str, "%s %ld", str, num);
}


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

x86 assembly (clang, -O2):
<stringPushBackInt>:
mov    %rsi,%rcx
lea    0xee6(%rip),%rsi
mov    %rdi,%rdx
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s %ld\00"
define void @stringPushBackInt(i8* %0, i64 %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
ret void
}
void of_alias_scan(void) {}


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

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

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

LLVM IR (-O2):
define void @of_alias_scan() {
ret void
}
/* Variables and functions */
double __nv_atan(double);
double atan(double __a) { return __nv_atan(__a); }


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

x86 assembly (clang, -O2):
<atan>:
jmp    1030 <__nv_atan@plt>

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

LLVM IR (-O2):
define double @atan(double %0) {
%2 = tail call double @__nv_atan(double %0)
ret double %2
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t return_int64_5() { return 1073741824; }


x86 assembly (clang, -O0):
<return_int64_5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40000000,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @return_int64_5() {
ret i32 1073741824
}

LLVM IR (-O2):
define i32 @return_int64_5() {
ret i32 1073741824
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read_memory(int *, int *, int *, int);
void manage_child(int *buffer, int *in, int *out, int semid) {
  printf("Child process (PID %d)\n", getpid());
  read_memory(buffer, in, out, semid);
  printf("Child: memory has been totally consumed.\n");
}


x86 assembly (clang, -O0):
<manage_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1050 <read_memory@plt>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<manage_child>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xe9f(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1060 <read_memory@plt>
lea    0xe96(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Child process (PID %d)\0A\00"
@.str.1 = [42 x i8] c"Child: memory has been totally consumed.\0A\00"
define void @manage_child(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 = call i32 (...) @getpid()
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32*, i32** %5
%12 = load i32*, i32** %6
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = call i32 @read_memory(i32* %11, i32* %12, i32* %13, i32 %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Child process (PID %d)\0A\00"
@str = [41 x i8] c"Child: memory has been totally consumed.\00"
define void @manage_child(i32* %0, i32* %1, i32* %2, i32 %3) {
%5 = tail call i32 (...) @getpid()
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @read_memory(i32* %0, i32* %1, i32* %2, i32 %3)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ codedvalue;

/* Variables and functions */
int /*<<< orphan*/ BigInfo_SetValueForKey(char *, char const *, char *);
int /*<<< orphan*/ Info_Encode(char const *, int, char *, int);
void BigInfo_SetEncodedValueForKey(char *s, const char *key, const char *value,
                                   int len) {
  char codedvalue[8192];
  Info_Encode(value, len, codedvalue, sizeof(codedvalue));
  BigInfo_SetValueForKey(s, key, codedvalue);
}


x86 assembly (clang, -O0):
<BigInfo_SetEncodedValueForKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2020,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
lea    -0x2020(%rbp),%rdx
mov    $0x2000,%ecx
call   1030 <Info_Encode@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x2020(%rbp),%rdx
call   1040 <BigInfo_SetValueForKey@plt>
add    $0x2020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BigInfo_SetEncodedValueForKey>:
push   %r15
push   %r14
push   %rbx
sub    $0x2000,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %rdx,%rdi
mov    %ecx,%esi
mov    %r15,%rdx
mov    $0x2000,%ecx
call   1030 <Info_Encode@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <BigInfo_SetValueForKey@plt>
add    $0x2000,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @BigInfo_SetEncodedValueForKey(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [8192 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = getelementptr inbounds [8192 x i8], [8192 x i8]* %9, i64 0, i64 0
%13 = call i32 @Info_Encode(i8* %10, i32 %11, i8* %12, i32 8192)
%14 = load i8*, i8** %5
%15 = load i8*, i8** %6
%16 = getelementptr inbounds [8192 x i8], [8192 x i8]* %9, i64 0, i64 0
%17 = call i32 @BigInfo_SetValueForKey(i8* %14, i8* %15, i8* %16)
ret void
}

LLVM IR (-O2):
define void @BigInfo_SetEncodedValueForKey(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca [8192 x i8]
%6 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%7 = call i32 @Info_Encode(i8* %2, i32 %3, i8* %6, i32 8192)
%8 = call i32 @BigInfo_SetValueForKey(i8* %0, i8* %1, i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *mfree(void *ptr) {
  free(ptr);
  return (void *)0;
}


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

x86 assembly (clang, -O2):
<mfree>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias i8* @mfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i8* null
}
void __assert(const char *exp, const char *file, const char *func, int line) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<__assert>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
jmp    1113 <__assert+0x13>

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

LLVM IR (-O0):
define void @__assert(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
br label %9
9: ; preds = %9, %4
br label %9
}

LLVM IR (-O2):
define void @__assert(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i32 %3) {
br label %5
5: ; preds = %5, %4
br label %5
}
void init(void) {
  *((volatile unsigned int *)0xfffff400) =
      (0x00000001 | 0x00000002 | 0x00000004 | 0x00000008) |
      (0x00000010 | 0x00000020) |
      (0x00000800 | 0x00001000 | 0x00002000 | 0x00004000);
  *((volatile unsigned int *)0xfffff410) =
      (0x00000001 | 0x00000002 | 0x00000004 | 0x00000008);
  *((volatile unsigned int *)0xfffff414) =
      (0x00000010 | 0x00000020) |
      (0x00000800 | 0x00001000 | 0x00002000 | 0x00004000);
  *((volatile unsigned int *)0xfffffc10) = 0x04;
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffff400,%eax
movl   $0x783f,(%rax)
mov    $0xfffff410,%eax
movl   $0xf,(%rax)
mov    $0xfffff414,%eax
movl   $0x7830,(%rax)
mov    $0xfffffc10,%eax
movl   $0x4,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
mov    $0xfffff400,%eax
movl   $0x783f,(%rax)
movl   $0xf,0x10(%rax)
movl   $0x7830,0x14(%rax)
movl   $0x4,0x810(%rax)
ret

LLVM IR (-O0):
define void @init() {
store volatile i32 30783, i32* inttoptr (i64 4294964224 to i32*)
store volatile i32 15, i32* inttoptr (i64 4294964240 to i32*)
store volatile i32 30768, i32* inttoptr (i64 4294964244 to i32*)
store volatile i32 4, i32* inttoptr (i64 4294966288 to i32*)
ret void
}

LLVM IR (-O2):
define void @init() {
store volatile i32 30783, i32* inttoptr (i64 4294964224 to i32*)
store volatile i32 15, i32* inttoptr (i64 4294964240 to i32*)
store volatile i32 30768, i32* inttoptr (i64 4294964244 to i32*)
store volatile i32 4, i32* inttoptr (i64 4294966288 to i32*)
ret void
}
void end(void) {}


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

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

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

LLVM IR (-O2):
define void @end() {
ret void
}
void setutent(void) {}


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

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

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

LLVM IR (-O2):
define void @setutent() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_set_buffer_attr() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_set_buffer_attr"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_stream_set_buffer_attr\00"
define i32 @pa_stream_set_buffer_attr() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int parse_config_file(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (argc != 2) {
    fprintf(stderr, "usage: %s [configfile]\n", argv[0]);
    exit(1);
  }
  int ret = parse_config_file(argv[1]);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1176 <main+0x46>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <parse_config_file@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1140 <main+0x10>
mov    0x8(%rsi),%rdi
pop    %rax
jmp    1050 <parse_config_file@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xead(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"usage: %s [configfile]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %16
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @parse_config_file(i8* %19)
store i32 %20, i32* %6
%21 = load i32, i32* %6
ret i32 %21
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"usage: %s [configfile]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @parse_config_file(i8* %11)
ret i32 %12
}
int _kill(int pid, int sig) {
  (void)pid;
  (void)sig;
  return -1;
}


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

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

LLVM IR (-O0):
define i32 @_kill(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
ret i32 -1
}

LLVM IR (-O2):
define i32 @_kill(i32 %0, i32 %1) {
ret i32 -1
}
double my_pow(double x, int y) {
  double ans = 1;
  while (y-- > 0)
    ans *= x;
  return ans;
}


x86 assembly (clang, -O0):
<my_pow>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    1141 <my_pow+0x41>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1119 <my_pow+0x19>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pow>:
test   %edi,%edi
jle    1134 <my_pow+0x34>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
je     113d <my_pow+0x3d>
xor    %edx,%edx
movsd  0xee8(%rip),%xmm1
nopl   0x0(%rax,%rax,1)
mulsd  %xmm0,%xmm1
add    $0x1,%edx
cmp    %edx,%ecx
jne    1120 <my_pow+0x20>
sub    %edx,%edi
cmp    $0x7,%eax
jae    114a <my_pow+0x4a>
jmp    1178 <my_pow+0x78>
movsd  0xec4(%rip),%xmm0
ret
movsd  0xebb(%rip),%xmm1
cmp    $0x7,%eax
jb     1178 <my_pow+0x78>
add    $0xffffffff,%edi
nopl   (%rax)
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
add    $0xfffffff8,%edi
cmp    $0xfffffffe,%edi
jb     1150 <my_pow+0x50>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @my_pow(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
store double 1.000000e+00, double* %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %4
%8 = add nsw i32 %7, -1
store i32 %8, i32* %4
%9 = icmp sgt i32 %7, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load double, double* %3
%12 = load double, double* %5
%13 = fmul double %12, %11
store double %13, double* %5
br label %6
14: ; preds = %6
%15 = load double, double* %5
ret double %15
}

LLVM IR (-O2):
define double @my_pow(double %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %35
4: ; preds = %2
%5 = add i32 %1, -1
%6 = and i32 %1, 7
%7 = icmp eq i32 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %4, %8
%9 = phi double [ %13, %8 ], [ 1.000000e+00, %4 ]
%10 = phi i32 [ %12, %8 ], [ %1, %4 ]
%11 = phi i32 [ %14, %8 ], [ 0, %4 ]
%12 = add nsw i32 %10, -1
%13 = fmul double %9, %0
%14 = add i32 %11, 1
%15 = icmp eq i32 %14, %6
br i1 %15, label %16, label %8
16: ; preds = %8, %4
%17 = phi double [ 1.000000e+00, %4 ], [ %13, %8 ]
%18 = phi i32 [ %1, %4 ], [ %12, %8 ]
%19 = phi double [ undef, %4 ], [ %13, %8 ]
%20 = icmp ult i32 %5, 7
br i1 %20, label %35, label %21
21: ; preds = %16, %21
%22 = phi double [ %32, %21 ], [ %17, %16 ]
%23 = phi i32 [ %31, %21 ], [ %18, %16 ]
%24 = fmul double %22, %0
%25 = fmul double %24, %0
%26 = fmul double %25, %0
%27 = fmul double %26, %0
%28 = fmul double %27, %0
%29 = fmul double %28, %0
%30 = fmul double %29, %0
%31 = add nsw i32 %23, -8
%32 = fmul double %30, %0
%33 = add i32 %23, -9
%34 = icmp ult i32 %33, -2
br i1 %34, label %21, label %35
35: ; preds = %16, %21, %2
%36 = phi double [ 1.000000e+00, %2 ], [ %19, %16 ], [ %32, %21 ]
ret double %36
}
/* Variables and functions */
int /*<<< orphan*/ abort_report(char *, char const *, ...);
scalar_t__ unlink(char const *);
void sunlink(const char *path) {
  if ((unlink(path)) < 0)
    (2 == 1) ? abort_report("Could not unlink %s", path, "")
             : abort_report("Could not unlink %s", path);
}


x86 assembly (clang, -O0):
<sunlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
jge    1151 <sunlink+0x31>
mov    -0x8(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <abort_report@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sunlink>:
push   %rbx
mov    %rdi,%rbx
call   1030 <unlink@plt>
test   %rax,%rax
js     1130 <sunlink+0x10>
pop    %rbx
ret
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <abort_report@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Could not unlink %s\00"
define void @sunlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @unlink(i8* %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 (i8*, i8*, ...) @abort_report(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Could not unlink %s\00"
define void @sunlink(i8* %0) {
%2 = tail call i64 @unlink(i8* %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, i8*, ...) @abort_report(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret void
}
int updateAcpiFan() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @updateAcpiFan() {
ret i32 0
}
char *strlwr(char *s) {
  char c;
  char *s0;
  s0 = s;
  while (c = *s) {
    *s = ((((c) >= 'A') && ((c) <= 'Z')) ? (c) + '\x20' : (c));
    s += 1;
  }
  return s0;
}


x86 assembly (clang, -O0):
<strlwr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
je     116d <strlwr+0x6d>
movsbl -0x9(%rbp),%eax
cmp    $0x41,%eax
jl     114a <strlwr+0x4a>
movsbl -0x9(%rbp),%eax
cmp    $0x5a,%eax
jg     114a <strlwr+0x4a>
movsbl -0x9(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x1c(%rbp)
jmp    1151 <strlwr+0x51>
movsbl -0x9(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <strlwr+0x10>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr>:
mov    %rdi,%rax
mov    (%rdi),%dl
test   %dl,%dl
je     1133 <strlwr+0x33>
lea    0x1(%rax),%rcx
nopl   (%rax)
lea    -0x41(%rdx),%esi
lea    0x20(%rdx),%edi
cmp    $0x1a,%sil
movzbl %dl,%edx
movzbl %dil,%esi
cmovae %edx,%esi
mov    %sil,-0x1(%rcx)
movzbl (%rcx),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strlwr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strlwr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
%9 = add i8 %5, 32
%10 = select i1 %8, i8 %9, i8 %5
store i8 %10, i8* %6
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
ret i8* %0
}
void swap(char *p1, char *p2) {
  char temp = *p1;
  *p1 = *p2;
  *p2 = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Variables and functions */
unsigned short const __arch__swab16(unsigned short);
const unsigned short __fswab16(unsigned short x) { return __arch__swab16(x); }


x86 assembly (clang, -O0):
<__fswab16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <__arch__swab16@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fswab16>:
jmp    1030 <__arch__swab16@plt>

LLVM IR (-O0):
define zeroext i16 @__fswab16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call zeroext i16 @__arch__swab16(i16 zeroext %3)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @__fswab16(i16 zeroext %0) {
%2 = tail call zeroext i16 @__arch__swab16(i16 zeroext %0)
ret i16 %2
}
/* Variables and functions */
unsigned int ic_string_destroy(void *, unsigned int);
unsigned int string_shim(void *str, unsigned int free) {
  return ic_string_destroy(str, free);
}


x86 assembly (clang, -O0):
<string_shim>:
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 <ic_string_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_shim>:
jmp    1030 <ic_string_destroy@plt>

LLVM IR (-O0):
define i32 @string_shim(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 @ic_string_destroy(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @string_shim(i8* %0, i32 %1) {
%3 = tail call i32 @ic_string_destroy(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
void *realloc(void *, unsigned int);
void *heapRealloc(void *userData, void *ptr, unsigned int size) {
  return realloc(ptr, size);
}


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

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

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

LLVM IR (-O2):
define i8* @heapRealloc(i8* nocapture readnone %0, i8* %1, i32 %2) {
%4 = tail call i8* @realloc(i8* %1, i32 %2)
ret i8* %4
}
/* Type definitions */
typedef unsigned int uint8_t;

/* Variables and functions */
unsigned int bytestream_get_byte(const uint8_t **b) {
  (*b) += 1;
  return (((const uint8_t *)(*b - 1))[0]);
}


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

x86 assembly (clang, -O2):
<bytestream_get_byte>:
mov    (%rdi),%rax
lea    0x4(%rax),%rcx
mov    %rcx,(%rdi)
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
define i32 @bytestream_get_byte(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = getelementptr inbounds i32, i32* %2, i64 1
store i32* %3, i32** %0
%4 = load i32, i32* %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ replace_piece(char *, char, char *, int);
void replace_field_with_new_value(char *input_buffer, char *new_value,
                                  int field_offset) {
  replace_piece(input_buffer, '|', new_value, field_offset);
}


x86 assembly (clang, -O0):
<replace_field_with_new_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x7c,%esi
call   1030 <replace_piece@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_field_with_new_value>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0x7c,%esi
jmp    1030 <replace_piece@plt>

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

LLVM IR (-O2):
define void @replace_field_with_new_value(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @replace_piece(i8* %0, i8 signext 124, i8* %1, i32 %2)
ret void
}
double dot4(const int *g, double x, double y, double z, double w) {
  return g[0] * x + g[1] * y + g[2] * z + g[3] * w;
}


x86 assembly (clang, -O0):
<dot4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
movsd  -0x10(%rbp),%xmm2
mov    -0x8(%rbp),%rax
cvtsi2sdl 0x4(%rax),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
cvtsi2sdl 0x8(%rax),%xmm1
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
cvtsi2sdl 0xc(%rax),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot4>:
cvtsi2sdl (%rdi),%xmm4
cvtsi2sdl 0x4(%rdi),%xmm5
mulsd  %xmm1,%xmm5
mulsd  %xmm4,%xmm0
addsd  %xmm5,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0x8(%rdi),%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0xc(%rdi),%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dot4(i32* %0, double %1, double %2, double %3, double %4) {
%6 = alloca i32*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store i32* %0, i32** %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load i32*, i32** %6
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = sitofp i32 %13 to double
%15 = load double, double* %7
%16 = load i32*, i32** %6
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32, i32* %17
%19 = sitofp i32 %18 to double
%20 = load double, double* %8
%21 = fmul double %19, %20
%22 = call double @llvm.fmuladd.f64(double %14, double %15, double %21)
%23 = load i32*, i32** %6
%24 = getelementptr inbounds i32, i32* %23, i64 2
%25 = load i32, i32* %24
%26 = sitofp i32 %25 to double
%27 = load double, double* %9
%28 = call double @llvm.fmuladd.f64(double %26, double %27, double %22)
%29 = load i32*, i32** %6
%30 = getelementptr inbounds i32, i32* %29, i64 3
%31 = load i32, i32* %30
%32 = sitofp i32 %31 to double
%33 = load double, double* %10
%34 = call double @llvm.fmuladd.f64(double %32, double %33, double %28)
ret double %34
}

LLVM IR (-O2):
define double @dot4(i32* nocapture %0, double %1, double %2, double %3, double %4) {
%6 = load i32, i32* %0
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to double
%11 = fmul double %10, %2
%12 = tail call double @llvm.fmuladd.f64(double %7, double %1, double %11)
%13 = getelementptr inbounds i32, i32* %0, i64 2
%14 = load i32, i32* %13
%15 = sitofp i32 %14 to double
%16 = tail call double @llvm.fmuladd.f64(double %15, double %3, double %12)
%17 = getelementptr inbounds i32, i32* %0, i64 3
%18 = load i32, i32* %17
%19 = sitofp i32 %18 to double
%20 = tail call double @llvm.fmuladd.f64(double %19, double %4, double %16)
ret double %20
}
/* Variables and functions */
int /*<<< orphan*/ MCUSendCmdGPSCtrl(int);
void MCUSendCmdGPSCtrlDisable() { MCUSendCmdGPSCtrl(1); }


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

x86 assembly (clang, -O2):
<MCUSendCmdGPSCtrlDisable>:
mov    $0x1,%edi
jmp    1030 <MCUSendCmdGPSCtrl@plt>

LLVM IR (-O0):
define void @MCUSendCmdGPSCtrlDisable() {
%1 = call i32 @MCUSendCmdGPSCtrl(i32 1)
ret void
}

LLVM IR (-O2):
define void @MCUSendCmdGPSCtrlDisable() {
%1 = tail call i32 @MCUSendCmdGPSCtrl(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ take_coin_10_returns_10(int *);
int /*<<< orphan*/ take_coin_15_returns_0(int *);
int /*<<< orphan*/ take_coin_empty_returns_neg1(int *);
void take_coin_tests(int stats[3]) {
  printf("Testing taking coins:\n");
  take_coin_10_returns_10(stats);
  take_coin_15_returns_0(stats);
  take_coin_empty_returns_neg1(stats);
  printf("\n");
}


x86 assembly (clang, -O0):
<take_coin_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <take_coin_10_returns_10@plt>
mov    -0x8(%rbp),%rdi
call   1030 <take_coin_15_returns_0@plt>
mov    -0x8(%rbp),%rdi
call   1050 <take_coin_empty_returns_neg1@plt>
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<take_coin_tests>:
push   %rbx
mov    %rdi,%rbx
lea    0xea5(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1070 <take_coin_10_returns_10@plt>
mov    %rbx,%rdi
call   1050 <take_coin_15_returns_0@plt>
mov    %rbx,%rdi
call   1060 <take_coin_empty_returns_neg1@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Testing taking coins:\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @take_coin_tests(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = call i32 @take_coin_10_returns_10(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @take_coin_15_returns_0(i32* %6)
%8 = load i32*, i32** %2
%9 = call i32 @take_coin_empty_returns_neg1(i32* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"Testing taking coins:\00"
define void @take_coin_tests(i32* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @take_coin_10_returns_10(i32* %0)
%4 = tail call i32 @take_coin_15_returns_0(i32* %0)
%5 = tail call i32 @take_coin_empty_returns_neg1(i32* %0)
%6 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ queue(int);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int n;
  printf("ÊäÈë»Êºó¸öÊýn:\n");
  scanf("%d", &n);
  queue(n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1040 <queue@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <queue@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\C3\8A\C3\A4\C3\88\C3\AB\C2\BB\C3\8A\C2\BA\C3\B3\C2\B8\C3\B6\C3\8A\C3\BDn:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 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), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @queue(i32 %4)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [27 x i8] c"\C3\8A\C3\A4\C3\88\C3\AB\C2\BB\C3\8A\C2\BA\C3\B3\C2\B8\C3\B6\C3\8A\C3\BDn:\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 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), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @queue(i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ MEVENT;

/* Variables and functions */
int getmouse(int /*<<< orphan*/ *);
int ncurses_getmouse(MEVENT *me) { return getmouse(me); }


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

x86 assembly (clang, -O2):
<ncurses_getmouse>:
jmp    1030 <getmouse@plt>

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

LLVM IR (-O2):
define i32 @ncurses_getmouse(i32* %0) {
%2 = tail call i32 @getmouse(i32* %0)
ret i32 %2
}
/* Variables and functions */
void *kmalloc(size_t);
void *memset(void *, int /*<<< orphan*/, size_t);
void *kcalloc(size_t nmemb, size_t nbytes) {
  void *mem;
  if (!(mem = kmalloc(nmemb * nbytes))) {
    return NULL;
  }
  return memset(mem, 0, nmemb * nbytes);
}


x86 assembly (clang, -O0):
<kcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
call   1040 <kmalloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1159 <kcalloc+0x39>
movq   $0x0,-0x8(%rbp)
jmp    1179 <kcalloc+0x59>
mov    -0x20(%rbp),%rdi
mov    %rdi,-0x28(%rbp)
mov    -0x10(%rbp),%rdx
imul   -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <kmalloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <kcalloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @kcalloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @kmalloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %2
tail call void @llvm.memset.p0i8.i64(i8* align 1 %4, i8 0, i64 %3, i1 false)
br label %7
7: ; preds = %2, %6
ret i8* %4
}