xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ erase();
int /*<<< orphan*/ refresh();
void cls() {
  erase();
  refresh();
}


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

x86 assembly (clang, -O2):
<cls>:
push   %rax
xor    %eax,%eax
call   1030 <erase@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <refresh@plt>

LLVM IR (-O0):
define void @cls() {
%1 = call i32 (...) @erase()
%2 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
define void @cls() {
%1 = tail call i32 (...) @erase()
%2 = tail call i32 (...) @refresh()
ret void
}
void lisys_memchk(void *mem) {}


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

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

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

LLVM IR (-O2):
define void @lisys_memchk(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct strbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ strbuf_add_wrapped_text(struct strbuf *, char *, int, int,
                                           int);
char *xstrndup(char const *, int);
void strbuf_add_wrapped_bytes(struct strbuf *buf, const char *data, int len,
                              int indent, int indent2, int width) {
  char *tmp = xstrndup(data, len);
  strbuf_add_wrapped_text(buf, tmp, indent, indent2, width);
  free(tmp);
}


x86 assembly (clang, -O0):
<strbuf_add_wrapped_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <xstrndup@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
call   1050 <strbuf_add_wrapped_text@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strbuf_add_wrapped_bytes>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %rdi,%rbp
mov    %rsi,%rdi
mov    %edx,%esi
call   1040 <xstrndup@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
mov    %rax,%rsi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1050 <strbuf_add_wrapped_text@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.strbuf = type { i32 }
define void @strbuf_add_wrapped_bytes(%struct.strbuf* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca %struct.strbuf*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
store %struct.strbuf* %0, %struct.strbuf** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%14 = load i8*, i8** %8
%15 = load i32, i32* %9
%16 = call i8* @xstrndup(i8* %14, i32 %15)
store i8* %16, i8** %13
%17 = load %struct.strbuf*, %struct.strbuf** %7
%18 = load i8*, i8** %13
%19 = load i32, i32* %10
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = call i32 @strbuf_add_wrapped_text(%struct.strbuf* %17, i8* %18, i32 %19, i32 %20, i32 %21)
%23 = load i8*, i8** %13
%24 = call i32 @free(i8* %23)
ret void
}

LLVM IR (-O2):
%struct.strbuf = type { i32 }
define void @strbuf_add_wrapped_bytes(%struct.strbuf* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i8* @xstrndup(i8* %1, i32 %2)
%8 = tail call i32 @strbuf_add_wrapped_text(%struct.strbuf* %0, i8* %7, i32 %3, i32 %4, i32 %5)
%9 = tail call i32 @free(i8* %7)
ret void
}
void RTThreadSetAffinity(void) {}


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

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

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

LLVM IR (-O2):
define void @RTThreadSetAffinity() {
ret void
}
/* Variables and functions */
int update_crc(int, unsigned char *, long);
unsigned long crc(unsigned char *buf, long len) {
  return (update_crc(0xffffffffL, buf, len) ^ 0xffffffffL);
}


x86 assembly (clang, -O0):
<crc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0xffffffff,%edi
call   1030 <update_crc@plt>
cltq
movabs $0xffffffff,%rcx
xor    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xffffffff,%edi
call   1030 <update_crc@plt>
movslq %eax,%rcx
mov    $0xffffffff,%eax
xor    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @crc(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 i32 @update_crc(i32 -1, i8* %5, i64 %6)
%8 = sext i32 %7 to i64
%9 = xor i64 %8, 4294967295
ret i64 %9
}

LLVM IR (-O2):
define i64 @crc(i8* %0, i64 %1) {
%3 = tail call i32 @update_crc(i32 -1, i8* %0, i64 %1)
%4 = sext i32 %3 to i64
%5 = xor i64 %4, 4294967295
ret i64 %5
}
int bad2(int x) { return __builtin_constant_p(x++); }


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

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

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

LLVM IR (-O2):
define i32 @bad2(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sw_beep_init();
int /*<<< orphan*/ sw_uartdbg_nofifo_init();
int /*<<< orphan*/ uartdbgtest_input();
int uartdbgtest(int argc, char *argv[]) {
  sw_beep_init();
  sw_uartdbg_nofifo_init();
  uartdbgtest_input();
  return 0;
}


x86 assembly (clang, -O0):
<uartdbgtest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <sw_beep_init@plt>
mov    $0x0,%al
call   1030 <sw_uartdbg_nofifo_init@plt>
mov    $0x0,%al
call   1050 <uartdbgtest_input@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uartdbgtest>:
push   %rax
xor    %eax,%eax
call   1040 <sw_beep_init@plt>
xor    %eax,%eax
call   1030 <sw_uartdbg_nofifo_init@plt>
xor    %eax,%eax
call   1050 <uartdbgtest_input@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @uartdbgtest(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @sw_beep_init()
%6 = call i32 (...) @sw_uartdbg_nofifo_init()
%7 = call i32 (...) @uartdbgtest_input()
ret i32 0
}

LLVM IR (-O2):
define i32 @uartdbgtest(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sw_beep_init()
%4 = tail call i32 (...) @sw_uartdbg_nofifo_init()
%5 = tail call i32 (...) @uartdbgtest_input()
ret i32 0
}
void ncore_deferred_do(void) {}


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

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

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

LLVM IR (-O2):
define void @ncore_deferred_do() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void print_data(void *data) { printf("%c", (char)(unsigned long)data); }


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

x86 assembly (clang, -O2):
<print_data>:
movsbl %dil,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @print_data(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i8
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %3)
ret void
}
void I444ToARGBRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @I444ToARGBRow_NEON() {
ret void
}
int test_imm_C6uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xC6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C6uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 198
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int main() {
  int u = 20;
  int v = 30;
  int w = u + v;
  int x = 10;
  int y = 40;
  int z = x + y;
  int a = y - x;
  int b = x + 5;
  int c = 6 + y;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
movl   $0x1e,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
movl   $0x28,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
store i32 20, i32* %2
store i32 30, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
store i32 %13, i32* %4
store i32 10, i32* %5
store i32 40, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = add nsw i32 %14, %15
store i32 %16, i32* %7
%17 = load i32, i32* %6
%18 = load i32, i32* %5
%19 = sub nsw i32 %17, %18
store i32 %19, i32* %8
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 5
store i32 %21, i32* %9
%22 = load i32, i32* %6
%23 = add nsw i32 6, %22
store i32 %23, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void pollen_net_transport_SingleBufferManager_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @pollen_net_transport_SingleBufferManager_targetInit__I() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void out_port(unsigned int cycle_count, uint8_t port, uint8_t data) {
  if (port == 2) {
  }
}


x86 assembly (clang, -O0):
<out_port>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    111c <out_port+0x1c>
jmp    111c <out_port+0x1c>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @out_port(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %10
9: ; preds = %3
br label %10
10: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
define void @out_port(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
scalar_t__ sqrt(int const);
int path_calc_cost(int x1, int y1, int x2, int y2) {
  const int xd = x1 - x2;
  const int yd = y1 - y2;
  return (int)sqrt(xd * xd + yd * yd);
}


x86 assembly (clang, -O0):
<path_calc_cost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
imul   -0x14(%rbp),%edi
mov    -0x18(%rbp),%eax
imul   -0x18(%rbp),%eax
add    %eax,%edi
call   1030 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_calc_cost>:
sub    %edx,%edi
sub    %ecx,%esi
imul   %edi,%edi
imul   %esi,%esi
add    %esi,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define i32 @path_calc_cost(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %9
%14 = load i32, i32* %6
%15 = load i32, i32* %8
%16 = sub nsw i32 %14, %15
store i32 %16, i32* %10
%17 = load i32, i32* %9
%18 = load i32, i32* %9
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %10
%21 = load i32, i32* %10
%22 = mul nsw i32 %20, %21
%23 = add nsw i32 %19, %22
%24 = call i64 @sqrt(i32 %23)
%25 = trunc i64 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @path_calc_cost(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = sub nsw i32 %1, %3
%7 = mul nsw i32 %5, %5
%8 = mul nsw i32 %6, %6
%9 = add nuw nsw i32 %8, %7
%10 = tail call i64 @sqrt(i32 %9)
%11 = trunc i64 %10 to i32
ret i32 %11
}
void GLUE_MOVE_STACK(void *b, int amt) {
  ((unsigned int *)b)[0] = 0x38210000 + (amt & 0xffff);
}


x86 assembly (clang, -O0):
<GLUE_MOVE_STACK>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xffff,%ecx
add    $0x38210000,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLUE_MOVE_STACK>:
movzwl %si,%eax
or     $0x38210000,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @GLUE_MOVE_STACK(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 65535
%7 = add nsw i32 941686784, %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 %7, i32* %10
ret void
}

LLVM IR (-O2):
define void @GLUE_MOVE_STACK(i8* nocapture writeonly %0, i32 %1) {
%3 = and i32 %1, 65535
%4 = or i32 %3, 941686784
%5 = bitcast i8* %0 to i32*
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
double log(double);
double genatanh(double num) { return ((0.5) * log((1.0 + num) / (1.0 - num))); }


x86 assembly (clang, -O0):
<genatanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  0xeb5(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genatanh>:
push   %rax
movsd  0xee7(%rip),%xmm2
movapd %xmm0,%xmm1
addsd  %xmm2,%xmm1
subsd  %xmm0,%xmm2
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
call   1030 <log@plt>
mulsd  0xece(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @genatanh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double 1.000000e+00, %3
%5 = load double, double* %2
%6 = fsub double 1.000000e+00, %5
%7 = fdiv double %4, %6
%8 = call double @log(double %7)
%9 = fmul double 5.000000e-01, %8
ret double %9
}

LLVM IR (-O2):
define double @genatanh(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fsub double 1.000000e+00, %0
%4 = fdiv double %2, %3
%5 = tail call double @log(double %4)
%6 = fmul double %5, 5.000000e-01
ret double %6
}
void gtk_file_chooser_get_local_only() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_get_local_only() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x87() {
  Assert_real((iscntrl(135) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              680, ("iscntrl should be 0 for 0x87"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x87\00"
define void @t_iscntrl_0x87() {
%1 = tail call i64 @iscntrl(i32 135)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 680, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(int *, int, int, int /*<<< orphan*/ *);
void log_payload_sent(int packet_num, uint8_t *buf, int length) {
  FILE *log = fopen("sent.log", "a");
  fwrite(&packet_num, sizeof(int), 1, log);
  fwrite(buf, sizeof(uint8_t), length, log);
  fclose(log);
}


x86 assembly (clang, -O0):
<log_payload_sent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xeb7(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1050 <fwrite@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x4,%esi
call   1050 <fwrite@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_payload_sent>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,0xc(%rsp)
lea    0xeb7(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbp
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %r14d,%edx
mov    %rbp,%rcx
call   1050 <fwrite@plt>
mov    %rbp,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"sent.log\00"
@.str.1 = [2 x i8] c"a\00"
define void @log_payload_sent(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
%8 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %7
%9 = load i32*, i32** %7
%10 = call i32 @fwrite(i32* %4, i32 4, i32 1, i32* %9)
%11 = load i32*, i32** %5
%12 = load i32, i32* %6
%13 = load i32*, i32** %7
%14 = call i32 @fwrite(i32* %11, i32 4, i32 %12, i32* %13)
%15 = load i32*, i32** %7
%16 = call i32 @fclose(i32* %15)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"sent.log\00"
@.str.1 = [2 x i8] c"a\00"
define void @log_payload_sent(i32 %0, i32* nocapture %1, i32 %2) {
%4 = alloca i32
store i32 %0, i32* %4
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @fwrite(i32* %4, i32 4, i32 1, i32* %5)
%7 = tail call i32 @fwrite(i32* %1, i32 4, i32 %2, i32* %5)
%8 = tail call i32 @fclose(i32* %5)
ret void
}
int see_nothing(dir, y, x)
int dir, y, x;
{
  if (!mmove(dir, &y, &x))
    return 0;
  else if (loc_symbol(y, x) == ' ')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<see_nothing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1030 <mmove@plt>
cmp    $0x0,%eax
jne    1158 <see_nothing+0x38>
movl   $0x0,-0x4(%rbp)
jmp    1181 <see_nothing+0x61>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x0,%al
call   1040 <loc_symbol@plt>
cmp    $0x20,%eax
jne    117a <see_nothing+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1181 <see_nothing+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<see_nothing>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,0xc(%rsp)
mov    %edx,0x8(%rsp)
xor    %ebx,%ebx
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1030 <mmove@plt>
test   %eax,%eax
je     115b <see_nothing+0x3b>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
xor    %eax,%eax
call   1040 <loc_symbol@plt>
xor    %ebx,%ebx
cmp    $0x20,%eax
sete   %bl
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @see_nothing(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = call i32 (i32, i32*, i32*, ...) bitcast (i32 (...)* @mmove to i32 (i32, i32*, i32*, ...)*)(i32 %8, i32* %6, i32* %7)
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %3
store i32 0, i32* %4
br label %19
12: ; preds = %3
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = call i32 (i32, i32, ...) bitcast (i32 (...)* @loc_symbol to i32 (i32, i32, ...)*)(i32 %13, i32 %14)
%16 = icmp eq i32 %15, 32
br i1 %16, label %17, label %18
17: ; preds = %12
store i32 1, i32* %4
br label %19
18: ; preds = %12
store i32 0, i32* %4
br label %19
19: ; preds = %18, %17, %11
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @see_nothing(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
store i32 %1, i32* %4
store i32 %2, i32* %5
%6 = call i32 (i32, i32*, i32*, ...) bitcast (i32 (...)* @mmove to i32 (i32, i32*, i32*, ...)*)(i32 %0, i32* %4, i32* %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %3
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 (i32, i32, ...) bitcast (i32 (...)* @loc_symbol to i32 (i32, i32, ...)*)(i32 %9, i32 %10)
%12 = icmp eq i32 %11, 32
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %8, %3
%15 = phi i32 [ 0, %3 ], [ %13, %8 ]
ret i32 %15
}
char *strlower(char *in) {
  char *p = in;
  while (*p) {
    if (*p >= 'A' && *p <= 'Z')
      *p += 'a' - 'A';
    p++;
  }
  return in;
}


x86 assembly (clang, -O0):
<strlower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <strlower+0x5a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     1149 <strlower+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     1149 <strlower+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlower+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlower>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <strlower+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <strlower+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <strlower+0x2c>
lea    -0x41(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <strlower+0x10>
add    $0x20,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <strlower+0x10>
ret

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

LLVM IR (-O2):
define i8* @strlower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x87() {
  Assert_real((isprint(135) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              680, ("isprint should be 0 for 0x87"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x87\00"
define void @t_isprint_0x87() {
%1 = tail call i64 @isprint(i32 135)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 680, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_file;

/* Variables and functions */
int scmDeviceCharacteristics(sqlite3_file *pFile) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @scmDeviceCharacteristics(i32* nocapture readnone %0) {
ret i32 0
}
void RAND_pseudo_bytes(unsigned char *p, unsigned int l) {
  unsigned int i;
  for (i = 0; i < l; i++) {
    p[i] = 'A';
  }
}


x86 assembly (clang, -O0):
<RAND_pseudo_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1137 <RAND_pseudo_bytes+0x37>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movb   $0x41,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <RAND_pseudo_bytes+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RAND_pseudo_bytes>:
test   %esi,%esi
je     1125 <RAND_pseudo_bytes+0x15>
push   %rax
mov    %esi,%edx
mov    $0x41,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @RAND_pseudo_bytes(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int __infer_nondet_int();
int isspace(int x) { return __infer_nondet_int(); }


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

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

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @__infer_nondet_int()
ret i32 %3
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *ut_calloc(size_t n, size_t sz) {
  void *p;
  if ((p = calloc(n, sz)) == NULL) {
    fprintf(stderr, "ERROR: could not allocate memory.\n");
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<ut_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    117e <ut_calloc+0x4e>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xe95(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ut_calloc>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <ut_calloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"ERROR: could not allocate memory.\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @ut_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"ERROR: could not allocate memory.\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @ut_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ getsid(int);
int main() {
  getsid(1);
  getsid(-1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <getsid@plt>
mov    $0xffffffff,%edi
call   1030 <getsid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @getsid(i32 1)
%2 = tail call i32 @getsid(i32 -1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_exit(char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
int /*<<< orphan*/ stderr;
void assert_fd(const char *name, int fd) {
  fprintf(stderr, "%s -> %d\n", name, fd);
  if (fd < 0) {
    do_exit(name);
  }
}


x86 assembly (clang, -O0):
<assert_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeba(%rip),%rsi
call   1040 <fprintf@plt>
cmpl   $0x0,-0xc(%rbp)
jge    115e <assert_fd+0x3e>
mov    -0x8(%rbp),%rdi
call   1030 <do_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   1040 <fprintf@plt>
test   %ebp,%ebp
js     114d <assert_fd+0x2d>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <do_exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"%s -> %d\0A\00"
define void @assert_fd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @do_exit(i8* %12)
br label %14
14: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"%s -> %d\0A\00"
define void @assert_fd(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%5 = icmp slt i32 %1, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @do_exit(i8* %0)
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_base(void *);
int /*<<< orphan*/ ptdump_page(void *, int /*<<< orphan*/, int);
void ptdump(void *p, int levels) { ptdump_page(p, get_base(p), levels); }


x86 assembly (clang, -O0):
<ptdump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <get_base@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0xc(%rbp),%edx
call   1030 <ptdump_page@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptdump>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <get_base@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <ptdump_page@plt>

LLVM IR (-O0):
define void @ptdump(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @get_base(i8* %6)
%8 = load i32, i32* %4
%9 = call i32 @ptdump_page(i8* %5, i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
define void @ptdump(i8* %0, i32 %1) {
%3 = tail call i32 @get_base(i8* %0)
%4 = tail call i32 @ptdump_page(i8* %0, i32 %3, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ str_splt(char, char *, char **, int, int *);
void parse_path(char *path, char **parts, int n, int *parts_count) {
  str_splt('/', path, parts, n, parts_count);
}


x86 assembly (clang, -O0):
<parse_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    $0x2f,%edi
call   1030 <str_splt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_path>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x2f,%edi
jmp    1030 <str_splt@plt>

LLVM IR (-O0):
define void @parse_path(i8* %0, i8** %1, i32 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32*
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i8**, i8*** %6
%11 = load i32, i32* %7
%12 = load i32*, i32** %8
%13 = call i32 @str_splt(i8 signext 47, i8* %9, i8** %10, i32 %11, i32* %12)
ret void
}

LLVM IR (-O2):
define void @parse_path(i8* %0, i8** %1, i32 %2, i32* %3) {
%5 = tail call i32 @str_splt(i8 signext 47, i8* %0, i8** %1, i32 %2, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_basic_path(int, double);
int main(int argc, char **argv) {
  double this_coeff;
  int pl;
  add_basic_path(pl, this_coeff);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1c(%rbp),%edi
movsd  -0x18(%rbp),%xmm0
call   1030 <add_basic_path@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add_basic_path(i32 undef, double undef)
ret i32 0
}
void mdp4_dsi_cmd_dma_busy_wait(struct msm_fb_data_type *mfd) {}


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

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

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

LLVM IR (-O2):
%struct.msm_fb_data_type = type opaque
define void @mdp4_dsi_cmd_dma_busy_wait(%struct.msm_fb_data_type* nocapture %0) {
ret void
}
int amicable(int *sums, int a) {
  int b = sums[a];
  if (a != b) {
    if (sums[a] == b && sums[b] == a) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<amicable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
je     115e <amicable+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1159 <amicable+0x59>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    1159 <amicable+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1165 <amicable+0x65>
jmp    115e <amicable+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<amicable>:
movslq %esi,%rax
movslq (%rdi,%rax,4),%rcx
cmp    %eax,%ecx
je     1115 <amicable+0x15>
mov    $0x1,%eax
cmp    %esi,(%rdi,%rcx,4)
je     1117 <amicable+0x17>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @amicable(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = icmp ne i32 %12, %13
br i1 %14, label %15, label %33
15: ; preds = %2
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32, i32* %19
%21 = load i32, i32* %6
%22 = icmp eq i32 %20, %21
br i1 %22, label %23, label %32
23: ; preds = %15
%24 = load i32*, i32** %4
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %24, i64 %26
%28 = load i32, i32* %27
%29 = load i32, i32* %5
%30 = icmp eq i32 %28, %29
br i1 %30, label %31, label %32
31: ; preds = %23
store i32 1, i32* %3
br label %34
32: ; preds = %23, %15
br label %33
33: ; preds = %32, %2
store i32 0, i32* %3
br label %34
34: ; preds = %33, %31
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @amicable(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, %1
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = sext i32 %5 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %1
br i1 %11, label %13, label %12
12: ; preds = %7, %2
br label %13
13: ; preds = %7, %12
%14 = phi i32 [ 0, %12 ], [ 1, %7 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ XKeyReleasedEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XKeyReleasedEvent(void *_p) {
  if (_p == NULL)
    abort();
  free((XKeyReleasedEvent *)_p);
}


x86 assembly (clang, -O0):
<free_XKeyReleasedEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XKeyReleasedEvent+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XKeyReleasedEvent>:
test   %rdi,%rdi
je     112a <free_XKeyReleasedEvent+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XKeyReleasedEvent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XKeyReleasedEvent(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Section4Area(float);
int /*<<< orphan*/ Section4Perim(float);
int Section4(float radius) {
  Section4Perim(radius);
  Section4Area(radius);
  return 0;
}


x86 assembly (clang, -O0):
<Section4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <Section4Perim@plt>
movss  -0x4(%rbp),%xmm0
call   1040 <Section4Area@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Section4>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <Section4Perim@plt>
movss  0x4(%rsp),%xmm0
call   1040 <Section4Area@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Section4(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @Section4Perim(float %3)
%5 = load float, float* %2
%6 = call i32 @Section4Area(float %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @Section4(float %0) {
%2 = tail call i32 @Section4Perim(float %0)
%3 = tail call i32 @Section4Area(float %0)
ret i32 0
}
/* Variables and functions */
short read_ZIGBEE_short(int);
int /*<<< orphan*/ write_ZIGBEE_short(int, short);
void start_transmit() {
  short int temp = 0;
  temp = read_ZIGBEE_short(0x1B);
  temp = temp | 0x01;
  write_ZIGBEE_short(0x1B, temp);
}


x86 assembly (clang, -O0):
<start_transmit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x0,-0x2(%rbp)
mov    $0x1b,%edi
call   1030 <read_ZIGBEE_short@plt>
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
or     $0x1,%eax
mov    %ax,-0x2(%rbp)
mov    $0x1b,%edi
movswl -0x2(%rbp),%esi
call   1040 <write_ZIGBEE_short@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_transmit>:
push   %rax
mov    $0x1b,%edi
call   1030 <read_ZIGBEE_short@plt>
or     $0x1,%eax
movswl %ax,%esi
mov    $0x1b,%edi
pop    %rax
jmp    1040 <write_ZIGBEE_short@plt>

LLVM IR (-O0):
define void @start_transmit() {
%1 = alloca i16
store i16 0, i16* %1
%2 = call signext i16 @read_ZIGBEE_short(i32 27)
store i16 %2, i16* %1
%3 = load i16, i16* %1
%4 = sext i16 %3 to i32
%5 = or i32 %4, 1
%6 = trunc i32 %5 to i16
store i16 %6, i16* %1
%7 = load i16, i16* %1
%8 = call i32 @write_ZIGBEE_short(i32 27, i16 signext %7)
ret void
}

LLVM IR (-O2):
define void @start_transmit() {
%1 = tail call signext i16 @read_ZIGBEE_short(i32 27)
%2 = or i16 %1, 1
%3 = tail call i32 @write_ZIGBEE_short(i32 27, i16 signext %2)
ret void
}