xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ laguna_writeb(int, int);
void __svgalib_laguna_outmisc(int i) { laguna_writeb(0x80, i); }


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

x86 assembly (clang, -O2):
<__svgalib_laguna_outmisc>:
mov    %edi,%esi
mov    $0x80,%edi
jmp    1030 <laguna_writeb@plt>

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

LLVM IR (-O2):
define void @__svgalib_laguna_outmisc(i32 %0) {
%2 = tail call i32 @laguna_writeb(i32 128, i32 %0)
ret void
}
/* Type definitions */
typedef size_t size;

/* Variables and functions */
size_t FSE_compressBound(size_t size) {
  return (512 + ((size) + ((size) >> 7) + 4 + sizeof(size_t)));
}


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

x86 assembly (clang, -O2):
<FSE_compressBound>:
mov    %rdi,%rax
shr    $0x7,%rax
add    %rdi,%rax
add    $0x20c,%rax
ret

LLVM IR (-O0):
define i64 @FSE_compressBound(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = lshr i64 %4, 7
%6 = add i64 %3, %5
%7 = add i64 %6, 4
%8 = add i64 %7, 8
%9 = add i64 512, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @FSE_compressBound(i64 %0) {
%2 = lshr i64 %0, 7
%3 = add i64 %0, 524
%4 = add i64 %3, %2
ret i64 %4
}
adr0reg1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((*((short *)10000000)) <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adr0reg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x989680,%eax
movswl (%rax),%eax
movswl -0x8(%rbp),%ecx
cmp    %ecx,%eax
jg     113f <adr0reg1+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <adr0reg1+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0reg1>:
movswl 0x989680,%ecx
movswl %si,%edx
xor    %eax,%eax
cmp    %ecx,%edx
setge  %al
ret

LLVM IR (-O0):
define i32 @adr0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* inttoptr (i64 10000000 to i16*)
%17 = sext i16 %16 to i32
%18 = load i16, i16* %9
%19 = sext i16 %18 to i32
%20 = icmp sle i32 %17, %19
br i1 %20, label %21, label %22
21: ; preds = %6
store i32 1, i32* %7
br label %23
22: ; preds = %6
store i32 0, i32* %7
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @adr0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = load i16, i16* inttoptr (i64 10000000 to i16*)
%8 = sext i16 %7 to i32
%9 = shl i32 %1, 16
%10 = ashr exact i32 %9, 16
%11 = icmp sge i32 %10, %8
%12 = zext i1 %11 to i32
ret i32 %12
}
void bfqg_stats_end_empty_time(struct bfqg_stats *stats) {}


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

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

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

LLVM IR (-O2):
%struct.bfqg_stats = type opaque
define void @bfqg_stats_end_empty_time(%struct.bfqg_stats* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gettimeofday_op(int, int /*<<< orphan*/);
void show_timer() { gettimeofday_op(3, 0); }


x86 assembly (clang, -O0):
<show_timer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <gettimeofday_op@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_timer>:
mov    $0x3,%edi
xor    %esi,%esi
jmp    1030 <gettimeofday_op@plt>

LLVM IR (-O0):
define void @show_timer() {
%1 = call i32 @gettimeofday_op(i32 3, i32 0)
ret void
}

LLVM IR (-O2):
define void @show_timer() {
%1 = tail call i32 @gettimeofday_op(i32 3, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __syscall(int, int);
void _Exit(int ec) {
  __syscall(248, ec);
  __syscall(1, ec);
}


x86 assembly (clang, -O0):
<_Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xf8,%edi
call   1030 <__syscall@plt>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <__syscall@plt>

x86 assembly (clang, -O2):
<_Exit>:
push   %rbx
mov    %edi,%ebx
mov    $0xf8,%edi
mov    %ebx,%esi
call   1030 <__syscall@plt>
mov    $0x1,%edi
mov    %ebx,%esi
call   1030 <__syscall@plt>

LLVM IR (-O0):
define void @_Exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__syscall(i32 248, i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @__syscall(i32 1, i32 %5)
unreachable
}

LLVM IR (-O2):
define void @_Exit(i32 %0) {
%2 = tail call i32 @__syscall(i32 248, i32 %0)
%3 = tail call i32 @__syscall(i32 1, i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void oom(void) {
  fprintf(stderr, "Out of memory.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<oom>:
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):
<oom>:
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 = [16 x i8] c"Out of memory.\0A\00"
define void @oom() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Out of memory.\0A\00"
define void @oom() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void sec_getlog_supply_kloginfo(void *klog_buf) {}


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

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

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

LLVM IR (-O2):
define void @sec_getlog_supply_kloginfo(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char *getenv(char *);
char *dc_get_cfg_path(void) {
  char *path = NULL;
  path = getenv("DUO_COSIGN_CFG");
  if (path == NULL) {
    path = "./duo_cosign.cfg";
  }
  return (path);
}


x86 assembly (clang, -O0):
<dc_get_cfg_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    0xed9(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1146 <dc_get_cfg_path+0x36>
lea    0xecd(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dc_get_cfg_path>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xee8(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"DUO_COSIGN_CFG\00"
@.str.1 = [17 x i8] c"./duo_cosign.cfg\00"
define i8* @dc_get_cfg_path() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %0
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %6
6: ; preds = %5, %0
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@.str = [15 x i8] c"DUO_COSIGN_CFG\00"
@.str.1 = [17 x i8] c"./duo_cosign.cfg\00"
define i8* @dc_get_cfg_path() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ test_hex2num_alpha_lower();
int /*<<< orphan*/ test_hex2num_alpha_upper();
int /*<<< orphan*/ test_hex2num_digit();
int /*<<< orphan*/ test_parsehex_invalid();
int /*<<< orphan*/ test_parsehex_valid();
int main(void) {
  test_hex2num_digit();
  test_hex2num_alpha_lower();
  test_hex2num_alpha_upper();
  test_parsehex_valid();
  test_parsehex_invalid();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <test_hex2num_digit@plt>
mov    $0x0,%al
call   1040 <test_hex2num_alpha_lower@plt>
mov    $0x0,%al
call   1050 <test_hex2num_alpha_upper@plt>
mov    $0x0,%al
call   1030 <test_parsehex_valid@plt>
mov    $0x0,%al
call   1060 <test_parsehex_invalid@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test_hex2num_digit@plt>
xor    %eax,%eax
call   1040 <test_hex2num_alpha_lower@plt>
xor    %eax,%eax
call   1050 <test_hex2num_alpha_upper@plt>
xor    %eax,%eax
call   1030 <test_parsehex_valid@plt>
xor    %eax,%eax
call   1060 <test_parsehex_invalid@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test_hex2num_digit()
%2 = call i32 (...) @test_hex2num_alpha_lower()
%3 = call i32 (...) @test_hex2num_alpha_upper()
%4 = call i32 (...) @test_parsehex_valid()
%5 = call i32 (...) @test_parsehex_invalid()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_hex2num_digit()
%2 = tail call i32 (...) @test_hex2num_alpha_lower()
%3 = tail call i32 (...) @test_hex2num_alpha_upper()
%4 = tail call i32 (...) @test_parsehex_valid()
%5 = tail call i32 (...) @test_parsehex_invalid()
ret i32 0
}
void signal_handler(int sig) { (void)(sig); }


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

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

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

LLVM IR (-O2):
define void @signal_handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ search(char *);
int /*<<< orphan*/ str_to_lower(char *);
char toupper(char);
void look(void) {
  char palabra[80] = "however";
  str_to_lower(palabra);
  palabra[0] = toupper(palabra[0]);
  search(palabra);
}


x86 assembly (clang, -O0):
<look>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
lea    -0x50(%rbp),%rdi
call   1060 <str_to_lower@plt>
movsbl -0x50(%rbp),%edi
call   1030 <toupper@plt>
mov    %al,-0x50(%rbp)
lea    -0x50(%rbp),%rdi
call   1040 <search@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<look>:
push   %rbx
sub    $0x50,%rsp
movaps 0xf04(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe94(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <str_to_lower@plt>
movsbl (%rsp),%edi
call   1030 <toupper@plt>
mov    %al,(%rsp)
mov    %rbx,%rdi
call   1040 <search@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.look.palabra = [80 x i8] c"however\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @look() {
%1 = alloca [80 x i8]
%2 = bitcast [80 x i8]* %1 to i8*
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = call i32 @str_to_lower(i8* %3)
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%6 = load i8, i8* %5
%7 = call signext i8 @toupper(i8 signext %6)
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
store i8 %7, i8* %8
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%10 = call i32 @search(i8* %9)
ret void
}

LLVM IR (-O2):
@__const.look.palabra = [80 x i8] c"however\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @look() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @str_to_lower(i8* %2)
%4 = load i8, i8* %2
%5 = call signext i8 @toupper(i8 signext %4)
store i8 %5, i8* %2
%6 = call i32 @search(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wav2prg_set_plugin_dir(char *);
void wav2prg_set_default_plugin_dir(void) {
  wav2prg_set_plugin_dir("/usr/lib/wav2prg");
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"/usr/lib/wav2prg\00"
define void @wav2prg_set_default_plugin_dir() {
%1 = call i32 @wav2prg_set_plugin_dir(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"/usr/lib/wav2prg\00"
define void @wav2prg_set_default_plugin_dir() {
%1 = tail call i32 @wav2prg_set_plugin_dir(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int fn2();
int /*<<< orphan*/ fn3(int);
void fn1(void) {
  int z, m;
  if (1 & m)
    z = fn2();
  z = 1 == m ? z : 2 == m;
  fn3(z);
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1141 <fn1+0x21>
mov    $0x0,%al
call   1040 <fn2@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    115a <fn1+0x3a>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    116d <fn1+0x4d>
mov    $0x2,%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fn3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn1>:
xor    %edi,%edi
jmp    1030 <fn3@plt>

LLVM IR (-O0):
define void @fn1() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %2
%4 = and i32 1, %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @fn2()
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %0
%9 = load i32, i32* %2
%10 = icmp eq i32 1, %9
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = load i32, i32* %1
br label %17
13: ; preds = %8
%14 = load i32, i32* %2
%15 = icmp eq i32 2, %14
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %13, %11
%18 = phi i32 [ %12, %11 ], [ %16, %13 ]
store i32 %18, i32* %1
%19 = load i32, i32* %1
%20 = call i32 @fn3(i32 %19)
ret void
}

LLVM IR (-O2):
define void @fn1() {
%1 = tail call i32 @fn3(i32 0)
ret void
}
int scanStateVector(char *stateVector, char X) {
  int i;
  for (i = 0; i < 5; i++)
    if (stateVector[i] == X)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<scanStateVector>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x5,-0x18(%rbp)
jge    1156 <scanStateVector+0x56>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1143 <scanStateVector+0x43>
movl   $0x1,-0x4(%rbp)
jmp    115d <scanStateVector+0x5d>
jmp    1148 <scanStateVector+0x48>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <scanStateVector+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scanStateVector>:
mov    $0x1,%eax
cmp    %sil,(%rdi)
je     1125 <scanStateVector+0x25>
cmp    %sil,0x1(%rdi)
je     1125 <scanStateVector+0x25>
cmp    %sil,0x2(%rdi)
je     1125 <scanStateVector+0x25>
cmp    %sil,0x3(%rdi)
je     1125 <scanStateVector+0x25>
xor    %eax,%eax
cmp    %sil,0x4(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @scanStateVector(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, %1
br i1 %4, label %22, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, %1
br i1 %8, label %22, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, %1
br i1 %12, label %22, label %13
13: ; preds = %9
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, %1
br i1 %16, label %22, label %17
17: ; preds = %13
%18 = getelementptr inbounds i8, i8* %0, i64 4
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, %1
%21 = zext i1 %20 to i32
br label %22
22: ; preds = %17, %13, %9, %5, %2
%23 = phi i32 [ 1, %2 ], [ 1, %5 ], [ 1, %9 ], [ 1, %13 ], [ %21, %17 ]
ret i32 %23
}
/* Variables and functions */
int /*<<< orphan*/ Die(char *);
void *realloc(void *, size_t);
void *Srealloc(void *ptr, size_t size) {
  if ((ptr = realloc(ptr, size)) == NULL)
    Die("memory reallocation failure");
  return ptr;
}


x86 assembly (clang, -O0):
<Srealloc>:
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   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    1157 <Srealloc+0x37>
lea    0xeae(%rip),%rdi
call   1030 <Die@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Srealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <Srealloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <Die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"memory reallocation failure\00"
define i8* @Srealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @Die(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [28 x i8] c"memory reallocation failure\00"
define noalias i8* @Srealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @Die(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
scalar_t__ isalpha(int);
scalar_t__ isdigit(int);
int isalnum(int character) {
  return (isalpha(character) || isdigit(character));
}


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <isalnum+0x37>
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isalnum+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalpha(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @isdigit(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = tail call i64 @isalpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isdigit(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                "usage: whereis [-abmqsux] [-BMS dir ... -f] program ...\n");
  exit(EX_USAGE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"usage: whereis [-abmqsux] [-BMS dir ... -f] program ...\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"usage: whereis [-abmqsux] [-BMS dir ... -f] program ...\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int yas_adxl345_read_reg_byte(int);
int /*<<< orphan*/ yas_adxl345_write_reg_byte(int, int);
int yas_adxl345_power_down(void) {
  yas_adxl345_write_reg_byte(
      0x2d, ((yas_adxl345_read_reg_byte(0x2d) & ~0x08) | ((0) << 3)));
  return (0);
}


x86 assembly (clang, -O0):
<yas_adxl345_power_down>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2d,%edi
call   1030 <yas_adxl345_read_reg_byte@plt>
mov    %eax,%esi
and    $0xfffffff7,%esi
or     $0x0,%esi
mov    $0x2d,%edi
call   1040 <yas_adxl345_write_reg_byte@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_adxl345_power_down>:
push   %rax
mov    $0x2d,%edi
call   1030 <yas_adxl345_read_reg_byte@plt>
and    $0xfffffff7,%eax
mov    $0x2d,%edi
mov    %eax,%esi
call   1040 <yas_adxl345_write_reg_byte@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yas_adxl345_power_down() {
%1 = call i32 @yas_adxl345_read_reg_byte(i32 45)
%2 = and i32 %1, -9
%3 = or i32 %2, 0
%4 = call i32 @yas_adxl345_write_reg_byte(i32 45, i32 %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @yas_adxl345_power_down() {
%1 = tail call i32 @yas_adxl345_read_reg_byte(i32 45)
%2 = and i32 %1, -9
%3 = tail call i32 @yas_adxl345_write_reg_byte(i32 45, i32 %2)
ret i32 0
}
/* Variables and functions */
char *find_and_terminate(char *, char);
char *find_fragment(char *str) { return find_and_terminate(str, '#'); }


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

x86 assembly (clang, -O2):
<find_fragment>:
mov    $0x23,%esi
jmp    1030 <find_and_terminate@plt>

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

LLVM IR (-O2):
define i8* @find_fragment(i8* %0) {
%2 = tail call i8* @find_and_terminate(i8* %0, i8 signext 35)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, double);
char *ftoa(double n) {
  char *s = "";
  sprintf(s, "%.1f", n);
  return s;
}


x86 assembly (clang, -O0):
<ftoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xee0(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
lea    0xec8(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftoa>:
push   %rbx
lea    0xeec(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"%.1f\00"
define i8* @ftoa(double %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %0)
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
void acen(char *ptr, char *val, char *ret) {
  __atomic_exchange(ptr, val, ret, 5);
}


x86 assembly (clang, -O0):
<acen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    (%rcx),%cl
xchg   %cl,(%rdx)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<acen>:
mov    (%rsi),%al
xchg   %al,(%rdi)
mov    %al,(%rdx)
ret

LLVM IR (-O0):
define void @acen(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = load i8, i8* %8
%11 = atomicrmw xchg i8* %7, i8 %10 seq_cst
store i8 %11, i8* %9
ret void
}

LLVM IR (-O2):
define void @acen(i8* nocapture %0, i8* nocapture %1, i8* nocapture writeonly %2) {
%4 = load i8, i8* %1
%5 = atomicrmw xchg i8* %0, i8 %4 seq_cst
store i8 %5, i8* %2
ret void
}
/* Variables and functions */
void *memcpy(void *dest, const void *src, size_t count) {
  unsigned int i;
  for (i = 0; i < count; i++) {
    ((unsigned char *)dest)[i] = ((unsigned char *)src)[i];
  }
  return dest;
}


x86 assembly (clang, -O0):
<memcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%rax
jae    1146 <memcpy+0x46>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <memcpy+0x17>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy>:
mov    %rdi,%rax
test   %rdx,%rdx
je     111f <memcpy+0x1f>
xor    %edi,%edi
nopw   0x0(%rax,%rax,1)
movzbl (%rsi,%rdi,1),%ecx
mov    %cl,(%rax,%rdi,1)
add    $0x1,%edi
cmp    %rdx,%rdi
jb     1110 <memcpy+0x10>
ret

LLVM IR (-O0):
define i8* @memcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i32 0, i32* %7
br label %8
8: ; preds = %23, %3
%9 = load i32, i32* %7
%10 = zext i32 %9 to i64
%11 = load i64, i64* %6
%12 = icmp ult i64 %10, %11
br i1 %12, label %13, label %26
13: ; preds = %8
%14 = load i8*, i8** %5
%15 = load i32, i32* %7
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = load i8*, i8** %4
%20 = load i32, i32* %7
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
store i8 %18, i8* %22
br label %23
23: ; preds = %13
%24 = load i32, i32* %7
%25 = add i32 %24, 1
store i32 %25, i32* %7
br label %8
26: ; preds = %8
%27 = load i8*, i8** %4
ret i8* %27
}

LLVM IR (-O2):
define i8* @memcpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %13, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %11, %5 ], [ 0, %3 ]
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %8, i8* %9
%10 = add nuw nsw i64 %6, 1
%11 = and i64 %10, 4294967295
%12 = icmp ult i64 %11, %2
br i1 %12, label %5, label %13
13: ; preds = %5, %3
ret i8* %0
}
int TrueAtom(const char *in) {
  return (in[0] == 't' && in[1] == 'r' && in[2] == 'u' && in[3] == 'e');
}


x86 assembly (clang, -O0):
<TrueAtom>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x74,%ecx
mov    %al,-0x9(%rbp)
jne    115a <TrueAtom+0x5a>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x72,%ecx
mov    %al,-0x9(%rbp)
jne    115a <TrueAtom+0x5a>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%ecx
xor    %eax,%eax
cmp    $0x75,%ecx
mov    %al,-0x9(%rbp)
jne    115a <TrueAtom+0x5a>
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%eax
cmp    $0x65,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TrueAtom>:
xor    %eax,%eax
cmpb   $0x74,(%rdi)
jne    111c <TrueAtom+0x1c>
cmpb   $0x72,0x1(%rdi)
jne    111c <TrueAtom+0x1c>
cmpb   $0x75,0x2(%rdi)
jne    111c <TrueAtom+0x1c>
xor    %eax,%eax
cmpb   $0x65,0x3(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @TrueAtom(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 116
br i1 %3, label %4, label %17
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 114
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 117
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %0, i64 3
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 101
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %12, %8, %4, %1
%18 = phi i32 [ 0, %8 ], [ 0, %4 ], [ 0, %1 ], [ %16, %12 ]
ret i32 %18
}
/* Type definitions */
struct device {
  int dummy;
};
struct adbDevice {
  int dummy;
};

/* Variables and functions */
int compareDevice(struct device *, struct device *);
int adbCompareDevice(struct adbDevice *dev1, struct adbDevice *dev2) {
  return compareDevice((struct device *)dev1, (struct device *)dev2);
}


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

x86 assembly (clang, -O2):
<adbCompareDevice>:
jmp    1030 <compareDevice@plt>

LLVM IR (-O0):
%struct.adbDevice = type { i32 }
%struct.device = type { i32 }
define i32 @adbCompareDevice(%struct.adbDevice* %0, %struct.adbDevice* %1) {
%3 = alloca %struct.adbDevice*
%4 = alloca %struct.adbDevice*
store %struct.adbDevice* %0, %struct.adbDevice** %3
store %struct.adbDevice* %1, %struct.adbDevice** %4
%5 = load %struct.adbDevice*, %struct.adbDevice** %3
%6 = bitcast %struct.adbDevice* %5 to %struct.device*
%7 = load %struct.adbDevice*, %struct.adbDevice** %4
%8 = bitcast %struct.adbDevice* %7 to %struct.device*
%9 = call i32 @compareDevice(%struct.device* %6, %struct.device* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.adbDevice = type { i32 }
%struct.device = type { i32 }
define i32 @adbCompareDevice(%struct.adbDevice* %0, %struct.adbDevice* %1) {
%3 = bitcast %struct.adbDevice* %0 to %struct.device*
%4 = bitcast %struct.adbDevice* %1 to %struct.device*
%5 = tail call i32 @compareDevice(%struct.device* %3, %struct.device* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
void *parent(void *dummy) {
  malloc(1);
  return 0;
}


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

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

LLVM IR (-O0):
define i8* @parent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @malloc(i32 1)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @parent(i8* nocapture readnone %0) {
%2 = tail call i32 @malloc(i32 1)
ret i8* null
}
/* Variables and functions */
int _isdigit(int);
int isdigit(int c) { return _isdigit(c); }


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

x86 assembly (clang, -O2):
<isdigit>:
jmp    1030 <_isdigit@plt>

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

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = tail call i32 @_isdigit(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ wgs_gcj02_offset(double const, double const, double *,
                                    double *);
void wgs_gcj02_to_wgs84(const double mlat, const double mlng, double *lat,
                        double *lng) {
  double dlat, dlng;
  wgs_gcj02_offset(mlat, mlng, &dlat, &dlng);
  *lat = mlat - dlat;
  *lng = mlng - dlng;
}


x86 assembly (clang, -O0):
<wgs_gcj02_to_wgs84>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <wgs_gcj02_offset@plt>
movsd  -0x8(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wgs_gcj02_to_wgs84>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
lea    0x20(%rsp),%rdi
lea    0x18(%rsp),%rsi
call   1030 <wgs_gcj02_offset@plt>
movsd  0x8(%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x10(%rsp),%xmm0
subsd  0x18(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @wgs_gcj02_to_wgs84(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%11 = load double, double* %5
%12 = load double, double* %6
%13 = call i32 @wgs_gcj02_offset(double %11, double %12, double* %9, double* %10)
%14 = load double, double* %5
%15 = load double, double* %9
%16 = fsub double %14, %15
%17 = load double*, double** %7
store double %16, double* %17
%18 = load double, double* %6
%19 = load double, double* %10
%20 = fsub double %18, %19
%21 = load double*, double** %8
store double %20, double* %21
ret void
}

LLVM IR (-O2):
define void @wgs_gcj02_to_wgs84(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = alloca double
%6 = alloca double
%7 = bitcast double* %5 to i8*
%8 = bitcast double* %6 to i8*
%9 = call i32 @wgs_gcj02_offset(double %0, double %1, double* %5, double* %6)
%10 = load double, double* %5
%11 = fsub double %0, %10
store double %11, double* %2
%12 = load double, double* %6
%13 = fsub double %1, %12
store double %13, double* %3
ret void
}
/* Variables and functions */
unsigned int testPrngValue(unsigned int);
void testPrngArray(unsigned int iVal, unsigned int *aOut, int nOut) {
  int i;
  for (i = 0; i < nOut; i++) {
    aOut[i] = testPrngValue(iVal + i);
  }
}


x86 assembly (clang, -O0):
<testPrngArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115b <testPrngArray+0x4b>
mov    -0x4(%rbp),%edi
add    -0x18(%rbp),%edi
call   1030 <testPrngValue@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1129 <testPrngArray+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testPrngArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1146 <testPrngArray+0x36>
mov    %rsi,%r14
mov    %edx,%r15d
mov    %edi,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
lea    (%r12,%rbx,1),%edi
call   1030 <testPrngValue@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <testPrngArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @testPrngArray(i32 %0, i32* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = trunc i64 %8 to i32
%10 = add i32 %9, %0
%11 = tail call i32 @testPrngValue(i32 %10)
%12 = getelementptr inbounds i32, i32* %1, i64 %8
store i32 %11, i32* %12
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
/* Variables and functions */
double sdtools_exp(double);
scalar_t__ sdtools_isinepsilon(double);
double sdtools_log(double);
double sdtools_pow(double x, double y) {
  return (sdtools_isinepsilon(x) ? 0.0 : sdtools_exp(y * sdtools_log(x)));
}


x86 assembly (clang, -O0):
<sdtools_pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <sdtools_isinepsilon@plt>
cmp    $0x0,%rax
je     1163 <sdtools_pow+0x33>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    118d <sdtools_pow+0x5d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <sdtools_log@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <sdtools_exp@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdtools_pow>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1050 <sdtools_isinepsilon@plt>
test   %rax,%rax
je     1152 <sdtools_pow+0x22>
xorps  %xmm0,%xmm0
add    $0x18,%rsp
ret
movsd  0x8(%rsp),%xmm0
call   1040 <sdtools_log@plt>
mulsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
jmp    1030 <sdtools_exp@plt>

LLVM IR (-O0):
define double @sdtools_pow(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 = call i64 @sdtools_isinepsilon(double %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
br label %15
9: ; preds = %2
%10 = load double, double* %4
%11 = load double, double* %3
%12 = call double @sdtools_log(double %11)
%13 = fmul double %10, %12
%14 = call double @sdtools_exp(double %13)
br label %15
15: ; preds = %9, %8
%16 = phi double [ 0.000000e+00, %8 ], [ %14, %9 ]
ret double %16
}

LLVM IR (-O2):
define double @sdtools_pow(double %0, double %1) {
%3 = tail call i64 @sdtools_isinepsilon(double %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call double @sdtools_log(double %0)
%7 = fmul double %6, %1
%8 = tail call double @sdtools_exp(double %7)
br label %9
9: ; preds = %2, %5
%10 = phi double [ %8, %5 ], [ 0.000000e+00, %2 ]
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int pthread_cond_broadcast(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
int ert_comm_transceiver_cond_signal(pthread_cond_t *cond,
                                     pthread_mutex_t *mutex) {
  int result;
  pthread_mutex_lock(mutex);
  result = pthread_cond_broadcast(cond);
  pthread_mutex_unlock(mutex);
  return result;
}


x86 assembly (clang, -O0):
<ert_comm_transceiver_cond_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <pthread_mutex_lock@plt>
mov    -0x8(%rbp),%rdi
call   1030 <pthread_cond_broadcast@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ert_comm_transceiver_cond_signal>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <pthread_mutex_lock@plt>
mov    %r14,%rdi
call   1030 <pthread_cond_broadcast@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <pthread_mutex_unlock@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ert_comm_transceiver_cond_signal(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = call i32 @pthread_mutex_lock(i32* %6)
%8 = load i32*, i32** %3
%9 = call i32 @pthread_cond_broadcast(i32* %8)
store i32 %9, i32* %5
%10 = load i32*, i32** %4
%11 = call i32 @pthread_mutex_unlock(i32* %10)
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @ert_comm_transceiver_cond_signal(i32* %0, i32* %1) {
%3 = tail call i32 @pthread_mutex_lock(i32* %1)
%4 = tail call i32 @pthread_cond_broadcast(i32* %0)
%5 = tail call i32 @pthread_mutex_unlock(i32* %1)
ret i32 %4
}
void *test_anti_range_52(unsigned short n) {
  extern void *alloc_anti_range_52(unsigned short)
      __attribute__((alloc_size(1)));
  if ((0x7fff * 2 + 1) - 1 <= n && n <= (0x7fff * 2 + 1) - 1)
    n = (0x7fff * 2 + 1) - 1 - 1;
  return alloc_anti_range_52(n);
}


x86 assembly (clang, -O0):
<test_anti_range_52>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%ecx
mov    $0xfffe,%eax
cmp    %ecx,%eax
jg     1145 <test_anti_range_52+0x35>
movzwl -0x2(%rbp),%eax
cmp    $0xfffe,%eax
jg     1145 <test_anti_range_52+0x35>
movw   $0xfffd,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_52@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_52>:
cmp    $0xfffe,%di
mov    $0xfffd,%eax
cmove  %eax,%edi
jmp    1030 <alloc_anti_range_52@plt>

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

LLVM IR (-O2):
define i8* @test_anti_range_52(i16 zeroext %0) {
%2 = icmp eq i16 %0, -2
%3 = select i1 %2, i16 -3, i16 %0
%4 = tail call i8* @alloc_anti_range_52(i16 zeroext %3)
ret i8* %4
}