xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ is_str_equal(char const *, char const *);
int minitest_fail(char const *, char const *, int);
int minitest_pass(char const *);
int assert_str_equal(const char *expected, const char *actual, const char *msg,
                     const char *caller, int line) {
  if (is_str_equal(expected, actual)) {
    return minitest_fail(msg, caller, line);
  } else {
    return minitest_pass(msg);
  }
}


x86 assembly (clang, -O0):
<assert_str_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <is_str_equal@plt>
cmp    $0x0,%rax
je     117b <assert_str_equal+0x4b>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x2c(%rbp),%edx
call   1040 <minitest_fail@plt>
mov    %eax,-0x4(%rbp)
jmp    1187 <assert_str_equal+0x57>
mov    -0x20(%rbp),%rdi
call   1030 <minitest_pass@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_str_equal>:
push   %rbp
push   %r14
push   %rbx
mov    %r8d,%r14d
mov    %rcx,%rbx
mov    %rdx,%rbp
call   1050 <is_str_equal@plt>
mov    %rbp,%rdi
test   %rax,%rax
je     1159 <assert_str_equal+0x29>
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <minitest_fail@plt>
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <minitest_pass@plt>

LLVM IR (-O0):
define i32 @assert_str_equal(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = call i64 @is_str_equal(i8* %12, i8* %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %5
%17 = load i8*, i8** %9
%18 = load i8*, i8** %10
%19 = load i32, i32* %11
%20 = call i32 @minitest_fail(i8* %17, i8* %18, i32 %19)
store i32 %20, i32* %6
br label %24
21: ; preds = %5
%22 = load i8*, i8** %9
%23 = call i32 @minitest_pass(i8* %22)
store i32 %23, i32* %6
br label %24
24: ; preds = %21, %16
%25 = load i32, i32* %6
ret i32 %25
}

LLVM IR (-O2):
define i32 @assert_str_equal(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = tail call i64 @is_str_equal(i8* %0, i8* %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @minitest_fail(i8* %2, i8* %3, i32 %4)
br label %12
10: ; preds = %5
%11 = tail call i32 @minitest_pass(i8* %2)
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ LeftTrim(char *);
int /*<<< orphan*/ RightTrim(char *);
void Trim(char *str) {
  RightTrim(str);
  LeftTrim(str);
}


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

x86 assembly (clang, -O2):
<Trim>:
push   %rbx
mov    %rdi,%rbx
call   1030 <RightTrim@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <LeftTrim@plt>

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

LLVM IR (-O2):
define void @Trim(i8* %0) {
%2 = tail call i32 @RightTrim(i8* %0)
%3 = tail call i32 @LeftTrim(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ indigoFree(int);
int indigoSaveRxnfile(int, int);
int indigoWriteFile(char const *);
__attribute__((visibility("default"))) int
indigoSaveRxnfileToFile(int reaction, const char *filename) {
  int f = indigoWriteFile(filename);
  int res;
  if (f == -1)
    return -1;
  res = indigoSaveRxnfile(reaction, f);
  indigoFree(f);
  return res;
}


x86 assembly (clang, -O0):
<indigoSaveRxnfileToFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <indigoWriteFile@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1161 <indigoSaveRxnfileToFile+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <indigoSaveRxnfileToFile+0x4d>
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1050 <indigoSaveRxnfile@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <indigoFree@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indigoSaveRxnfileToFile>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <indigoWriteFile@plt>
cmp    $0xffffffff,%eax
je     115a <indigoSaveRxnfileToFile+0x2a>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <indigoSaveRxnfile@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <indigoFree@plt>
mov    %ebp,%eax
jmp    115f <indigoSaveRxnfileToFile+0x2f>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @indigoSaveRxnfileToFile(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
%8 = load i8*, i8** %5
%9 = call i32 @indigoWriteFile(i8* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %20
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i32, i32* %6
%16 = call i32 @indigoSaveRxnfile(i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32, i32* %6
%18 = call i32 @indigoFree(i32 %17)
%19 = load i32, i32* %7
store i32 %19, i32* %3
br label %20
20: ; preds = %13, %12
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @indigoSaveRxnfileToFile(i32 %0, i8* %1) {
%3 = tail call i32 @indigoWriteFile(i8* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @indigoSaveRxnfile(i32 %0, i32 %3)
%7 = tail call i32 @indigoFree(i32 %3)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %9
}
int execute_getresuid() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_getresuid() {
ret i32 0
}
double absoluteValue(double x) {
  if (x < 0)
    x = -x;
  return (x);
}


x86 assembly (clang, -O0):
<absoluteValue>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1138 <absoluteValue+0x38>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absoluteValue>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @absoluteValue(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
store double %7, double* %2
br label %8
8: ; preds = %5, %1
%9 = load double, double* %2
ret double %9
}

LLVM IR (-O2):
define double @absoluteValue(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Type definitions */
struct battle_char {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ remove_status(struct battle_char *, int);
void heal(struct battle_char *origin, struct battle_char *target) {
  remove_status(target, 2);
  remove_status(target, 12);
  remove_status(target, 10);
}


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

x86 assembly (clang, -O2):
<heal>:
push   %rbx
mov    %rsi,%rbx
mov    %rsi,%rdi
mov    $0x2,%esi
call   1030 <remove_status@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <remove_status@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
pop    %rbx
jmp    1030 <remove_status@plt>

LLVM IR (-O0):
%struct.battle_char = type { i32 }
define void @heal(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
%5 = load %struct.battle_char*, %struct.battle_char** %4
%6 = call i32 @remove_status(%struct.battle_char* %5, i32 2)
%7 = load %struct.battle_char*, %struct.battle_char** %4
%8 = call i32 @remove_status(%struct.battle_char* %7, i32 12)
%9 = load %struct.battle_char*, %struct.battle_char** %4
%10 = call i32 @remove_status(%struct.battle_char* %9, i32 10)
ret void
}

LLVM IR (-O2):
%struct.battle_char = type { i32 }
define void @heal(%struct.battle_char* nocapture readnone %0, %struct.battle_char* %1) {
%3 = tail call i32 @remove_status(%struct.battle_char* %1, i32 2)
%4 = tail call i32 @remove_status(%struct.battle_char* %1, i32 12)
%5 = tail call i32 @remove_status(%struct.battle_char* %1, i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void KSTK_ESP(void) { panic("KSTK_ESP"); }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"KSTK_ESP\00"
define void @KSTK_ESP() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_2Auint8_reg(unsigned char val) {
  return ((val) & (0x2A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Auint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x2a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_2Auint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 42
%6 = icmp ne i32 %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_2Auint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 42
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void displaycon_off(void) { (*((volatile unsigned long *)0x77100000)) &= ~0x3; }


x86 assembly (clang, -O0):
<displaycon_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0x77100000,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffc,%rcx
mov    $0x77100000,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<displaycon_off>:
andq   $0xfffffffffffffffc,0x77100000
77 fc
ret

LLVM IR (-O0):
define void @displaycon_off() {
%1 = load volatile i64, i64* inttoptr (i64 1997537280 to i64*)
%2 = and i64 %1, -4
store volatile i64 %2, i64* inttoptr (i64 1997537280 to i64*)
ret void
}

LLVM IR (-O2):
define void @displaycon_off() {
%1 = load volatile i64, i64* inttoptr (i64 1997537280 to i64*)
%2 = and i64 %1, -4
store volatile i64 %2, i64* inttoptr (i64 1997537280 to i64*)
ret void
}
/* Type definitions */
struct solo5_start_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ solo5_abort();
int solo5_app_main(const struct solo5_start_info *si __attribute__((unused))) {
  puts("\n**** Solo5 standalone test_abort ****\n\n");
  solo5_abort();
  return 0;
}


x86 assembly (clang, -O0):
<solo5_app_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <solo5_abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.solo5_start_info = type { i32 }
@.str = [41 x i8] c"\0A**** Solo5 standalone test_abort ****\0A\0A\00"
define i32 @solo5_app_main(%struct.solo5_start_info* %0) {
%2 = alloca %struct.solo5_start_info*
store %struct.solo5_start_info* %0, %struct.solo5_start_info** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @solo5_abort()
ret i32 0
}

LLVM IR (-O2):
%struct.solo5_start_info = type { i32 }
@.str = [41 x i8] c"\0A**** Solo5 standalone test_abort ****\0A\0A\00"
define i32 @solo5_app_main(%struct.solo5_start_info* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @solo5_abort()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ soar_cExciseAllProductionsOfType(int);
int /*<<< orphan*/ soar_cReInitSoar();
void soar_cExciseAllTaskProductions(void) {
  soar_cExciseAllProductionsOfType(2);
  soar_cExciseAllProductionsOfType(3);
  soar_cExciseAllProductionsOfType(0);
  soar_cReInitSoar();
}


x86 assembly (clang, -O0):
<soar_cExciseAllTaskProductions>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <soar_cExciseAllProductionsOfType@plt>
mov    $0x3,%edi
call   1030 <soar_cExciseAllProductionsOfType@plt>
xor    %edi,%edi
call   1030 <soar_cExciseAllProductionsOfType@plt>
mov    $0x0,%al
call   1040 <soar_cReInitSoar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<soar_cExciseAllTaskProductions>:
push   %rax
mov    $0x2,%edi
call   1030 <soar_cExciseAllProductionsOfType@plt>
mov    $0x3,%edi
call   1030 <soar_cExciseAllProductionsOfType@plt>
xor    %edi,%edi
call   1030 <soar_cExciseAllProductionsOfType@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <soar_cReInitSoar@plt>

LLVM IR (-O0):
define void @soar_cExciseAllTaskProductions() {
%1 = call i32 @soar_cExciseAllProductionsOfType(i32 2)
%2 = call i32 @soar_cExciseAllProductionsOfType(i32 3)
%3 = call i32 @soar_cExciseAllProductionsOfType(i32 0)
%4 = call i32 (...) @soar_cReInitSoar()
ret void
}

LLVM IR (-O2):
define void @soar_cExciseAllTaskProductions() {
%1 = tail call i32 @soar_cExciseAllProductionsOfType(i32 2)
%2 = tail call i32 @soar_cExciseAllProductionsOfType(i32 3)
%3 = tail call i32 @soar_cExciseAllProductionsOfType(i32 0)
%4 = tail call i32 (...) @soar_cReInitSoar()
ret void
}
/* Variables and functions */
int type1(int *, int /*<<< orphan*/, int);
int More(int *msgvec) { return (type1(msgvec, 0, 1)); }


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

x86 assembly (clang, -O2):
<More>:
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <type1@plt>

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

LLVM IR (-O2):
define i32 @More(i32* %0) {
%2 = tail call i32 @type1(i32* %0, i32 0, i32 1)
ret i32 %2
}
void avformat_flush() {}


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

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

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

LLVM IR (-O2):
define void @avformat_flush() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
long int BNCHz() {
  long int stat = 99;
  BNCIO(12);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCHz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x63,-0x8(%rbp)
mov    $0xc,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCHz>:
push   %rax
mov    $0xc,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNCHz() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO(i32 12)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @BNCHz() {
%1 = tail call i32 @BNCIO(i32 12)
ret i64 99
}
/* Variables and functions */
int /*<<< orphan*/ ndsctl_action(char *, char *, char *);
void ndsctl_auth(void) {
  ndsctl_action("auth", "Client %s authenticated.\n",
                "Failed to authenticate client %s.\n");
}


x86 assembly (clang, -O0):
<ndsctl_auth>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee3(%rip),%rsi
lea    0xef6(%rip),%rdx
call   1030 <ndsctl_action@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndsctl_auth>:
lea    0xee9(%rip),%rdi
lea    0xee7(%rip),%rsi
lea    0xefa(%rip),%rdx
jmp    1030 <ndsctl_action@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"auth\00"
@.str.1 = [26 x i8] c"Client %s authenticated.\0A\00"
@.str.2 = [35 x i8] c"Failed to authenticate client %s.\0A\00"
define void @ndsctl_auth() {
%1 = call i32 @ndsctl_action(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"auth\00"
@.str.1 = [26 x i8] c"Client %s authenticated.\0A\00"
@.str.2 = [35 x i8] c"Failed to authenticate client %s.\0A\00"
define void @ndsctl_auth() {
%1 = tail call i32 @ndsctl_action(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
unsigned int sleep(unsigned int seconds) {
  fprintf(stderr, "ERROR: In deepbind_syscalls.c implementation of sleep\n");
  exit(3);
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sleep>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"ERROR: In deepbind_syscalls.c implementation of sleep\0A\00"
define i32 @sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"ERROR: In deepbind_syscalls.c implementation of sleep\0A\00"
define i32 @sleep(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 3)
unreachable
}
void xed_decode_traverse_dump_profile(void) {}


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

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

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

LLVM IR (-O2):
define void @xed_decode_traverse_dump_profile() {
ret void
}
int main() {
  int a = 0;
  int *b = &a;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned int rol(unsigned int arg, int shift) {
  arg &= 0xffffffff;
  return (arg << shift) | (arg >> (32 - shift));
}


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

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

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

LLVM IR (-O2):
define i32 @rol(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *__psh_history_path();
int /*<<< orphan*/ *fopen(char *, char *);
FILE *psh_open_writable_history() {
  char *path = __psh_history_path();
  FILE *file;
  if (!path) {
    return NULL;
  }
  file = fopen(path, "a");
  return file;
}


x86 assembly (clang, -O0):
<psh_open_writable_history>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <__psh_history_path@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <psh_open_writable_history+0x2b>
movq   $0x0,-0x8(%rbp)
jmp    1167 <psh_open_writable_history+0x47>
mov    -0x10(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psh_open_writable_history>:
push   %rax
xor    %eax,%eax
call   1030 <__psh_history_path@plt>
test   %rax,%rax
je     113d <psh_open_writable_history+0x1d>
lea    0xecc(%rip),%rsi
mov    %rax,%rdi
pop    %rax
jmp    1040 <fopen@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define noalias i32* @psh_open_writable_history() {
%1 = tail call i8* (...) @__psh_history_path()
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32* [ %4, %3 ], [ null, %0 ]
ret i32* %6
}
/* Variables and functions */
int /*<<< orphan*/ uart_1_putc(char);
void uart_1_printf(char *str) {
  for (int i = 0; str[i] != '\0'; ++i) {
    uart_1_putc(str[i]);
  }
  return;
}


x86 assembly (clang, -O0):
<uart_1_printf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <uart_1_printf+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <uart_1_putc@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <uart_1_printf+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_1_printf>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <uart_1_printf+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <uart_1_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uart_1_printf+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uart_1_printf(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8 [ %11, %5 ], [ %2, %1 ]
%8 = tail call i32 @uart_1_putc(i8 signext %7)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %4, label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_adds_pu8(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test39(__m64 a, __m64 b) { return _mm_adds_pu8(a, b); }


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

x86 assembly (clang, -O2):
<test39>:
jmp    1030 <_mm_adds_pu8@plt>

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

LLVM IR (-O2):
define i32 @test39(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_adds_pu8(i32 %0, i32 %1)
ret i32 %3
}
void __attribute__((noreturn)) exit(int val) {
  asm volatile("out %%al, %%dx" : : "a"(0xfe), "d"(0x64));
  while (1)
    ;
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xfe,%eax
mov    $0x64,%edx
out    %al,(%dx)
jmp    1112 <exit+0x12>

x86 assembly (clang, -O2):
<exit>:
mov    $0xfe,%eax
mov    $0x64,%edx
out    %al,(%dx)
nopl   0x0(%rax,%rax,1)
jmp    1110 <exit+0x10>

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

LLVM IR (-O2):
define void @exit(i32 %0) {
tail call void asm sideeffect "out %al, %dx", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 254, i32 100)
br label %2
2: ; preds = %1, %2
br label %2
}
double div(double a, double b) { return a / b; }


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

x86 assembly (clang, -O2):
<div>:
divsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @div(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ print_at_clr(char const *, int, int, int);
void print_at(const char *message, int col, int row) {
  print_at_clr(message, col, row, (0x0 << 4) | ((0x7 | 0x08) & 0xF));
}


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

x86 assembly (clang, -O2):
<print_at>:
mov    $0xf,%ecx
jmp    1030 <print_at_clr@plt>

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

LLVM IR (-O2):
define void @print_at(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @print_at_clr(i8* %0, i32 %1, i32 %2, i32 15)
ret void
}
/* Variables and functions */
bool is_sse_available() { return true; }


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

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

LLVM IR (-O0):
define i32 @is_sse_available() {
ret i32 1
}

LLVM IR (-O2):
define i32 @is_sse_available() {
ret i32 1
}
void init_mmu(void) {}


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

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

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

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

/* Variables and functions */
scalar_t__ EEXIST;
scalar_t__ errno;
int mkdir(char const *, int /*<<< orphan*/);
int xmkdir(const char *pathname, mode_t mode) {
  int ret = mkdir(pathname, mode);
  if (ret == -1 && errno != EEXIST) {
    ;
  }
  return ret;
}


x86 assembly (clang, -O0):
<xmkdir>:
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 <mkdir@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    1157 <xmkdir+0x47>
mov    0x2e99(%rip),%rax
mov    (%rax),%rax
mov    0x2e97(%rip),%rcx
cmp    (%rcx),%rax
je     1157 <xmkdir+0x47>
jmp    1157 <xmkdir+0x47>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmkdir>:
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
@errno = global i64 0
@EEXIST = global i64 0
define i32 @xmkdir(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @mkdir(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i64, i64* @errno
%13 = load i64, i64* @EEXIST
%14 = icmp ne i64 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11
br label %16
16: ; preds = %15, %11, %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@errno = global i64 0
@EEXIST = global i64 0
define i32 @xmkdir(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @mkdir(i8* %0, i32 %1)
ret i32 %3
}
double Rad2m(const double rad) { return rad * 6371000; }


x86 assembly (clang, -O0):
<Rad2m>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rad2m>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @Rad2m(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 6.371000e+06
ret double %4
}

LLVM IR (-O2):
define double @Rad2m(double %0) {
%2 = fmul double %0, 6.371000e+06
ret double %2
}
int Operand_arr_encode(unsigned int *valp) {
  int error;
  error = (*valp & ~0xf) != 0;
  return error;
}


x86 assembly (clang, -O0):
<Operand_arr_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xfffffff0,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_arr_encode>:
xor    %eax,%eax
cmpl   $0x10,(%rdi)
setae  %al
ret

LLVM IR (-O0):
define i32 @Operand_arr_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = and i32 %5, -16
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @Operand_arr_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ugt i32 %2, 15
%4 = zext i1 %3 to i32
ret i32 %4
}
void RTVfsUtilDummyPollOne(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsUtilDummyPollOne() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_filename(int /*<<< orphan*/);
char *strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
char *strrchr(int /*<<< orphan*/, char);
char *replace_extension(char *dest, const char *path, const char *extension) {
  char *s = strrchr(get_filename(strcpy(dest, path)), '.');
  if (s)
    *s = 0;
  return strcat(dest, extension);
}


x86 assembly (clang, -O0):
<replace_extension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %eax,%edi
call   1040 <get_filename@plt>
mov    %eax,%edi
mov    $0x2e,%esi
call   1050 <strrchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     118a <replace_extension+0x4a>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_extension>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strcpy@plt>
mov    %eax,%edi
call   1040 <get_filename@plt>
mov    %eax,%edi
mov    $0x2e,%esi
call   1050 <strrchr@plt>
test   %rax,%rax
je     116a <replace_extension+0x2a>
movb   $0x0,(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <strcat@plt>

LLVM IR (-O0):
define i8* @replace_extension(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = call i32 @get_filename(i32 %10)
%12 = call i8* @strrchr(i32 %11, i8 signext 46)
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = load i8*, i8** %7
store i8 0, i8* %16
br label %17
17: ; preds = %15, %3
%18 = load i8*, i8** %4
%19 = load i8*, i8** %6
%20 = call i8* @strcat(i8* %18, i8* %19)
ret i8* %20
}

LLVM IR (-O2):
define i8* @replace_extension(i8* returned %0, i8* %1, i8* nocapture %2) {
%4 = tail call i32 @strcpy(i8* %0, i8* %1)
%5 = tail call i32 @get_filename(i32 %4)
%6 = tail call i8* @strrchr(i32 %5, i8 signext 46)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %3
store i8 0, i8* %6
br label %9
9: ; preds = %8, %3
%10 = tail call i8* @strcat(i8* dereferenceable(1) %0, i8* dereferenceable(1) %2)
ret i8* %0
}
void lcd_shiftright(void) {}


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

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

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

LLVM IR (-O2):
define void @lcd_shiftright() {
ret void
}
void gather_industrial_taxes(struct industrial *i, struct tax_gather *g) {}


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

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

LLVM IR (-O0):
%struct.industrial = type opaque
%struct.tax_gather = type opaque
define void @gather_industrial_taxes(%struct.industrial* %0, %struct.tax_gather* %1) {
%3 = alloca %struct.industrial*
%4 = alloca %struct.tax_gather*
store %struct.industrial* %0, %struct.industrial** %3
store %struct.tax_gather* %1, %struct.tax_gather** %4
ret void
}

LLVM IR (-O2):
%struct.industrial = type opaque
%struct.tax_gather = type opaque
define void @gather_industrial_taxes(%struct.industrial* nocapture %0, %struct.tax_gather* nocapture %1) {
ret void
}
extern void get_system_id(double time, struct sensordata *sensorData_ptr,
                          struct nav *navData_ptr,
                          struct control *controlData_ptr) {}


x86 assembly (clang, -O0):
<get_system_id>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sensordata = type opaque
%struct.nav = type opaque
%struct.control = type opaque
define void @get_system_id(double %0, %struct.sensordata* %1, %struct.nav* %2, %struct.control* %3) {
%5 = alloca double
%6 = alloca %struct.sensordata*
%7 = alloca %struct.nav*
%8 = alloca %struct.control*
store double %0, double* %5
store %struct.sensordata* %1, %struct.sensordata** %6
store %struct.nav* %2, %struct.nav** %7
store %struct.control* %3, %struct.control** %8
ret void
}

LLVM IR (-O2):
%struct.sensordata = type opaque
%struct.nav = type opaque
%struct.control = type opaque
define void @get_system_id(double %0, %struct.sensordata* nocapture %1, %struct.nav* nocapture %2, %struct.control* nocapture %3) {
ret void
}
void copro_flush_all_slbs(struct mm_struct *mm) {}


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

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

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

LLVM IR (-O2):
%struct.mm_struct = type opaque
define void @copro_flush_all_slbs(%struct.mm_struct* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int raw_set_pos_abs(void *id, int64_t pos) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @raw_set_pos_abs(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ ivory_serialize_pack_prim_1_be(int /*<<< orphan*/ *,
                                                  int /*<<< orphan*/ *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ **, int /*<<< orphan*/ const *,
                          int);
void ivory_serialize_pack_uint8_be(uint8_t *dst, uint32_t offs,
                                   const uint8_t *src) {
  uint8_t tmp[1] = {0};
  memcpy(&tmp, src, sizeof(tmp));
  ivory_serialize_pack_prim_1_be(dst + offs, tmp);
}


x86 assembly (clang, -O0):
<ivory_serialize_pack_uint8_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x1c(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    -0x1c(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <ivory_serialize_pack_prim_1_be@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_pack_uint8_be>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%r15
mov    %r15,%rdi
mov    %rdx,%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
movslq %ebx,%rax
lea    (%r14,%rax,4),%rdi
mov    %r15,%rsi
call   1030 <ivory_serialize_pack_prim_1_be@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ivory_serialize_pack_uint8_be(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca [1 x i32]
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = bitcast [1 x i32]* %7 to i8*
%9 = bitcast [1 x i32]* %7 to i32**
%10 = load i32*, i32** %6
%11 = call i32 @memcpy(i32** %9, i32* %10, i32 4)
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = getelementptr inbounds [1 x i32], [1 x i32]* %7, i64 0, i64 0
%17 = call i32 @ivory_serialize_pack_prim_1_be(i32* %15, i32* %16)
ret void
}

LLVM IR (-O2):
define void @ivory_serialize_pack_uint8_be(i32* %0, i32 %1, i32* %2) {
%4 = alloca [1 x i32]
%5 = bitcast [1 x i32]* %4 to i8*
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 0
store i32 0, i32* %6
%7 = bitcast [1 x i32]* %4 to i32**
%8 = call i32 @memcpy(i32** %7, i32* %2, i32 4)
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = call i32 @ivory_serialize_pack_prim_1_be(i32* %10, i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int /*<<< orphan*/ IntDisable(unsigned long);
int /*<<< orphan*/ IntUnregister(unsigned long);
void QEIIntUnregister(unsigned long ulBase) {
  unsigned long ulInt;
  DEBUG_ASSERT((ulBase == 0x4002C000) || (ulBase == 0x4002D000));
  ulInt = (ulBase == 0x4002C000) ? 29 : 54;
  IntDisable(ulInt);
  IntUnregister(ulInt);
}


x86 assembly (clang, -O0):
<QEIIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x4002c000,-0x8(%rbp)
40
mov    %al,-0x11(%rbp)
je     115d <QEIIntUnregister+0x2d>
cmpq   $0x4002d000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rdx
mov    $0x36,%eax
mov    $0x1d,%ecx
cmp    $0x4002c000,%rdx
cmove  %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <IntDisable@plt>
mov    -0x10(%rbp),%rdi
call   1050 <IntUnregister@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIIntUnregister>:
push   %rbx
mov    %rdi,%rbx
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x4002c000,%rax
sete   %dil
call   1040 <DEBUG_ASSERT@plt>
cmp    $0x4002c000,%rbx
mov    $0x1d,%eax
mov    $0x36,%ebx
cmove  %rax,%rbx
mov    %rbx,%rdi
call   1030 <IntDisable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @QEIIntUnregister(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp eq i64 %4, 1073922048
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i64, i64* %2
%8 = icmp eq i64 %7, 1073926144
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ true, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
%12 = call i32 @DEBUG_ASSERT(i32 %11)
%13 = load i64, i64* %2
%14 = icmp eq i64 %13, 1073922048
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 29, i32 54
%17 = sext i32 %16 to i64
store i64 %17, i64* %3
%18 = load i64, i64* %3
%19 = call i32 @IntDisable(i64 %18)
%20 = load i64, i64* %3
%21 = call i32 @IntUnregister(i64 %20)
ret void
}

LLVM IR (-O2):
define void @QEIIntUnregister(i64 %0) {
%2 = icmp eq i64 %0, 1073922048
%3 = and i64 %0, -4097
%4 = icmp eq i64 %3, 1073922048
%5 = zext i1 %4 to i32
%6 = tail call i32 @DEBUG_ASSERT(i32 %5)
%7 = select i1 %2, i64 29, i64 54
%8 = tail call i32 @IntDisable(i64 %7)
%9 = tail call i32 @IntUnregister(i64 %7)
ret void
}
char *mem_version(void) { return ("1.0"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"1.0\00"
define i8* @mem_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"1.0\00"
define i8* @mem_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
int toupper1(int a) {
  return (('a' <= (a) && (a) <= 'z') ? 'A' + ((a) - 'a') : (a));
}


x86 assembly (clang, -O0):
<toupper1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x61,%eax
cmp    -0x4(%rbp),%eax
jg     1130 <toupper1+0x30>
cmpl   $0x7a,-0x4(%rbp)
jg     1130 <toupper1+0x30>
mov    -0x4(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <toupper1+0x36>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper1>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @toupper1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 97, %3
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 97
%11 = add nsw i32 65, %10
br label %14
12: ; preds = %5, %1
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ %11, %8 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @toupper1(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int prj_find_package(char const *);
char const *prj_get_target_for(int);
const char *listLinkerDeps(const char *name) {
  int i = prj_find_package(name);
  if (i >= 0) {
    return prj_get_target_for(i);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<listLinkerDeps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <prj_find_package@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1153 <listLinkerDeps+0x33>
mov    -0x14(%rbp),%edi
call   1030 <prj_get_target_for@plt>
mov    %rax,-0x8(%rbp)
jmp    115b <listLinkerDeps+0x3b>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listLinkerDeps>:
push   %rax
call   1040 <prj_find_package@plt>
test   %eax,%eax
js     1132 <listLinkerDeps+0x12>
mov    %eax,%edi
pop    %rax
jmp    1030 <prj_get_target_for@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @listLinkerDeps(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @prj_find_package(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %4
%11 = call i8* @prj_get_target_for(i32 %10)
store i8* %11, i8** %2
br label %13
12: ; preds = %1
store i8* null, i8** %2
br label %13
13: ; preds = %12, %9
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
define i8* @listLinkerDeps(i8* %0) {
%2 = tail call i32 @prj_find_package(i8* %0)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @prj_get_target_for(i32 %2)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}