xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ render_abar_number(int);
int /*<<< orphan*/ render_abar_switches(int);
void render_abar(int note) {
  int i;
  for (i = 0; i < 4; i++)
    render_abar_number(i);
  render_abar_switches(note);
}


x86 assembly (clang, -O0):
<render_abar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1152 <render_abar+0x32>
mov    -0x8(%rbp),%edi
call   1030 <render_abar_number@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <render_abar+0x12>
mov    -0x4(%rbp),%edi
call   1040 <render_abar_switches@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<render_abar>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <render_abar_number@plt>
mov    $0x1,%edi
call   1030 <render_abar_number@plt>
mov    $0x2,%edi
call   1030 <render_abar_number@plt>
mov    $0x3,%edi
call   1030 <render_abar_number@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <render_abar_switches@plt>

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

LLVM IR (-O2):
define void @render_abar(i32 %0) {
%2 = tail call i32 @render_abar_number(i32 0)
%3 = tail call i32 @render_abar_number(i32 1)
%4 = tail call i32 @render_abar_number(i32 2)
%5 = tail call i32 @render_abar_number(i32 3)
%6 = tail call i32 @render_abar_switches(i32 %0)
ret void
}
void gg_init_color() {}


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

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

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

LLVM IR (-O2):
define void @gg_init_color() {
ret void
}
int test_imm_76uint8_reg(unsigned char val) {
  return ((val) & (0x76 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_76uint8_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, 118
%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_76uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 118
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
gcom() { ol("coma\n\tcomb"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"coma\0A\09comb\00"
define i32 @gcom() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [11 x i8] c"coma\0A\09comb\00"
define i32 @gcom() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void ieee80211_debugfs_netdev_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @ieee80211_debugfs_netdev_exit() {
ret void
}
void cdiDecodeTime(int time, int *hour, int *minute, int *second) {
  int itime;
  *hour = time / 10000;
  itime = time - *hour * 10000;
  *minute = itime / 100;
  *second = itime - *minute * 100;
}


x86 assembly (clang, -O0):
<cdiDecodeTime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
imul   $0x2710,(%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
imul   $0x64,(%rax),%eax
sub    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdiDecodeTime>:
movslq %edi,%r8
imul   $0x68db8bad,%r8,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x2c,%rdi
add    %eax,%edi
mov    %edi,(%rsi)
imul   $0xffffd8f0,%edi,%eax
add    %eax,%r8d
movslq %r8d,%rax
imul   $0x51eb851f,%rax,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x25,%rsi
add    %edi,%esi
mov    %esi,(%rdx)
imul   $0xffffff9c,%esi,%edx
add    %edx,%eax
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
define void @cdiDecodeTime(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = load i32, i32* %5
%11 = sdiv i32 %10, 10000
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
%16 = mul nsw i32 %15, 10000
%17 = sub nsw i32 %13, %16
store i32 %17, i32* %9
%18 = load i32, i32* %9
%19 = sdiv i32 %18, 100
%20 = load i32*, i32** %7
store i32 %19, i32* %20
%21 = load i32, i32* %9
%22 = load i32*, i32** %7
%23 = load i32, i32* %22
%24 = mul nsw i32 %23, 100
%25 = sub nsw i32 %21, %24
%26 = load i32*, i32** %8
store i32 %25, i32* %26
ret void
}

LLVM IR (-O2):
define void @cdiDecodeTime(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = sdiv i32 %0, 10000
store i32 %5, i32* %1
%6 = mul nsw i32 %5, -10000
%7 = add i32 %6, %0
%8 = sdiv i32 %7, 100
store i32 %8, i32* %2
%9 = mul nsw i32 %8, -100
%10 = add i32 %9, %7
store i32 %10, i32* %3
ret void
}
/* Variables and functions */
int daemon(int, int);
int sys_daemon(int nocd, int nocl) { return daemon(nocd, nocl); }


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

x86 assembly (clang, -O2):
<sys_daemon>:
jmp    1030 <daemon@plt>

LLVM IR (-O0):
define i32 @sys_daemon(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 @daemon(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @sys_daemon(i32 %0, i32 %1) {
%3 = tail call i32 @daemon(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int *s(int *);
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a, b = 0xbee, c = 0x3;
  a = b + c;
  b = 3;
  c = 5;
  int *p = s(&a);
  *p = 13;
  test_assert(a == 13);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xbee,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <s@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0xd,(%rax)
cmpl   $0xd,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <test_assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xbf1,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <s@plt>
movl   $0xd,(%rax)
xor    %edi,%edi
cmpl   $0xd,0x4(%rsp)
sete   %dil
call   1040 <test_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 0, i32* %1
store i32 3054, i32* %3
store i32 3, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
store i32 %8, i32* %2
store i32 3, i32* %3
store i32 5, i32* %4
%9 = call i32* @s(i32* %2)
store i32* %9, i32** %5
%10 = load i32*, i32** %5
store i32 13, i32* %10
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 13
%13 = zext i1 %12 to i32
%14 = call i32 @test_assert(i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 3057, i32* %1
%3 = call i32* @s(i32* %1)
store i32 13, i32* %3
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 13
%6 = zext i1 %5 to i32
%7 = call i32 @test_assert(i32 %6)
ret i32 0
}
void ESS_mcdisplay_TDRlike(double geometry) {}


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

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

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

LLVM IR (-O2):
define void @ESS_mcdisplay_TDRlike(double %0) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
char *foo(void) {
  printf("aafoo");
  return (char *)malloc(100);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1040 <malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x64,%edi
pop    %rax
jmp    1040 <malloc@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"aafoo\00"
define i8* @foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i64 @malloc(i32 100)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"aafoo\00"
define i8* @foo() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 @malloc(i32 100)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void game_startup() {
  printf("\"The Game\" starting up...\n");
  printf("\t...intializing fun factors\n");
  printf("\t...calibrating goof exponents\n");
  printf("\t...done.\n");
}


x86 assembly (clang, -O0):
<game_startup>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
call   1030 <printf@plt>
lea    0xf05(%rip),%rdi
call   1030 <printf@plt>
lea    0xf19(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<game_startup>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xf06(%rip),%rdi
call   1030 <puts@plt>
lea    0xf19(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"\22The Game\22 starting up...\0A\00"
@.str.1 = [29 x i8] c"\09...intializing fun factors\0A\00"
@.str.2 = [32 x i8] c"\09...calibrating goof exponents\0A\00"
@.str.3 = [11 x i8] c"\09...done.\0A\00"
define void @game_startup() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"\22The Game\22 starting up...\00"
@str.4 = [28 x i8] c"\09...intializing fun factors\00"
@str.5 = [31 x i8] c"\09...calibrating goof exponents\00"
@str.6 = [10 x i8] c"\09...done.\00"
define void @game_startup() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.6, i64 0, i64 0))
ret void
}
unsigned int cpuid_ecx(unsigned int op) {
  unsigned int eax, ecx;
  __asm__("mov %%ebx, %%edi;"
          "cpuid;"
          "mov %%edi, %%ebx;"
          : "=a"(eax), "=c"(ecx)
          : "0"(op)
          : "edx", "edi");
  return ecx;
}


x86 assembly (clang, -O0):
<cpuid_ecx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %ebx,%edi
cpuid
mov    %edi,%ebx
mov    %eax,-0x8(%rbp)
mov    %ecx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_ecx>:
mov    %edi,%eax
mov    %ebx,%edi
cpuid
mov    %edi,%ebx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cpuid_ecx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call { i32, i32 } asm "mov %ebx, %edi;cpuid;mov %edi, %ebx;", "={ax},={cx},0,~{edx},~{edi},~{dirflag},~{fpsr},~{flags}"(i32 %5)
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %3
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @cpuid_ecx(i32 %0) {
%2 = tail call { i32, i32 } asm "mov %ebx, %edi;cpuid;mov %edi, %ebx;", "={ax},={cx},0,~{edx},~{edi},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = extractvalue { i32, i32 } %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_print_char(char c) {
  write(1, &c, 1);
  return;
}


x86 assembly (clang, -O0):
<ft_print_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print_char>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @ft_print_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @ft_print_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ microblaze_disable_dcache();
int /*<<< orphan*/ microblaze_flush_cache_ext();
int /*<<< orphan*/ microblaze_flush_dcache();
int /*<<< orphan*/ microblaze_invalidate_cache_ext();
int /*<<< orphan*/ microblaze_invalidate_dcache();
void Xil_DCacheDisable(void) {
  microblaze_flush_cache_ext();
  microblaze_flush_dcache();
  ;
  microblaze_invalidate_cache_ext();
  microblaze_invalidate_dcache();
  ;
  microblaze_disable_dcache();
}


x86 assembly (clang, -O0):
<Xil_DCacheDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <microblaze_flush_cache_ext@plt>
mov    $0x0,%al
call   1050 <microblaze_flush_dcache@plt>
mov    $0x0,%al
call   1070 <microblaze_invalidate_cache_ext@plt>
mov    $0x0,%al
call   1060 <microblaze_invalidate_dcache@plt>
mov    $0x0,%al
call   1040 <microblaze_disable_dcache@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xil_DCacheDisable>:
push   %rax
xor    %eax,%eax
call   1030 <microblaze_flush_cache_ext@plt>
xor    %eax,%eax
call   1050 <microblaze_flush_dcache@plt>
xor    %eax,%eax
call   1070 <microblaze_invalidate_cache_ext@plt>
xor    %eax,%eax
call   1060 <microblaze_invalidate_dcache@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <microblaze_disable_dcache@plt>

LLVM IR (-O0):
define void @Xil_DCacheDisable() {
%1 = call i32 (...) @microblaze_flush_cache_ext()
%2 = call i32 (...) @microblaze_flush_dcache()
%3 = call i32 (...) @microblaze_invalidate_cache_ext()
%4 = call i32 (...) @microblaze_invalidate_dcache()
%5 = call i32 (...) @microblaze_disable_dcache()
ret void
}

LLVM IR (-O2):
define void @Xil_DCacheDisable() {
%1 = tail call i32 (...) @microblaze_flush_cache_ext()
%2 = tail call i32 (...) @microblaze_flush_dcache()
%3 = tail call i32 (...) @microblaze_invalidate_cache_ext()
%4 = tail call i32 (...) @microblaze_invalidate_dcache()
%5 = tail call i32 (...) @microblaze_disable_dcache()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
struct tm get_time() {
  time_t rawtime;
  time(&rawtime);
  struct tm *timeinfo = localtime(&rawtime);
  return *timeinfo;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @get_time() {
%1 = alloca %struct.tm
%2 = alloca i32
%3 = alloca %struct.tm*
%4 = call i32 @time(i32* %2)
%5 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %5, %struct.tm** %3
%6 = load %struct.tm*, %struct.tm** %3
%7 = bitcast %struct.tm* %1 to i8*
%8 = bitcast %struct.tm* %6 to i8*
%9 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 0
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @get_time() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ TCIFLUSH;
int /*<<< orphan*/ tcflush(int /*<<< orphan*/, int /*<<< orphan*/);
void flushi() { tcflush(0, TCIFLUSH); }


x86 assembly (clang, -O0):
<flushi>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1030 <tcflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flushi>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
jmp    1030 <tcflush@plt>

LLVM IR (-O0):
@TCIFLUSH = global i32 0
define void @flushi() {
%1 = load i32, i32* @TCIFLUSH
%2 = call i32 @tcflush(i32 0, i32 %1)
ret void
}

LLVM IR (-O2):
@TCIFLUSH = global i32 0
define void @flushi() {
%1 = load i32, i32* @TCIFLUSH
%2 = tail call i32 @tcflush(i32 0, i32 %1)
ret void
}
int MwStrcmp(const char *p, const char *q) {
  int c;
  while (!(c = *p - *q) && *p) {
    p++;
    q++;
  }
  return c;
}


x86 assembly (clang, -O0):
<MwStrcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
sub    %eax,%ecx
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
jne    113d <MwStrcmp+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    114d <MwStrcmp+0x4d>
jmp    116a <MwStrcmp+0x6a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <MwStrcmp+0xc>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MwStrcmp>:
movsbl (%rdi),%ecx
movsbl (%rsi),%edx
mov    %ecx,%eax
sub    %edx,%eax
jne    1138 <MwStrcmp+0x38>
test   %cl,%cl
je     1138 <MwStrcmp+0x38>
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl (%rdi,%rcx,1),%edx
movsbl (%rsi,%rcx,1),%r8d
mov    %edx,%eax
sub    %r8d,%eax
jne    1138 <MwStrcmp+0x38>
add    $0x1,%rcx
test   %dl,%dl
jne    1120 <MwStrcmp+0x20>
ret

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

LLVM IR (-O2):
define i32 @MwStrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
%8 = icmp ne i32 %7, 0
%9 = icmp eq i8 %3, 0
%10 = select i1 %8, i1 true, i1 %9
br i1 %10, label %24, label %11
11: ; preds = %2, %11
%12 = phi i8* [ %14, %11 ], [ %0, %2 ]
%13 = phi i8* [ %15, %11 ], [ %1, %2 ]
%14 = getelementptr inbounds i8, i8* %12, i64 1
%15 = getelementptr inbounds i8, i8* %13, i64 1
%16 = load i8, i8* %14
%17 = sext i8 %16 to i32
%18 = load i8, i8* %15
%19 = sext i8 %18 to i32
%20 = sub nsw i32 %17, %19
%21 = icmp ne i32 %20, 0
%22 = icmp eq i8 %16, 0
%23 = select i1 %21, i1 true, i1 %22
br i1 %23, label %24, label %11
24: ; preds = %11, %2
%25 = phi i32 [ %7, %2 ], [ %20, %11 ]
ret i32 %25
}
/* Type definitions */
struct vector {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *vec_get(struct vector const *, scalar_t__);
scalar_t__ vec_isempty(struct vector const *);
scalar_t__ vec_len(struct vector const *);
void *vec_tail(const struct vector *v) {
  void *tail;
  assert(v != NULL);
  if (vec_isempty(v)) {
    tail = NULL;
  } else {
    tail = vec_get(v, vec_len(v) - 1);
  }
  return tail;
}


x86 assembly (clang, -O0):
<vec_tail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <vec_isempty@plt>
cmp    $0x0,%rax
je     117e <vec_tail+0x3e>
movq   $0x0,-0x10(%rbp)
jmp    11a3 <vec_tail+0x63>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <vec_len@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
sub    $0x1,%rsi
call   1050 <vec_get@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_tail>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <vec_isempty@plt>
test   %rax,%rax
je     1163 <vec_tail+0x23>
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
call   1060 <vec_len@plt>
lea    -0x1(%rax),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <vec_get@plt>

LLVM IR (-O0):
%struct.vector = type { i32 }
define i8* @vec_tail(%struct.vector* %0) {
%2 = alloca %struct.vector*
%3 = alloca i8*
store %struct.vector* %0, %struct.vector** %2
%4 = load %struct.vector*, %struct.vector** %2
%5 = icmp ne %struct.vector* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load %struct.vector*, %struct.vector** %2
%9 = call i64 @vec_isempty(%struct.vector* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i8* null, i8** %3
br label %18
12: ; preds = %1
%13 = load %struct.vector*, %struct.vector** %2
%14 = load %struct.vector*, %struct.vector** %2
%15 = call i64 @vec_len(%struct.vector* %14)
%16 = sub nsw i64 %15, 1
%17 = call i8* @vec_get(%struct.vector* %13, i64 %16)
store i8* %17, i8** %3
br label %18
18: ; preds = %12, %11
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
%struct.vector = type { i32 }
define i8* @vec_tail(%struct.vector* %0) {
%2 = icmp ne %struct.vector* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @vec_isempty(%struct.vector* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = tail call i64 @vec_len(%struct.vector* %0)
%9 = add nsw i64 %8, -1
%10 = tail call i8* @vec_get(%struct.vector* %0, i64 %9)
br label %11
11: ; preds = %1, %7
%12 = phi i8* [ %10, %7 ], [ null, %1 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void DEC_HOST_REG(int host_reg) { addbyte(0x48 | host_reg); }


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

x86 assembly (clang, -O2):
<DEC_HOST_REG>:
or     $0x48,%edi
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @DEC_HOST_REG(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = or i32 72, %3
%5 = call i32 @addbyte(i32 %4)
ret void
}

LLVM IR (-O2):
define void @DEC_HOST_REG(i32 %0) {
%2 = or i32 %0, 72
%3 = tail call i32 @addbyte(i32 %2)
ret void
}
void SysCfgRegistersUnlock(void) {
  (*((volatile unsigned int *)((0x01C14000) + (0x38)))) = (0x83E70B13u);
  (*((volatile unsigned int *)((0x01C14000) + (0x3C)))) = (0x95A4F1E0u);
}


x86 assembly (clang, -O0):
<SysCfgRegistersUnlock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c14038,%eax
movl   $0x83e70b13,(%rax)
mov    $0x1c1403c,%eax
movl   $0x95a4f1e0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCfgRegistersUnlock>:
movl   $0x83e70b13,0x1c14038
13 0b e7 83
movl   $0x95a4f1e0,0x1c1403c
e0 f1 a4 95
ret

LLVM IR (-O0):
define void @SysCfgRegistersUnlock() {
store volatile i32 -2082010349, i32* inttoptr (i64 29442104 to i32*)
store volatile i32 -1784352288, i32* inttoptr (i64 29442108 to i32*)
ret void
}

LLVM IR (-O2):
define void @SysCfgRegistersUnlock() {
store volatile i32 -2082010349, i32* inttoptr (i64 29442104 to i32*)
store volatile i32 -1784352288, i32* inttoptr (i64 29442108 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void options_usage(char *name) {
  fprintf(stderr, "Usage: %s [-d] [-o output-file] <input-file>\n", name);
}


x86 assembly (clang, -O0):
<options_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<options_usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"Usage: %s [-d] [-o output-file] <input-file>\0A\00"
define void @options_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"Usage: %s [-d] [-o output-file] <input-file>\0A\00"
define void @options_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void MY_MODULE(void) {}


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

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

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

LLVM IR (-O2):
define void @MY_MODULE() {
ret void
}
int do_357() { return 357; }


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

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

LLVM IR (-O0):
define i32 @do_357() {
ret i32 357
}

LLVM IR (-O2):
define i32 @do_357() {
ret i32 357
}
/* Variables and functions */
int /*<<< orphan*/ reset();
void audio_pause() { reset(); }


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

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

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

LLVM IR (-O2):
define void @audio_pause() {
%1 = tail call i32 (...) @reset()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void *usage(char *argv[]) {
  printf(
      "Usage: %s <sysupgradefile> <kernel_offset> <HWID> <HWVER> <SWID>\n"
      "All are positional arguments ...	\n"
      "	sysupgradefile:		File with the kernel uimage at 0\n"
      "	kernel_offset:		Offset in Hex where the kernel is located\n"
      "	HWID:			Hardware ID, ASCII\n"
      "	HWVER:			Hardware Version, ASCII\n"
      "	SWID:			Software Version, Hex\n"
      "	\n"
      "	",
      argv[0]);
}


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

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

LLVM IR (-O0):
@.str = [306 x i8] c"Usage: %s <sysupgradefile> <kernel_offset> <HWID> <HWVER> <SWID>\0AAll are positional arguments ...\09\0A\09sysupgradefile:\09\09File with the kernel uimage at 0\0A\09kernel_offset:\09\09Offset in Hex where the kernel is located\0A\09HWID:\09\09\09Hardware ID, ASCII\0A\09HWVER:\09\09\09Hardware Version, ASCII\0A\09SWID:\09\09\09Software Version, Hex\0A\09\0A\09\00"
define i8* @usage(i8** %0) {
%2 = alloca i8*
%3 = alloca i8**
store i8** %0, i8*** %3
%4 = load i8**, i8*** %3
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([306 x i8], [306 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [306 x i8] c"Usage: %s <sysupgradefile> <kernel_offset> <HWID> <HWVER> <SWID>\0AAll are positional arguments ...\09\0A\09sysupgradefile:\09\09File with the kernel uimage at 0\0A\09kernel_offset:\09\09Offset in Hex where the kernel is located\0A\09HWID:\09\09\09Hardware ID, ASCII\0A\09HWVER:\09\09\09Hardware Version, ASCII\0A\09SWID:\09\09\09Software Version, Hex\0A\09\0A\09\00"
define noalias i8* @usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([306 x i8], [306 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i8* undef
}
/* Variables and functions */
int ntohl(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a = 0x000217a3;
  printf("%d  %d\n", a, ntohl(a));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x217a3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <ntohl@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x217a3,%edi
call   1040 <ntohl@plt>
lea    0xece(%rip),%rdi
mov    $0x217a3,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @ntohl(i32 137123)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 137123, i32 %1)
ret i32 0
}
char ToLower(char c) {
  if (c >= 'A' && c <= 'Z') {
    c += 0x20;
  }
  return c;
}


x86 assembly (clang, -O0):
<ToLower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     112e <ToLower+0x2e>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     112e <ToLower+0x2e>
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ToLower>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @ToLower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, 32
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %10, %6, %1
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @ToLower(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void sigcatcher(int sig) {
  fprintf(stderr, "osmupdate: Output has been terminated.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<sigcatcher>:
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    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"osmupdate: Output has been terminated.\0A\00"
define void @sigcatcher(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"osmupdate: Output has been terminated.\0A\00"
define void @sigcatcher(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int filenameStrcmp(const char *s1, const char *s2) {
  return strcasecmp(s1, s2);
}


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

x86 assembly (clang, -O2):
<filenameStrcmp>:
jmp    1030 <strcasecmp@plt>

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

LLVM IR (-O2):
define i32 @filenameStrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_logtalk_block_comment() {
  test_parser_verify_parse(test_parser_sourcefile("logtalk", " /*d*/"),
                           "logtalk", "", "/*d*/", 0);
}


x86 assembly (clang, -O0):
<test_logtalk_block_comment>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec7(%rip),%rdx
lea    0xebb(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_logtalk_block_comment>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xed0(%rip),%rdx
lea    0xec4(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"logtalk\00"
@.str.1 = [7 x i8] c" /*d*/\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [6 x i8] c"/*d*/\00"
define void @test_logtalk_block_comment() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"logtalk\00"
@.str.1 = [7 x i8] c" /*d*/\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [6 x i8] c"/*d*/\00"
define void @test_logtalk_block_comment() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
int test_imm_4Eint8_mem(signed char *val) {
  return ((*val) & (0x4E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_4Eint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 78
%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_4Eint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 78
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void free_cmatrix(char **c, long nrl, long nrh, long ncl, long nch) {
  free(c[nrl] + ncl);
  free(c + nrl);
}


x86 assembly (clang, -O0):
<free_cmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
add    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_cmatrix>:
push   %rbx
lea    (%rdi,%rsi,8),%rbx
add    (%rdi,%rsi,8),%rcx
mov    %rcx,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_cmatrix(i8** %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i8**
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i8** %0, i8*** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i8**, i8*** %6
%12 = load i64, i64* %7
%13 = getelementptr inbounds i8*, i8** %11, i64 %12
%14 = load i8*, i8** %13
%15 = load i64, i64* %9
%16 = getelementptr inbounds i8, i8* %14, i64 %15
%17 = load i8**, i8*** %6
%18 = load i64, i64* %7
%19 = getelementptr inbounds i8*, i8** %17, i64 %18
%20 = bitcast i8** %19 to i8*
ret void
}

LLVM IR (-O2):
define void @free_cmatrix(i8** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds i8*, i8** %0, i64 %1
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8, i8* %7, i64 %3
tail call void @free(i8* %8)
%9 = bitcast i8** %6 to i8*
tail call void @free(i8* %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_chksum(char *, char *);
int main(int argc, char *argv[]) {
  do_chksum("bl2aa", "checksum_bl2_14k.bin");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"bl2aa\00"
@.str.1 = [21 x i8] c"checksum_bl2_14k.bin\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @do_chksum(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"bl2aa\00"
@.str.1 = [21 x i8] c"checksum_bl2_14k.bin\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @do_chksum(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void die(void) {
  fprintf(stderr, "usage: memdump {-b|-h|-w} addr count\n");
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"usage: memdump {-b|-h|-w} addr count\0A\00"
define void @die() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"usage: memdump {-b|-h|-w} addr count\0A\00"
define void @die() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int xconfigIsAlpha(char c) {
  return (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')));
}


x86 assembly (clang, -O0):
<xconfigIsAlpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <xconfigIsAlpha+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <xconfigIsAlpha+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <xconfigIsAlpha+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xconfigIsAlpha>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @xconfigIsAlpha(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @xconfigIsAlpha(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
void printFindingWord(struct RhymeWord *word) {}


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

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

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

LLVM IR (-O2):
%struct.RhymeWord = type opaque
define void @printFindingWord(%struct.RhymeWord* nocapture %0) {
ret void
}
int *toone(int *x) {
  x[0] = 1;
  x[1] = 1;
  return x;
}


x86 assembly (clang, -O0):
<toone>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x4(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toone>:
mov    %rdi,%rax
movabs $0x100000001,%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define i32* @toone(i32* returned writeonly %0) {
store i32 1, i32* %0
%2 = getelementptr inbounds i32, i32* %0, i64 1
store i32 1, i32* %2
ret i32* %0
}
/* Variables and functions */
int /*<<< orphan*/ __exit(int);
int /*<<< orphan*/ dcloadsyscall(int);
void exit(int status) {
  if (*(unsigned int *)0x8c004004 == 0xdeadbeef)
    dcloadsyscall(15);
  __exit(status);
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    1146 <exit+0x26>
mov    $0xf,%edi
call   1040 <dcloadsyscall@plt>
mov    -0x4(%rbp),%edi
call   1030 <__exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rbx
mov    %edi,%ebx
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    113a <exit+0x1a>
mov    $0xf,%edi
call   1040 <dcloadsyscall@plt>
mov    %ebx,%edi
call   1030 <__exit@plt>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%4 = icmp eq i32 %3, -559038737
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @dcloadsyscall(i32 15)
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
%9 = call i32 @__exit(i32 %8)
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%3 = icmp eq i32 %2, -559038737
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @dcloadsyscall(i32 15)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @__exit(i32 %0)
unreachable
}