xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char *, size_t);
char *strdup_n(char *str, size_t len) {
  if (!str || !len)
    return NULL;
  char *res;
  if ((res = malloc(len + 1)))
    memcpy(res, str, len + 1);
  return res;
}


x86 assembly (clang, -O0):
<strdup_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <strdup_n+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1153 <strdup_n+0x33>
movq   $0x0,-0x8(%rbp)
jmp    118b <strdup_n+0x6b>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1183 <strdup_n+0x63>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x1,%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup_n>:
push   %r15
push   %r14
push   %rbx
xor    %r14d,%r14d
test   %rdi,%rdi
je     115f <strdup_n+0x3f>
mov    %rsi,%rbx
test   %rsi,%rsi
je     115f <strdup_n+0x3f>
mov    %rdi,%r15
add    $0x1,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     115c <strdup_n+0x3c>
mov    %rax,%r14
mov    %rax,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
jmp    115f <strdup_n+0x3f>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strdup_n(i8* %0, i64 %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i64 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = add i64 %1, 1
%8 = tail call i8* @malloc(i64 %7)
%9 = icmp eq i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = tail call i32 @memcpy(i8* %8, i8* %0, i64 %7)
br label %12
12: ; preds = %6, %10, %2
%13 = phi i8* [ null, %2 ], [ %8, %10 ], [ null, %6 ]
ret i8* %13
}
void outl_p(unsigned int value, unsigned short port) {
  asm volatile("out"
               "l"
               " %"
               "0,%"
               "w"
               "1"
               :
               : "a"(value), "Nd"(port));
  slow_down_io();
}


x86 assembly (clang, -O0):
<outl_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x6(%rbp),%dx
out    %eax,(%dx)
mov    $0x0,%al
call   1030 <slow_down_io@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outl_p>:
mov    %esi,%edx
mov    %edi,%eax
out    %eax,(%dx)
xor    %eax,%eax
jmp    1030 <slow_down_io@plt>

LLVM IR (-O0):
define void @outl_p(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = load i16, i16* %4
%7 = call i32 (...) @slow_down_io()
ret void
}

LLVM IR (-O2):
define void @outl_p(i32 %0, i16 zeroext %1) {
tail call void asm sideeffect "outl $0,${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i16 %1)
%3 = tail call i32 (...) @slow_down_io()
ret void
}
/* Type definitions */
struct qlcnic_dcb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ qlcnic_clear_dcb_ops(struct qlcnic_dcb *);
scalar_t__ qlcnic_dcb_attach(struct qlcnic_dcb *);
void qlcnic_dcb_enable(struct qlcnic_dcb *dcb) {
  if (dcb && qlcnic_dcb_attach(dcb)) {
    qlcnic_clear_dcb_ops(dcb);
  }
}


x86 assembly (clang, -O0):
<qlcnic_dcb_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1153 <qlcnic_dcb_enable+0x33>
mov    -0x8(%rbp),%rdi
call   1030 <qlcnic_dcb_attach@plt>
cmp    $0x0,%rax
je     1153 <qlcnic_dcb_enable+0x33>
mov    -0x8(%rbp),%rdi
call   1040 <qlcnic_clear_dcb_ops@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qlcnic_dcb_enable>:
push   %rbx
test   %rdi,%rdi
je     113c <qlcnic_dcb_enable+0x1c>
mov    %rdi,%rbx
call   1030 <qlcnic_dcb_attach@plt>
test   %rax,%rax
je     113c <qlcnic_dcb_enable+0x1c>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <qlcnic_clear_dcb_ops@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.qlcnic_dcb = type { i32 }
define void @qlcnic_dcb_enable(%struct.qlcnic_dcb* %0) {
%2 = alloca %struct.qlcnic_dcb*
store %struct.qlcnic_dcb* %0, %struct.qlcnic_dcb** %2
%3 = load %struct.qlcnic_dcb*, %struct.qlcnic_dcb** %2
%4 = icmp ne %struct.qlcnic_dcb* %3, null
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load %struct.qlcnic_dcb*, %struct.qlcnic_dcb** %2
%7 = call i64 @qlcnic_dcb_attach(%struct.qlcnic_dcb* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load %struct.qlcnic_dcb*, %struct.qlcnic_dcb** %2
%11 = call i32 @qlcnic_clear_dcb_ops(%struct.qlcnic_dcb* %10)
br label %12
12: ; preds = %9, %5, %1
ret void
}

LLVM IR (-O2):
%struct.qlcnic_dcb = type { i32 }
define void @qlcnic_dcb_enable(%struct.qlcnic_dcb* %0) {
%2 = icmp eq %struct.qlcnic_dcb* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @qlcnic_dcb_attach(%struct.qlcnic_dcb* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @qlcnic_clear_dcb_ops(%struct.qlcnic_dcb* %0)
br label %8
8: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ attach_shared_memory();
int /*<<< orphan*/ create_shared_memory();
int /*<<< orphan*/ printf(char *, char *);
char *shmem_GetData();
int /*<<< orphan*/ shmem_SendData(char *, char);
main() {
  char *text;
  create_shared_memory();
  attach_shared_memory();
  while (1) {
    text = shmem_GetData();
    printf("received: %s\n", text);
    shmem_SendData(text, '!');
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <create_shared_memory@plt>
mov    $0x0,%al
call   1040 <attach_shared_memory@plt>
mov    $0x0,%al
call   1060 <shmem_GetData@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe7d(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x21,%esi
call   1030 <shmem_SendData@plt>
jmp    116d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1070 <create_shared_memory@plt>
xor    %eax,%eax
call   1040 <attach_shared_memory@plt>
lea    0xe97(%rip),%r14
nopl   0x0(%rax)
xor    %eax,%eax
call   1060 <shmem_GetData@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x21,%esi
call   1030 <shmem_SendData@plt>
jmp    1170 <main+0x20>

LLVM IR (-O0):
@.str = [14 x i8] c"received: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 (...) @create_shared_memory()
%4 = call i32 (...) @attach_shared_memory()
br label %5
5: ; preds = %0, %5
%6 = call i8* (...) @shmem_GetData()
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %2
%10 = call i32 @shmem_SendData(i8* %9, i8 signext 33)
br label %5
}

LLVM IR (-O2):
@.str = [14 x i8] c"received: %s\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @create_shared_memory()
%2 = tail call i32 (...) @attach_shared_memory()
br label %3
3: ; preds = %3, %0
%4 = tail call i8* (...) @shmem_GetData()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = tail call i32 @shmem_SendData(i8* %4, i8 signext 33)
br label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ z_streamp;

/* Variables and functions */
int deflateEnd(int /*<<< orphan*/);
__attribute__((__visibility__("default"))) int kz_deflateEnd(z_streamp strm) {
  return deflateEnd(strm);
}


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

x86 assembly (clang, -O2):
<kz_deflateEnd>:
jmp    1030 <deflateEnd@plt>

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

LLVM IR (-O2):
define i32 @kz_deflateEnd(i32 %0) {
%2 = tail call i32 @deflateEnd(i32 %0)
ret i32 %2
}
int swap_bytes(int x) {
  unsigned char a, b;
  a = x & 0xff;
  b = (x >> 8) & 0xff;
  return ((a << 8) | b);
}


x86 assembly (clang, -O0):
<swap_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x6(%rbp)
movzbl -0x5(%rbp),%eax
shl    $0x8,%eax
movzbl -0x6(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_bytes>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @swap_bytes(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 255
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i32, i32* %2
%9 = ashr i32 %8, 8
%10 = and i32 %9, 255
%11 = trunc i32 %10 to i8
store i8 %11, i8* %4
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @swap_bytes(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
const void *varyad_data(struct varyad *v) { return v; }


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

x86 assembly (clang, -O2):
<varyad_data>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.varyad = type opaque
define i8* @varyad_data(%struct.varyad* %0) {
%2 = alloca %struct.varyad*
store %struct.varyad* %0, %struct.varyad** %2
%3 = load %struct.varyad*, %struct.varyad** %2
%4 = bitcast %struct.varyad* %3 to i8*
ret i8* %4
}

LLVM IR (-O2):
%struct.varyad = type opaque
define i8* @varyad_data(%struct.varyad* readnone %0) {
%2 = bitcast %struct.varyad* %0 to i8*
ret i8* %2
}
int my_strlen(const char *str) {
  int i;
  for (i = 0; str[i]; i++)
    ;
  return (i);
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1134 <my_strlen+0x34>
jmp    1126 <my_strlen+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int Success = 0;
#pragma omp target map(from : Success)
  { Success = 1; }
  if (Success)
    printf("### Success ### \n");
  else
    printf("### Error ###\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1148 <main+0x38>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
jmp    1154 <main+0x44>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"### Success ### \0A\00"
@.str.1 = [15 x i8] c"### Error ###\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"### Success ### \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ puts(char *);
void print_usage(const char *prog) {
  printf("Usage: %s [-DsbWdlHOLC3]\n", prog);
  puts("  -D --device   device to use (default /dev/spidev1.1)\n"
       "  -s --speed    max speed (Hz)\n"
       "  -d --delay    delay (usec)\n"
       "  -b --bpw      bits per word \n"
       "  -W --numwds   numbers of words \n"
       "  -l --loop     loopback\n"
       "  -H --cpha     clock phase\n"
       "  -O --cpol     clock polarity\n"
       "  -L --lsb      least significant bit first\n"
       "  -C --cs-high  chip select active high\n"
       "  -3 --3wire    SI/SO signals shared\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: %s [-DsbWdlHOLC3]\0A\00"
@.str.1 = [386 x i8] c" -D --device device to use (default /dev/spidev1.1)\0A -s --speed max speed (Hz)\0A -d --delay delay (usec)\0A -b --bpw bits per word \0A -W --numwds numbers of words \0A -l --loop loopback\0A -H --cpha clock phase\0A -O --cpol clock polarity\0A -L --lsb least significant bit first\0A -C --cs-high chip select active high\0A -3 --3wire SI/SO signals shared\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([386 x i8], [386 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"Usage: %s [-DsbWdlHOLC3]\0A\00"
@.str.1 = [386 x i8] c" -D --device device to use (default /dev/spidev1.1)\0A -s --speed max speed (Hz)\0A -d --delay delay (usec)\0A -b --bpw bits per word \0A -W --numwds numbers of words \0A -l --loop loopback\0A -H --cpha clock phase\0A -O --cpol clock polarity\0A -L --lsb least significant bit first\0A -C --cs-high chip select active high\0A -3 --3wire SI/SO signals shared\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([386 x i8], [386 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
int is_armor() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @is_armor() {
ret i32 1
}
int Exprnode_op(int value1, int value2, int op, int flag) {
  int ret;
  if (op == 0)
    ret = value1 || value2;
  else
    ret = value1 && value2;
  return (ret);
}


x86 assembly (clang, -O0):
<Exprnode_op>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1143 <Exprnode_op+0x43>
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x15(%rbp)
jne    1133 <Exprnode_op+0x33>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
jmp    1167 <Exprnode_op+0x67>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x16(%rbp)
je     115c <Exprnode_op+0x5c>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Exprnode_op>:
test   %edx,%edx
je     1114 <Exprnode_op+0x14>
test   %edi,%edi
setne  %cl
test   %esi,%esi
setne  %al
and    %cl,%al
movzbl %al,%eax
ret
or     %edi,%esi
setne  %al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @Exprnode_op(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, 0
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = or i32 %1, %0
%8 = icmp ne i32 %7, 0
br label %13
9: ; preds = %4
%10 = icmp ne i32 %0, 0
%11 = icmp ne i32 %1, 0
%12 = and i1 %10, %11
br label %13
13: ; preds = %9, %6
%14 = phi i1 [ %8, %6 ], [ %12, %9 ]
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ caesar_decode(unsigned char *, unsigned char *, size_t,
                                 char);
unsigned char detect_key_single_line(unsigned char *, size_t);
void decode_single_line(unsigned char *ldecdata, unsigned char *lencdata,
                        size_t llen) {
  unsigned char most_frequent_char = detect_key_single_line(lencdata, llen);
  caesar_decode(ldecdata, lencdata, llen, ' ' ^ most_frequent_char);
}


x86 assembly (clang, -O0):
<decode_single_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <detect_key_single_line@plt>
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movzbl -0x19(%rbp),%eax
xor    $0x20,%eax
movsbl %al,%ecx
call   1040 <caesar_decode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_single_line>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <detect_key_single_line@plt>
xor    $0x20,%al
movsbl %al,%ecx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <caesar_decode@plt>

LLVM IR (-O0):
define void @decode_single_line(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call zeroext i8 @detect_key_single_line(i8* %8, i64 %9)
store i8 %10, i8* %7
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = load i8, i8* %7
%15 = zext i8 %14 to i32
%16 = xor i32 32, %15
%17 = trunc i32 %16 to i8
%18 = call i32 @caesar_decode(i8* %11, i8* %12, i64 %13, i8 signext %17)
ret void
}

LLVM IR (-O2):
define void @decode_single_line(i8* %0, i8* %1, i64 %2) {
%4 = tail call zeroext i8 @detect_key_single_line(i8* %1, i64 %2)
%5 = xor i8 %4, 32
%6 = tail call i32 @caesar_decode(i8* %0, i8* %1, i64 %2, i8 signext %5)
ret void
}
char *plugin_info(void) { return "PrintFrequency V1.0"; }


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

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

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

LLVM IR (-O2):
@.str = [20 x i8] c"PrintFrequency V1.0\00"
define i8* @plugin_info() {
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ cpuid(unsigned int, unsigned int *, unsigned int *,
                         unsigned int *, unsigned int *);
unsigned int cpuid_eax(unsigned int op) {
  unsigned int eax, ebx, ecx, edx;
  cpuid(op, &eax, &ebx, &ecx, &edx);
  return eax;
}


x86 assembly (clang, -O0):
<cpuid_eax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_eax>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
call   1030 <cpuid@plt>
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @cpuid_eax(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = call i32 @cpuid(i32 %0, i32* %2, i32* %3, i32* %4, i32* %5)
%11 = load i32, i32* %2
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ md_control_keybord(int);
void stop_window() {
  endwin();
  md_control_keybord(1);
}


x86 assembly (clang, -O0):
<stop_window>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <endwin@plt>
mov    $0x1,%edi
call   1030 <md_control_keybord@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_window>:
push   %rax
xor    %eax,%eax
call   1040 <endwin@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <md_control_keybord@plt>

LLVM IR (-O0):
define void @stop_window() {
%1 = call i32 (...) @endwin()
%2 = call i32 @md_control_keybord(i32 1)
ret void
}

LLVM IR (-O2):
define void @stop_window() {
%1 = tail call i32 (...) @endwin()
%2 = tail call i32 @md_control_keybord(i32 1)
ret void
}
/* Variables and functions */
int dataCheck();
int /*<<< orphan*/ disp();
int /*<<< orphan*/ getData();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ update();
int main() {
  getData();
  int status = dataCheck();
  if (status == 0)
    printf("Incorrect \n");
  else {
    disp();
    update();
    disp();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getData@plt>
mov    $0x0,%al
call   1040 <dataCheck@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    118b <main+0x3b>
lea    0xe7f(%rip),%rdi
call   1060 <printf@plt>
jmp    11a0 <main+0x50>
mov    $0x0,%al
call   1070 <disp@plt>
mov    $0x0,%al
call   1030 <update@plt>
mov    $0x0,%al
call   1070 <disp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <getData@plt>
xor    %eax,%eax
call   1040 <dataCheck@plt>
test   %eax,%eax
je     117a <main+0x2a>
xor    %eax,%eax
call   1070 <disp@plt>
xor    %eax,%eax
call   1030 <update@plt>
xor    %eax,%eax
call   1070 <disp@plt>
jmp    1186 <main+0x36>
lea    0xe7f(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Incorrect \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @getData()
%4 = call i32 (...) @dataCheck()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %13
9: ; preds = %0
%10 = call i32 (...) @disp()
%11 = call i32 (...) @update()
%12 = call i32 (...) @disp()
br label %13
13: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"Incorrect \00"
define i32 @main() {
%1 = tail call i32 (...) @getData()
%2 = tail call i32 (...) @dataCheck()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %10
6: ; preds = %0
%7 = tail call i32 (...) @disp()
%8 = tail call i32 (...) @update()
%9 = tail call i32 (...) @disp()
br label %10
10: ; preds = %6, %4
ret i32 0
}
/* Variables and functions */
char toupper(char);
void ucase(char *s) {
  for (;;) {
    if (*s == 0)
      break;
    *s = toupper(*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<ucase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1131 <ucase+0x21>
jmp    1156 <ucase+0x46>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <ucase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ucase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %9, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %3
br label %16
9: ; preds = %3
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = call signext i8 @toupper(i8 signext %11)
%13 = load i8*, i8** %2
store i8 %12, i8* %13
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %2
br label %3
16: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @ucase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
struct timeb {
  scalar_t__ millitm;
  scalar_t__ time;
};

/* Variables and functions */
int /*<<< orphan*/ ftime(struct timeb *);
double read_timer() {
  struct timeb tm;
  ftime(&tm);
  return (double)tm.time + (double)tm.millitm / 1000.0;
}


x86 assembly (clang, -O0):
<read_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
call   1030 <ftime@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xecb(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_timer>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1030 <ftime@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xecc(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeb = type { i64, i64 }
define double @read_timer() {
%1 = alloca %struct.timeb
%2 = call i32 @ftime(%struct.timeb* %1)
%3 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+03
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeb = type { i64, i64 }
define double @read_timer() {
%1 = alloca %struct.timeb
%2 = bitcast %struct.timeb* %1 to i8*
%3 = call i32 @ftime(%struct.timeb* %1)
%4 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+03
%11 = fadd double %10, %6
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ do_report(char *, char const *);
void report(const char *s, const char *userid) { do_report("trace", s); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"trace\00"
define void @report(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @do_report(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
const char *pathcon_nm8_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  case 1:
    return "i1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<pathcon_nm8_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <pathcon_nm8_name_in+0x2b>
jmp    111a <pathcon_nm8_name_in+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <pathcon_nm8_name_in+0x3b>
jmp    114b <pathcon_nm8_name_in+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathcon_nm8_name_in+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathcon_nm8_name_in+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathcon_nm8_name_in>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @pathcon_nm8_name_in(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @pathcon_nm8_name_in(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
char *b64ton(char *, double);
char *amf_encode_num(char *data, double val) {
  char *p = (char *)data;
  *p++ = 0;
  p = b64ton(p, val);
  return p;
}


x86 assembly (clang, -O0):
<amf_encode_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
call   1030 <b64ton@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<amf_encode_num>:
movb   $0x0,(%rdi)
add    $0x1,%rdi
jmp    1030 <b64ton@plt>

LLVM IR (-O0):
define i8* @amf_encode_num(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca i8*
store i8* %0, i8** %3
store double %1, double* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %5
store i8 0, i8* %7
%9 = load i8*, i8** %5
%10 = load double, double* %4
%11 = call i8* @b64ton(i8* %9, double %10)
store i8* %11, i8** %5
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
define i8* @amf_encode_num(i8* %0, double %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
store i8 0, i8* %0
%4 = tail call i8* @b64ton(i8* %3, double %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ OAL_OBTAIN_SEMAPHORE();
int /*<<< orphan*/ OAL_RELEASE_SEMAPHORE();
int spi_bulkread(void *, unsigned short, unsigned char, unsigned char *,
                 unsigned short);
int fc8150_spib_bulkread(void *hDevice, unsigned short addr,
                         unsigned char *data, unsigned short length) {
  int res;
  unsigned char command = 0x40 | 0x80;
  OAL_OBTAIN_SEMAPHORE();
  res = spi_bulkread(hDevice, addr, command, data, length);
  OAL_RELEASE_SEMAPHORE();
  return res;
}


x86 assembly (clang, -O0):
<fc8150_spib_bulkread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %cx,%ax
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
movb   $0xc0,-0x21(%rbp)
mov    $0x0,%al
call   1050 <OAL_OBTAIN_SEMAPHORE@plt>
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%dx
mov    -0x21(%rbp),%al
mov    -0x18(%rbp),%rcx
movzwl %dx,%esi
movzbl %al,%edx
movzwl -0x1a(%rbp),%r8d
call   1040 <spi_bulkread@plt>
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <OAL_RELEASE_SEMAPHORE@plt>
mov    -0x20(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc8150_spib_bulkread>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <OAL_OBTAIN_SEMAPHORE@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0xc0,%edx
mov    %r15,%rcx
mov    %r14d,%r8d
call   1040 <spi_bulkread@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <OAL_RELEASE_SEMAPHORE@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fc8150_spib_bulkread(i8* %0, i16 zeroext %1, i8* %2, i16 zeroext %3) {
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i8*
%8 = alloca i16
%9 = alloca i32
%10 = alloca i8
store i8* %0, i8** %5
store i16 %1, i16* %6
store i8* %2, i8** %7
store i16 %3, i16* %8
store i8 -64, i8* %10
%11 = call i32 (...) @OAL_OBTAIN_SEMAPHORE()
%12 = load i8*, i8** %5
%13 = load i16, i16* %6
%14 = load i8, i8* %10
%15 = load i8*, i8** %7
%16 = load i16, i16* %8
%17 = call i32 @spi_bulkread(i8* %12, i16 zeroext %13, i8 zeroext %14, i8* %15, i16 zeroext %16)
store i32 %17, i32* %9
%18 = call i32 (...) @OAL_RELEASE_SEMAPHORE()
%19 = load i32, i32* %9
ret i32 %19
}

LLVM IR (-O2):
define i32 @fc8150_spib_bulkread(i8* %0, i16 zeroext %1, i8* %2, i16 zeroext %3) {
%5 = tail call i32 (...) @OAL_OBTAIN_SEMAPHORE()
%6 = tail call i32 @spi_bulkread(i8* %0, i16 zeroext %1, i8 zeroext -64, i8* %2, i16 zeroext %3)
%7 = tail call i32 (...) @OAL_RELEASE_SEMAPHORE()
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_flttofix_int_flt(int *, float);
int xil_fpo_flttofix_int_flt(float a) {
  int res_int;
  xip_fpo_flttofix_int_flt(&res_int, a);
  return res_int;
}


x86 assembly (clang, -O0):
<xil_fpo_flttofix_int_flt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    -0x8(%rbp),%rdi
call   1030 <xip_fpo_flttofix_int_flt@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xil_fpo_flttofix_int_flt>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <xip_fpo_flttofix_int_flt@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @xil_fpo_flttofix_int_flt(float %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @xip_fpo_flttofix_int_flt(i32* %2, float %0)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
scalar_t__ rx_word(int);
void *rx_ptr(int nb_bytes) { return (void *)rx_word(nb_bytes); }


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

x86 assembly (clang, -O2):
<rx_ptr>:
jmp    1030 <rx_word@plt>

LLVM IR (-O0):
define i8* @rx_ptr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @rx_word(i32 %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @rx_ptr(i32 %0) {
%2 = tail call i64 @rx_word(i32 %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int exp(double);
double fisSigmoidMf(double x, double *params) {
  double a = params[0], c = params[1];
  return (1 / (1 + exp(-a * (x - c))));
}


x86 assembly (clang, -O0):
<fisSigmoidMf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fisSigmoidMf>:
push   %rax
movsd  (%rdi),%xmm1
xorpd  0xee3(%rip),%xmm1
subsd  0x8(%rdi),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
lea    0x1(%rax),%ecx
add    $0x2,%eax
xor    %edx,%edx
cmp    $0x3,%eax
cmovb  %ecx,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fisSigmoidMf(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double* %1, double** %4
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
store double %9, double* %5
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
store double %12, double* %6
%13 = load double, double* %5
%14 = fneg double %13
%15 = load double, double* %3
%16 = load double, double* %6
%17 = fsub double %15, %16
%18 = fmul double %14, %17
%19 = call i32 @exp(double %18)
%20 = add nsw i32 1, %19
%21 = sdiv i32 1, %20
%22 = sitofp i32 %21 to double
ret double %22
}

LLVM IR (-O2):
define double @fisSigmoidMf(double %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = fneg double %3
%7 = fsub double %0, %5
%8 = fmul double %7, %6
%9 = tail call i32 @exp(double %8)
%10 = add nsw i32 %9, 1
%11 = add i32 %9, 2
%12 = icmp ult i32 %11, 3
%13 = select i1 %12, i32 %10, i32 0
%14 = sitofp i32 %13 to double
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int squares_up_to(int);
int main(int argc, char **argv) {
  int n, result;
  n = 1052;
  result = squares_up_to(n);
  printf("There are %d square numbers less than or equal to %d.\n", result, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x41c,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <squares_up_to@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [55 x i8] c"There are %d square numbers less than or equal to %d.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1052, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @squares_up_to(i32 %8)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [55 x i8] c"There are %d square numbers less than or equal to %d.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @squares_up_to(i32 1052)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %3, i32 1052)
ret i32 0
}
/* Variables and functions */
char *gt_scan_name(char const *, char const *);
const char *_read_name(const char **current, const char *end) {
  const char *name = *current;
  *current = gt_scan_name(*current, end);
  return name;
}


x86 assembly (clang, -O0):
<_read_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gt_scan_name@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_read_name>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%r14
mov    %r14,%rdi
call   1030 <gt_scan_name@plt>
mov    %rax,(%rbx)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @_read_name(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = tail call i8* @gt_scan_name(i8* %3, i8* %1)
store i8* %4, i8** %0
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ memmove(void *, void const *, size_t);
int /*<<< orphan*/ perror(char *);
void *memdup(const void *mem, size_t size) {
  void *dup = malloc(size);
  if (dup == NULL && size != 0) {
    perror("malloc");
    exit(1);
  }
  memmove(dup, mem, size);
  return dup;
}


x86 assembly (clang, -O0):
<memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1189 <memdup+0x49>
cmpq   $0x0,-0x10(%rbp)
je     1189 <memdup+0x49>
lea    0xe86(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memmove@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <malloc@plt>
mov    %rax,%r15
test   %rbx,%rbx
je     1160 <memdup+0x20>
test   %r15,%r15
je     1177 <memdup+0x37>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memmove@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe82(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define i8* @memdup(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
%11 = tail call i32 @memmove(i8* %3, i8* %0, i64 %1)
ret i8* %3
}
stime(p) long *p;
{ return _xstime(*p); }


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

x86 assembly (clang, -O2):
<stime>:
mov    (%rdi),%rdi
xor    %eax,%eax
jmp    1030 <_xstime@plt>

LLVM IR (-O0):
define i32 @stime(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = call i32 (i64, ...) bitcast (i32 (...)* @_xstime to i32 (i64, ...)*)(i64 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @stime(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = tail call i32 (i64, ...) bitcast (i32 (...)* @_xstime to i32 (i64, ...)*)(i64 %2)
ret i32 %3
}