xunge/DecIR huggingface dataset:
float swapF(float val) {
  float out;
  const char *i = (const char *)&val;
  char *o = (char *)&out;
  o[3] = i[0];
  o[2] = i[1];
  o[1] = i[2];
  o[0] = i[3];
  return out;
}


x86 assembly (clang, -O0):
<swapF>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapF>:
movd   %xmm0,%eax
bswap  %eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
define float @swapF(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i8*
%5 = alloca i8*
store float %0, float* %2
%6 = bitcast float* %2 to i8*
store i8* %6, i8** %4
%7 = bitcast float* %3 to i8*
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 3
store i8 %10, i8* %12
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 2
store i8 %15, i8* %17
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8, i8* %19
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 %20, i8* %22
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 3
%25 = load i8, i8* %24
%26 = load i8*, i8** %5
%27 = getelementptr inbounds i8, i8* %26, i64 0
store i8 %25, i8* %27
%28 = load float, float* %3
ret float %28
}

LLVM IR (-O2):
define float @swapF(float %0) {
%2 = bitcast float %0 to i32
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = bitcast i32 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printInt(int i) { printf("%d\n", i); }


x86 assembly (clang, -O0):
<printInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printInt>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @printInt(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int com_stricmp(const char *str1, const char *str2) {
  return strcasecmp(str1, str2);
}


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

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

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

LLVM IR (-O2):
define i32 @com_stricmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ start();
int main() {
  start();
  sleep(1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @start()
%2 = tail call i32 @sleep(i32 1)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t is_ecx_inuse(uint32_t bitmap) { return (bitmap & (0x1 << 2)); }


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

x86 assembly (clang, -O2):
<is_ecx_inuse>:
mov    %edi,%eax
and    $0x4,%eax
ret

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

LLVM IR (-O2):
define i32 @is_ecx_inuse(i32 %0) {
%2 = and i32 %0, 4
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ process(int *, int);
int main(void) {
  int data[] = {3, 1, 4, 1, 5, 9, 2, 6, 5};
  int size = sizeof(data) / sizeof(data[0]);
  process(data, size);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
movl   $0x9,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <process@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xf06(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1030 <process@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.data = [9 x i32] [i32 3, i32 1, i32 4, i32 1, i32 5, i32 9, i32 2, i32 6, i32 5]
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [9 x i32]* %2 to i8*
store i32 9, i32* %3
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @process(i32* %5, i32 %6)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@__const.main.data = [9 x i32] [i32 3, i32 1, i32 4, i32 1, i32 5, i32 9, i32 2, i32 6, i32 5]
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @process(i32* %3, i32 9)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ swap(int *, int *);
int math_gcd(int a, int b) {
  if (a < b)
    swap(&a, &b);
  while (b > 0) {
    int t = a % b;
    a = b;
    b = t;
  }
  return a;
}


x86 assembly (clang, -O0):
<math_gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1137 <math_gcd+0x27>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <swap@plt>
jmp    113c <math_gcd+0x2c>
cmpl   $0x0,-0x8(%rbp)
jle    1161 <math_gcd+0x51>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    113c <math_gcd+0x2c>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_gcd>:
push   %rax
mov    %esi,%edx
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
cmp    %esi,%edi
jge    1132 <math_gcd+0x22>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <swap@plt>
mov    (%rsp),%edx
mov    0x4(%rsp),%edi
test   %edx,%edx
jle    1152 <math_gcd+0x42>
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%eax
mov    %edx,%edi
cltd
idiv   %edi
test   %edx,%edx
jg     1140 <math_gcd+0x30>
mov    %edi,0x4(%rsp)
mov    %edx,(%rsp)
mov    %edi,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @math_gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = icmp slt i32 %0, %1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = call i32 @swap(i32* %3, i32* %4)
%8 = load i32, i32* %4
%9 = load i32, i32* %3
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ %9, %6 ], [ %0, %2 ]
%12 = phi i32 [ %8, %6 ], [ %1, %2 ]
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %10, %14
%15 = phi i32 [ %17, %14 ], [ %12, %10 ]
%16 = phi i32 [ %15, %14 ], [ %11, %10 ]
%17 = srem i32 %16, %15
%18 = icmp sgt i32 %17, 0
br i1 %18, label %14, label %19
19: ; preds = %14
store i32 %15, i32* %3
store i32 %17, i32* %4
br label %20
20: ; preds = %19, %10
%21 = phi i32 [ %15, %19 ], [ %11, %10 ]
ret i32 %21
}
int byte_row_sjis(int byte) {
  if (byte >= 0x81 && byte < 0xa0)
    return byte - 0x81;
  else if (byte >= 0xe0)
    return byte - 0xc1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<byte_row_sjis>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x81,-0x8(%rbp)
jl     1131 <byte_row_sjis+0x31>
cmpl   $0xa0,-0x8(%rbp)
jge    1131 <byte_row_sjis+0x31>
mov    -0x8(%rbp),%eax
sub    $0x81,%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <byte_row_sjis+0x55>
cmpl   $0xe0,-0x8(%rbp)
jl     114e <byte_row_sjis+0x4e>
mov    -0x8(%rbp),%eax
sub    $0xc1,%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <byte_row_sjis+0x55>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_row_sjis>:
lea    -0xc1(%rdi),%ecx
cmp    $0xe0,%edi
mov    $0xffffffff,%eax
cmovge %ecx,%eax
lea    -0x81(%rdi),%ecx
cmp    $0x1f,%ecx
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @byte_row_sjis(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 129
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 160
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 129
store i32 %11, i32* %2
br label %19
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 224
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %3
%17 = sub nsw i32 %16, 193
store i32 %17, i32* %2
br label %19
18: ; preds = %12
store i32 -1, i32* %2
br label %19
19: ; preds = %18, %15, %9
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @byte_row_sjis(i32 %0) {
%2 = add i32 %0, -129
%3 = icmp ult i32 %2, 31
%4 = icmp sgt i32 %0, 223
%5 = add nsw i32 %0, -193
%6 = select i1 %4, i32 %5, i32 -1
%7 = select i1 %3, i32 %2, i32 %6
ret i32 %7
}
/* Variables and functions */
unsigned long htab_djb_hash(int, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
unsigned long htab_str_hash(const void *buf) {
  const char *s = buf;
  return htab_djb_hash(5381, s, strlen(s));
}


x86 assembly (clang, -O0):
<htab_str_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x1505,%edi
call   1040 <htab_djb_hash@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htab_str_hash>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    $0x1505,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <htab_djb_hash@plt>

LLVM IR (-O0):
define i64 @htab_str_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = call i64 @htab_djb_hash(i32 5381, i8* %5, i32 %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @htab_str_hash(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i64 @htab_djb_hash(i32 5381, i8* %0, i32 %2)
ret i64 %3
}
char *decfile_shortdesc(void) {
  return "decrypt Base32 encoded secrets from an input file";
}


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

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

LLVM IR (-O0):
@.str = [50 x i8] c"decrypt Base32 encoded secrets from an input file\00"
define i8* @decfile_shortdesc() {
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [50 x i8] c"decrypt Base32 encoded secrets from an input file\00"
define i8* @decfile_shortdesc() {
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0)
}
void INT_Excep_PERIA_INTA225(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIA_INTA225() {
ret void
}
/* Variables and functions */
int exp(double);
int sqrt(int);
float fun(float x) { return (1 / (sqrt(2 * 3.14156))) * exp(-0.5 * x * x); }


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x6,%edi
call   1040 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeab(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   %ecx,%eax
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
mov    $0x6,%edi
call   1040 <sqrt@plt>
lea    0x1(%rax),%ecx
xor    %ebx,%ebx
cmp    $0x3,%ecx
cmovb  %eax,%ebx
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeae(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @fun(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call i32 @sqrt(i32 6)
%4 = sdiv i32 1, %3
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = fmul double -5.000000e-01, %6
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = fmul double %7, %9
%11 = call i32 @exp(double %10)
%12 = mul nsw i32 %4, %11
%13 = sitofp i32 %12 to float
ret float %13
}

LLVM IR (-O2):
define float @fun(float %0) {
%2 = tail call i32 @sqrt(i32 6)
%3 = add i32 %2, 1
%4 = icmp ult i32 %3, 3
%5 = select i1 %4, i32 %2, i32 0
%6 = fpext float %0 to double
%7 = fmul double %6, -5.000000e-01
%8 = fmul double %7, %6
%9 = tail call i32 @exp(double %8)
%10 = mul nsw i32 %5, %9
%11 = sitofp i32 %10 to float
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ ptrace(int, int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
void set_process_flag(int flag) { ptrace(flag, 0, 0, 0); }


x86 assembly (clang, -O0):
<set_process_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <ptrace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_process_flag>:
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <ptrace@plt>

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

LLVM IR (-O2):
define void @set_process_flag(i32 %0) {
%2 = tail call i32 @ptrace(i32 %0, i32 0, i32 0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ pack_ieee754(float, int, int);
int /*<<< orphan*/ pack_int32_t(unsigned char **, int /*<<< orphan*/, int);
void pack_float(unsigned char **bp, float val, int endian) {
  uint64_t ieee754_encoded_val = (pack_ieee754((val), 32, 8));
  pack_int32_t(bp, ieee754_encoded_val, endian);
}


x86 assembly (clang, -O0):
<pack_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
mov    $0x20,%edi
mov    $0x8,%esi
call   1030 <pack_ieee754@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <pack_int32_t@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @pack_float(i8** %0, float %1, i32 %2) {
%4 = alloca i8**
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
store i8** %0, i8*** %4
store float %1, float* %5
store i32 %2, i32* %6
%8 = load float, float* %5
%9 = call i32 @pack_ieee754(float %8, i32 32, i32 8)
store i32 %9, i32* %7
%10 = load i8**, i8*** %4
%11 = load i32, i32* %7
%12 = load i32, i32* %6
%13 = call i32 @pack_int32_t(i8** %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @pack_float(i8** %0, float %1, i32 %2) {
%4 = tail call i32 @pack_ieee754(float %1, i32 32, i32 8)
%5 = tail call i32 @pack_int32_t(i8** %0, i32 %4, i32 %2)
ret void
}
void slave() {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<slave>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <slave+0x9>
jmp    1109 <slave+0x9>

x86 assembly (clang, -O2):
<slave>:
jmp    1100 <slave>

LLVM IR (-O0):
define void @slave() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @slave() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ quick_sort_int_recursive(int /*<<< orphan*/ *,
                                            int /*<<< orphan*/, int);
void quick_sort_int(int64_t arr[], int len) {
  quick_sort_int_recursive(arr, 0, len - 1);
}


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

x86 assembly (clang, -O2):
<quick_sort_int>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <quick_sort_int_recursive@plt>

LLVM IR (-O0):
define void @quick_sort_int(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = call i32 @quick_sort_int_recursive(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @quick_sort_int(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @quick_sort_int_recursive(i32* %0, i32 0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DrawTextlnXYw142(char const *, long, long, unsigned long);
void drawtextlnxyw(const char *s, long x, long y, unsigned long cfg) {
  DrawTextlnXYw142(s, x, y, cfg);
}


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

x86 assembly (clang, -O2):
<drawtextlnxyw>:
jmp    1030 <DrawTextlnXYw142@plt>

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

LLVM IR (-O2):
define void @drawtextlnxyw(i8* %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i32 @DrawTextlnXYw142(i8* %0, i64 %1, i64 %2, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_time();
int main(void) {
  int a = 222, b = 333;
  print_time();
  print_time();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xde,-0x8(%rbp)
movl   $0x14d,-0xc(%rbp)
mov    $0x0,%al
call   1030 <print_time@plt>
mov    $0x0,%al
call   1030 <print_time@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 222, i32* %2
store i32 333, i32* %3
%4 = call i32 (...) @print_time()
%5 = call i32 (...) @print_time()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @print_time()
%2 = tail call i32 (...) @print_time()
ret i32 0
}
double mfabs(double x) { return (x < 0) ? (-x) : x; }


x86 assembly (clang, -O0):
<mfabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <mfabs+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <mfabs+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @mfabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ gronkwaerawerawerwae(int);
int main() {
  int a = 3;
  gronkwaerawerawerwae(a);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @gronkwaerawerawerwae(i32 3)
ret i32 0
}
/* Variables and functions */
void scsp_shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @scsp_shutdown() {
ret void
}
int dele() { struct node *temp; }


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

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

LLVM IR (-O0):
%struct.node = type opaque
define i32 @dele() {
%1 = alloca i32
%2 = alloca %struct.node*
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
%struct.node = type opaque
define i32 @dele() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ _fail(char const *const, int const);
int /*<<< orphan*/ values_equal_display_error(unsigned long const,
                                              unsigned long const);
void _assert_int_equal(const unsigned long int a, const unsigned long int b,
                       const char *const file, const int line) {
  if (!values_equal_display_error(a, b)) {
    _fail(file, line);
  }
}


x86 assembly (clang, -O0):
<_assert_int_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <values_equal_display_error@plt>
cmp    $0x0,%eax
jne    1159 <_assert_int_equal+0x39>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <_fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assert_int_equal>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
call   1030 <values_equal_display_error@plt>
test   %eax,%eax
je     1138 <_assert_int_equal+0x18>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_fail@plt>

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

LLVM IR (-O2):
define void @_assert_int_equal(i64 %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i32 @values_equal_display_error(i64 %0, i64 %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @_fail(i8* %2, i32 %3)
br label %9
9: ; preds = %7, %4
ret void
}
/* Type definitions */
struct ev_loop {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ev_run(struct ev_loop *, int);
void ev_loop(struct ev_loop *loop, int flags) { ev_run(loop, flags); }


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

x86 assembly (clang, -O2):
<ev_loop>:
jmp    1030 <ev_run@plt>

LLVM IR (-O0):
%struct.ev_loop = type { i32 }
define void @ev_loop(%struct.ev_loop* %0, i32 %1) {
%3 = alloca %struct.ev_loop*
%4 = alloca i32
store %struct.ev_loop* %0, %struct.ev_loop** %3
store i32 %1, i32* %4
%5 = load %struct.ev_loop*, %struct.ev_loop** %3
%6 = load i32, i32* %4
%7 = call i32 @ev_run(%struct.ev_loop* %5, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.ev_loop = type { i32 }
define void @ev_loop(%struct.ev_loop* %0, i32 %1) {
%3 = tail call i32 @ev_run(%struct.ev_loop* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int O_RDWR;
int errno;
scalar_t__ fcntl(int, int /*<<< orphan*/, int);
int gs_sys_epoll_prepare_fd_for_add(int fd, int pid) {
  int flags = O_RDWR | O_NONBLOCK;
  (void)pid;
  if (fcntl(fd, F_SETFL, flags) < 0) {
    int err = errno;
    return err;
  }
  return 0;
}


x86 assembly (clang, -O0):
<gs_sys_epoll_prepare_fd_for_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%eax
mov    0x2eb2(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%edx
call   1030 <fcntl@plt>
cmp    $0x0,%rax
jge    1168 <gs_sys_epoll_prepare_fd_for_add+0x58>
mov    0x2e70(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116f <gs_sys_epoll_prepare_fd_for_add+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gs_sys_epoll_prepare_fd_for_add>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    0x2ec1(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
mov    0x2e90(%rip),%rcx
sar    $0x3f,%rax
and    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
@errno = global i32 0
define i32 @gs_sys_epoll_prepare_fd_for_add(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%8 = load i32, i32* @O_RDWR
%9 = load i32, i32* @O_NONBLOCK
%10 = or i32 %8, %9
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* @F_SETFL
%14 = load i32, i32* %6
%15 = call i64 @fcntl(i32 %12, i32 %13, i32 %14)
%16 = icmp slt i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = load i32, i32* @errno
store i32 %18, i32* %7
%19 = load i32, i32* %7
store i32 %19, i32* %3
br label %21
20: ; preds = %2
store i32 0, i32* %3
br label %21
21: ; preds = %20, %17
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
@errno = global i32 0
define i32 @gs_sys_epoll_prepare_fd_for_add(i32 %0, i32 %1) {
%3 = load i32, i32* @O_RDWR
%4 = load i32, i32* @O_NONBLOCK
%5 = or i32 %4, %3
%6 = load i32, i32* @F_SETFL
%7 = tail call i64 @fcntl(i32 %0, i32 %6, i32 %5)
%8 = icmp slt i64 %7, 0
%9 = load i32, i32* @errno
%10 = select i1 %8, i32 %9, i32 0
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, long);
void inttostr(char *str, long int in) { sprintf(str, "%ld", in); }


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

x86 assembly (clang, -O2):
<inttostr>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define void @inttostr(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 @sprintf(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %6)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define void @inttostr(i8* nocapture writeonly %0, i64 %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putbyte(int);
void onebyte(int co) { putbyte(co); }


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

x86 assembly (clang, -O2):
<onebyte>:
jmp    1030 <putbyte@plt>

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

LLVM IR (-O2):
define void @onebyte(i32 %0) {
%2 = tail call i32 @putbyte(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGSTOP;
int fact(int);
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void child() {
  kill(getpid(), SIGSTOP);
  printf("fact(5) = %d\n", fact(5));
}


x86 assembly (clang, -O0):
<child>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
call   1050 <kill@plt>
mov    $0x5,%edi
call   1060 <fact@plt>
mov    %eax,%esi
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<child>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2e91(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1050 <kill@plt>
mov    $0x5,%edi
call   1060 <fact@plt>
lea    0xe97(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@SIGSTOP = global i32 0
@.str = [14 x i8] c"fact(5) = %d\0A\00"
define void @child() {
%1 = call i32 (...) @getpid()
%2 = load i32, i32* @SIGSTOP
%3 = call i32 @kill(i32 %1, i32 %2)
%4 = call i32 @fact(i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@SIGSTOP = global i32 0
@.str = [14 x i8] c"fact(5) = %d\0A\00"
define void @child() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGSTOP
%3 = tail call i32 @kill(i32 %1, i32 %2)
%4 = tail call i32 @fact(i32 5)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
int xfuse_devredir_cb_enum_dir(void *vp, struct xrdp_inode *xinode) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.xrdp_inode = type opaque
define i32 @xfuse_devredir_cb_enum_dir(i8* %0, %struct.xrdp_inode* %1) {
%3 = alloca i8*
%4 = alloca %struct.xrdp_inode*
store i8* %0, i8** %3
store %struct.xrdp_inode* %1, %struct.xrdp_inode** %4
ret i32 0
}

LLVM IR (-O2):
%struct.xrdp_inode = type opaque
define i32 @xfuse_devredir_cb_enum_dir(i8* nocapture readnone %0, %struct.xrdp_inode* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void rtp3640_set_aac_hbr_au_index(uint8_t *header, uint8_t index) {
  header[1] &= ~0x7;
  header[1] |= index & 0x7;
}


x86 assembly (clang, -O0):
<rtp3640_set_aac_hbr_au_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
and    $0xfffffff8,%ecx
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    -0x8(%rbp),%rax
or     0x4(%rax),%ecx
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp3640_set_aac_hbr_au_index>:
mov    0x4(%rdi),%eax
and    $0xfffffff8,%eax
and    $0x7,%esi
or     %eax,%esi
mov    %esi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @rtp3640_set_aac_hbr_au_index(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
%8 = and i32 %7, -8
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = and i32 %9, 7
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = or i32 %13, %10
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @rtp3640_set_aac_hbr_au_index(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = and i32 %4, -8
%6 = and i32 %1, 7
%7 = or i32 %5, %6
store i32 %7, i32* %3
ret void
}
void termop_indexrev(struct ansiseq *s) {
  tnc_log_log(
      6, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c",
      320, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_indexrev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0x140,%r8d
lea    0xf37(%rip),%r9
lea    0xf40(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_indexrev>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf67(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0x140,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_indexrev = [16 x i8] c"termop_indexrev\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_indexrev(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 320, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.termop_indexrev, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_indexrev = [16 x i8] c"termop_indexrev\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_indexrev(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 320, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.termop_indexrev, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
int checksimd(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @checksimd() {
ret i32 0
}
void init_hidden_literals(void) {
  int i;
  for (i = 0; i < (38); i++) {
    ;
  }
}


x86 assembly (clang, -O0):
<init_hidden_literals>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x26,-0x4(%rbp)
jge    1128 <init_hidden_literals+0x28>
jmp    111a <init_hidden_literals+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <init_hidden_literals+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @init_hidden_literals() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
ind() { esc("D"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"D\00"
define i32 @ind() {
%1 = alloca i32
%2 = call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [2 x i8] c"D\00"
define i32 @ind() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long double);
void ICPrintDoubleValue(long double doubleValue) {
  printf("Double value = %Lf\n", doubleValue);
}


x86 assembly (clang, -O0):
<ICPrintDoubleValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"Double value = %Lf\0A\00"
define void @ICPrintDoubleValue(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), x86_fp80 %3)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Double value = %Lf\0A\00"
define void @ICPrintDoubleValue(x86_fp80 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), x86_fp80 %0)
ret void
}
int msg_getdst(const char *msg) { return 10 * (msg[0] - '0') + msg[1] - '0'; }


x86 assembly (clang, -O0):
<msg_getdst>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_getdst>:
movsbl (%rdi),%eax
lea    (%rax,%rax,4),%eax
movsbl 0x1(%rdi),%ecx
lea    (%rcx,%rax,2),%eax
add    $0xfffffdf0,%eax
ret

LLVM IR (-O0):
define i32 @msg_getdst(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 48
%8 = mul nsw i32 10, %7
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = add nsw i32 %8, %12
%14 = sub nsw i32 %13, 48
ret i32 %14
}

LLVM IR (-O2):
define i32 @msg_getdst(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = mul nsw i32 %3, 10
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = add nsw i32 %4, -528
%9 = add nsw i32 %8, %7
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ responseCode;

/* Variables and functions */
int /*<<< orphan*/ send(int, int *, int, int /*<<< orphan*/);
void handle_get(int fd) {
  int responseCode = 2;
  send(fd, &responseCode, sizeof(responseCode), 0);
}


x86 assembly (clang, -O0):
<handle_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_get>:
push   %rax
movl   $0x2,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @handle_get(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%4 = call i32 @send(i32 %0, i32* %2, i32 4, i32 0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rot32l11(uint32_t x) { return (x << 11) | (x >> 21); }


x86 assembly (clang, -O0):
<rot32l11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xb,%eax
mov    -0x4(%rbp),%ecx
sar    $0x15,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot32l11>:
mov    %edi,%eax
shl    $0xb,%eax
sar    $0x15,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rot32l11(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 11
%5 = load i32, i32* %2
%6 = ashr i32 %5, 21
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rot32l11(i32 %0) {
%2 = shl i32 %0, 11
%3 = ashr i32 %0, 21
%4 = or i32 %2, %3
ret i32 %4
}
int test_imm_E8int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xE8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E8int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 996432412672
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int cur_fetch() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cur_fetch() {
ret i32 0
}
void a() {
  short *b;
  short c;
  long long *d = a;
  for (;;) {
    long long *e = a;
    (*d *= *e - c) / *b ?: (*b = 0);
  }
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2ed2(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movswq -0xa(%rbp),%rcx
sub    %rcx,%rax
mov    -0x18(%rbp),%rcx
imul   (%rcx),%rax
mov    %rax,(%rcx)
mov    -0x8(%rbp),%rcx
movswq (%rcx),%rcx
cqto
idiv   %rcx
cmp    $0x0,%rax
je     1150 <a+0x50>
jmp    1159 <a+0x59>
mov    -0x8(%rbp),%rax
movw   $0x0,(%rax)
jmp    110f <a+0xf>

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @a() {
%1 = alloca i16*
%2 = alloca i16
%3 = alloca i64*
%4 = alloca i64*
store i64* bitcast (void ()* @a to i64*), i64** %3
br label %5
5: ; preds = %22, %0
store i64* bitcast (void ()* @a to i64*), i64** %4
%6 = load i64*, i64** %4
%7 = load i64, i64* %6
%8 = load i16, i16* %2
%9 = sext i16 %8 to i64
%10 = sub nsw i64 %7, %9
%11 = load i64*, i64** %3
%12 = load i64, i64* %11
%13 = mul nsw i64 %12, %10
store i64 %13, i64* %11
%14 = load i16*, i16** %1
%15 = load i16, i16* %14
%16 = sext i16 %15 to i64
%17 = sdiv i64 %13, %16
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %5
br label %22
20: ; preds = %5
%21 = load i16*, i16** %1
store i16 0, i16* %21
br label %22
22: ; preds = %20, %19
%23 = phi i64 [ %17, %19 ], [ 0, %20 ]
br label %5
}

LLVM IR (-O2):