xunge/DecIR huggingface dataset:
/* Type definitions */
struct pasm_line {
  int dummy;
};
struct pasm_instr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pasm_error(int, char *);
void pasm_translate_function(struct pasm_line *pline,
                             struct pasm_instr *instr) {
  pasm_error(999, "function not yet supported");
}


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

x86 assembly (clang, -O2):
<pasm_translate_function>:
lea    0xee9(%rip),%rsi
mov    $0x3e7,%edi
jmp    1030 <pasm_error@plt>

LLVM IR (-O0):
%struct.pasm_line = type { i32 }
%struct.pasm_instr = type { i32 }
@.str = [27 x i8] c"function not yet supported\00"
define void @pasm_translate_function(%struct.pasm_line* %0, %struct.pasm_instr* %1) {
%3 = alloca %struct.pasm_line*
%4 = alloca %struct.pasm_instr*
store %struct.pasm_line* %0, %struct.pasm_line** %3
store %struct.pasm_instr* %1, %struct.pasm_instr** %4
%5 = call i32 @pasm_error(i32 999, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.pasm_line = type { i32 }
%struct.pasm_instr = type { i32 }
@.str = [27 x i8] c"function not yet supported\00"
define void @pasm_translate_function(%struct.pasm_line* nocapture readnone %0, %struct.pasm_instr* nocapture readnone %1) {
%3 = tail call i32 @pasm_error(i32 999, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_auto_mark_mbr(long);
void init_auto_mark_all_mbr(void) {
  long i;
  for (i = 0; i < 64; i++)
    init_auto_mark_mbr(i);
}


x86 assembly (clang, -O0):
<init_auto_mark_all_mbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
cmpq   $0x40,-0x8(%rbp)
jge    1145 <init_auto_mark_all_mbr+0x35>
mov    -0x8(%rbp),%rdi
call   1030 <init_auto_mark_mbr@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <init_auto_mark_all_mbr+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_auto_mark_all_mbr>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <init_auto_mark_mbr@plt>
add    $0x1,%rbx
cmp    $0x40,%rbx
jne    1120 <init_auto_mark_all_mbr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @init_auto_mark_all_mbr() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @init_auto_mark_mbr(i64 %2)
%4 = add nuw nsw i64 %2, 1
%5 = icmp eq i64 %4, 64
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
unsigned xrop3_111_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ S;
  stk2 = ~stk2;
  stk1 = T & stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_111_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_111_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
mov    %ecx,%eax
xor    $0xffffff00,%eax
and    %edx,%eax
or     %ecx,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_111_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %7
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = xor i32 %30, -1
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = and i32 %36, %37
%39 = or i32 %35, %38
ret i32 %39
}

LLVM IR (-O2):
define i32 @xrop3_111_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -256
%8 = and i32 %6, %7
%9 = or i32 %8, %4
%10 = xor i32 %9, -1
%11 = or i32 %10, %3
ret i32 %11
}
/* Variables and functions */
scalar_t__ isPrime(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int);
int main(int argc, const char *argv[]) {
  unsigned int n = 0;
  unsigned int i = 1;
  while (n < 10001) {
    if (isPrime(++i)) {
      n++;
    }
  }
  printf("%d\n", i);
  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   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
cmpl   $0x2711,-0x14(%rbp)
jae    1177 <main+0x57>
mov    -0x18(%rbp),%edi
add    $0x1,%edi
mov    %edi,-0x18(%rbp)
call   1040 <isPrime@plt>
cmp    $0x0,%rax
je     1172 <main+0x52>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <main+0x24>
mov    -0x18(%rbp),%esi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    %ebx,%edi
call   1040 <isPrime@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
cmp    $0x2711,%ebp
jb     1130 <main+0x10>
lea    0xeb0(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%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 0, i32* %6
store i32 1, i32* %7
br label %8
8: ; preds = %19, %2
%9 = load i32, i32* %6
%10 = icmp ult i32 %9, 10001
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load i32, i32* %7
%13 = add i32 %12, 1
store i32 %13, i32* %7
%14 = call i64 @isPrime(i32 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %11
%17 = load i32, i32* %6
%18 = add i32 %17, 1
store i32 %18, i32* %6
br label %19
19: ; preds = %16, %11
br label %8
20: ; preds = %8
%21 = load i32, i32* %7
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 1, %2 ], [ %6, %3 ]
%5 = phi i32 [ 0, %2 ], [ %10, %3 ]
%6 = add i32 %4, 1
%7 = tail call i64 @isPrime(i32 %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
%10 = add nuw nsw i32 %5, %9
%11 = icmp ult i32 %10, 10001
br i1 %11, label %3, label %12
12: ; preds = %3
%13 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print(int **, int, int);
int main() {
  int a[3][3] = {{0}};
  print(a, 3, 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x24,%edx
call   1030 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    $0x3,%edx
mov    %edx,%esi
call   1040 <print@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x20(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   1030 <print@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [3 x [3 x i32]]
%2 = bitcast [3 x [3 x i32]]* %1 to i8*
%3 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 0
%4 = bitcast [3 x i32]* %3 to i32**
%5 = call i32 @print(i32** %4, i32 3, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [3 x [3 x i32]]
%2 = bitcast [3 x [3 x i32]]* %1 to i8*
%3 = bitcast [3 x [3 x i32]]* %1 to i32**
%4 = call i32 @print(i32** %3, i32 3, i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ INT_MAX;
int /*<<< orphan*/ INT_MIN;
int /*<<< orphan*/ itoa(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char s[32];
  itoa(INT_MAX, s);
  printf("%s\n", s);
  itoa(INT_MIN, s);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    -0x30(%rbp),%rsi
call   1040 <itoa@plt>
lea    -0x30(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    -0x30(%rbp),%rsi
call   1040 <itoa@plt>
lea    -0x30(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <itoa@plt>
lea    0xebe(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1040 <itoa@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@INT_MIN = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [32 x i8]
store i32 0, i32* %1
%3 = load i32, i32* @INT_MAX
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%5 = call i32 @itoa(i32 %3, i8* %4)
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @INT_MIN
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%10 = call i32 @itoa(i32 %8, i8* %9)
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@INT_MAX = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@INT_MIN = global i32 0
define i32 @main() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @INT_MAX
%4 = call i32 @itoa(i32 %3, i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = load i32, i32* @INT_MIN
%7 = call i32 @itoa(i32 %6, i8* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SPI0_transfer(int);
int /*<<< orphan*/ delay(int);
void adt7310_initialize(void) {
  SPI0_transfer(0xFF);
  SPI0_transfer(0xFF);
  SPI0_transfer(0xFF);
  SPI0_transfer(0xFF);
  delay(50);
  SPI0_transfer((0x01 << 3) | (0x00 << 6));
  SPI0_transfer(0x80);
}


x86 assembly (clang, -O0):
<adt7310_initialize>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff,%edi
call   1030 <SPI0_transfer@plt>
mov    $0xff,%edi
call   1030 <SPI0_transfer@plt>
mov    $0xff,%edi
call   1030 <SPI0_transfer@plt>
mov    $0xff,%edi
call   1030 <SPI0_transfer@plt>
mov    $0x32,%edi
call   1040 <delay@plt>
mov    $0x8,%edi
call   1030 <SPI0_transfer@plt>
mov    $0x80,%edi
call   1030 <SPI0_transfer@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adt7310_initialize>:
push   %rax
mov    $0xff,%edi
call   1030 <SPI0_transfer@plt>
mov    $0xff,%edi
call   1030 <SPI0_transfer@plt>
mov    $0xff,%edi
call   1030 <SPI0_transfer@plt>
mov    $0xff,%edi
call   1030 <SPI0_transfer@plt>
mov    $0x32,%edi
call   1040 <delay@plt>
mov    $0x8,%edi
call   1030 <SPI0_transfer@plt>
mov    $0x80,%edi
pop    %rax
jmp    1030 <SPI0_transfer@plt>

LLVM IR (-O0):
define void @adt7310_initialize() {
%1 = call i32 @SPI0_transfer(i32 255)
%2 = call i32 @SPI0_transfer(i32 255)
%3 = call i32 @SPI0_transfer(i32 255)
%4 = call i32 @SPI0_transfer(i32 255)
%5 = call i32 @delay(i32 50)
%6 = call i32 @SPI0_transfer(i32 8)
%7 = call i32 @SPI0_transfer(i32 128)
ret void
}

LLVM IR (-O2):
define void @adt7310_initialize() {
%1 = tail call i32 @SPI0_transfer(i32 255)
%2 = tail call i32 @SPI0_transfer(i32 255)
%3 = tail call i32 @SPI0_transfer(i32 255)
%4 = tail call i32 @SPI0_transfer(i32 255)
%5 = tail call i32 @delay(i32 50)
%6 = tail call i32 @SPI0_transfer(i32 8)
%7 = tail call i32 @SPI0_transfer(i32 128)
ret void
}
int ft_strlen(char *str) {
  int count;
  count = 0;
  while ((*str) != '\0') {
    count = count + 1;
    str = str + 1;
  }
  return (count);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <ft_strlen+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <ft_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
cmpb   $0x0,(%rdi)
je     111c <ft_strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <ft_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_strlen(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 i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%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
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, size_t);
void _concat(char **dest, char *src, size_t n) {
  memcpy(*dest, src, n);
  *dest += n;
}


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

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

LLVM IR (-O0):
define void @_concat(i8** %0, i8* %1, i64 %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i64
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @memcpy(i8* %8, i8* %9, i64 %10)
%12 = load i64, i64* %6
%13 = load i8**, i8*** %4
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8, i8* %14, i64 %12
store i8* %15, i8** %13
ret void
}

LLVM IR (-O2):
define void @_concat(i8** nocapture %0, i8* %1, i64 %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @memcpy(i8* %4, i8* %1, i64 %2)
%6 = load i8*, i8** %0
%7 = getelementptr inbounds i8, i8* %6, i64 %2
store i8* %7, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testsize(int, int, int, int, int);
int main() {
  testsize(32, 32, 3, 3, 3);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @testsize(i32 32, i32 32, i32 3, i32 3, i32 3)
ret i32 0
}
/* Variables and functions */
scalar_t__ getpid();
int getSeed(void) { return (int)getpid(); }


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

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

LLVM IR (-O0):
define i32 @getSeed() {
%1 = call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @getSeed() {
%1 = tail call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
ret i32 %2
}
void code_chanRedir(char *parameters) {}


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

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

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

LLVM IR (-O2):
define void @code_chanRedir(i8* nocapture %0) {
ret void
}
void OCSP_REQUEST_free(void) {}


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

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

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

LLVM IR (-O2):
define void @OCSP_REQUEST_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ signalFaultInterrupt();
void MyFaultISR() {
  signalFaultInterrupt();
  while (true) {
  }
}


x86 assembly (clang, -O0):
<MyFaultISR>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <signalFaultInterrupt@plt>
jmp    111b <MyFaultISR+0xb>

x86 assembly (clang, -O2):
<MyFaultISR>:
push   %rax
xor    %eax,%eax
call   1030 <signalFaultInterrupt@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <MyFaultISR+0x10>

LLVM IR (-O0):
define void @MyFaultISR() {
%1 = call i32 (...) @signalFaultInterrupt()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @MyFaultISR() {
%1 = tail call i32 (...) @signalFaultInterrupt()
br label %2
2: ; preds = %0, %2
br label %2
}
/* Type definitions */
struct queue {
  int dummy;
};

/* Variables and functions */
scalar_t__ queue_shift(struct queue *);
void flush_queue(struct queue *q) {
  while (queue_shift(q)) {
  };
}


x86 assembly (clang, -O0):
<flush_queue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <queue_shift@plt>
cmp    $0x0,%rax
je     1134 <flush_queue+0x24>
jmp    111c <flush_queue+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_queue>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <queue_shift@plt>
test   %rax,%rax
jne    1120 <flush_queue+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.queue = type { i32 }
define void @flush_queue(%struct.queue* %0) {
%2 = alloca %struct.queue*
store %struct.queue* %0, %struct.queue** %2
br label %3
3: ; preds = %7, %1
%4 = load %struct.queue*, %struct.queue** %2
%5 = call i64 @queue_shift(%struct.queue* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.queue = type { i32 }
define void @flush_queue(%struct.queue* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 @queue_shift(%struct.queue* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
/* Type definitions */
struct rbtree {
  int dummy;
};
struct rbnode {
  int dummy;
};

/* Variables and functions */
struct rbnode *z_rb_get_minmax(struct rbtree *, unsigned int);
struct rbnode *rb_get_min(struct rbtree *tree) {
  return z_rb_get_minmax(tree, 0U);
}


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

x86 assembly (clang, -O2):
<rb_get_min>:
xor    %esi,%esi
jmp    1030 <z_rb_get_minmax@plt>

LLVM IR (-O0):
%struct.rbnode = type { i32 }
%struct.rbtree = type { i32 }
define %struct.rbnode* @rb_get_min(%struct.rbtree* %0) {
%2 = alloca %struct.rbtree*
store %struct.rbtree* %0, %struct.rbtree** %2
%3 = load %struct.rbtree*, %struct.rbtree** %2
%4 = call %struct.rbnode* @z_rb_get_minmax(%struct.rbtree* %3, i32 0)
ret %struct.rbnode* %4
}

LLVM IR (-O2):
%struct.rbnode = type { i32 }
%struct.rbtree = type { i32 }
define %struct.rbnode* @rb_get_min(%struct.rbtree* %0) {
%2 = tail call %struct.rbnode* @z_rb_get_minmax(%struct.rbtree* %0, i32 0)
ret %struct.rbnode* %2
}
void av_fast_padded_malloc() {}


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

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

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

LLVM IR (-O2):
define void @av_fast_padded_malloc() {
ret void
}
void ff_hevc_put_hevc_bi_qpel_v64_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_v64_8_sse4() {
ret void
}
/* Variables and functions */
char *malloc(int);
char *strchr(char *, char);
char *strrchr(char *, char);
int main(int argc, char *argv[]) {
  char *s, *a, *b;
  s = malloc(sizeof(char));
  a = strchr(s, '1');
  b = strrchr(s, '1');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x31,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x31,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i8* @malloc(i32 1)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = call i8* @strchr(i8* %10, i8 signext 49)
store i8* %11, i8** %7
%12 = load i8*, i8** %6
%13 = call i8* @strrchr(i8* %12, i8 signext 49)
store i8* %13, i8** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, long);
const char *ekg_itoa(long int i) {
  static char bufs[10][16];
  static int index = 0;
  char *tmp = bufs[index++];
  if (index > 9)
    index = 0;
  snprintf(tmp, 16, "%ld", i);
  return tmp;
}


x86 assembly (clang, -O0):
<ekg_itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2fbe(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2fb3(%rip)
movslq %eax,%rcx
lea    0x2f09(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x9,0x2f97(%rip)
jle    1159 <ekg_itoa+0x49>
movl   $0x0,0x2f87(%rip)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x10,%esi
lea    0xe93(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ekg_itoa>:
push   %rbx
mov    %rdi,%rcx
movslq 0x2fc5(%rip),%rax
lea    0x1(%rax),%edx
mov    %rax,%rsi
shl    $0x4,%rsi
lea    0x2f14(%rip),%rbx
add    %rsi,%rbx
xor    %esi,%esi
cmp    $0x9,%rax
cmovl  %edx,%esi
mov    %esi,0x2fa2(%rip)
lea    0xebb(%rip),%rdx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ekg_itoa.bufs = internal global [10 x [16 x i8]] zeroinitializer
@ekg_itoa.index = internal global i32 0
@.str = [4 x i8] c"%ld\00"
define i8* @ekg_itoa(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i32, i32* @ekg_itoa.index
%5 = add nsw i32 %4, 1
store i32 %5, i32* @ekg_itoa.index
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds [10 x [16 x i8]], [10 x [16 x i8]]* @ekg_itoa.bufs, i64 0, i64 %6
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
store i8* %8, i8** %3
%9 = load i32, i32* @ekg_itoa.index
%10 = icmp sgt i32 %9, 9
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 0, i32* @ekg_itoa.index
br label %12
12: ; preds = %11, %1
%13 = load i8*, i8** %3
%14 = load i64, i64* %2
%15 = call i32 @snprintf(i8* %13, i32 16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@ekg_itoa.bufs = internal global [10 x [16 x i8]] zeroinitializer
@ekg_itoa.index = internal unnamed_addr global i32 0
@.str = [4 x i8] c"%ld\00"
define i8* @ekg_itoa(i64 %0) {
%2 = load i32, i32* @ekg_itoa.index
%3 = add nsw i32 %2, 1
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds [10 x [16 x i8]], [10 x [16 x i8]]* @ekg_itoa.bufs, i64 0, i64 %4, i64 0
%6 = icmp sgt i32 %2, 8
%7 = select i1 %6, i32 0, i32 %3
store i32 %7, i32* @ekg_itoa.index
%8 = tail call i32 @snprintf(i8* %5, i32 16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i8* %5
}
double _F_R_BETA(const double rr, const double Dx, const double beta,
                 const double L_domain) {
  const double r = rr / Dx;
}


x86 assembly (clang, -O0):
<_F_R_BETA>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @_F_R_BETA(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fdiv double %11, %12
store double %13, double* %10
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @_F_R_BETA(double %0, double %1, double %2, double %3) {
ret double undef
}
/* Variables and functions */
long long ceil(double);
void ceil_l_d(double *source, long long *dest) { *dest = ceil(*source); }


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

x86 assembly (clang, -O2):
<ceil_l_d>:
push   %rbx
mov    %rsi,%rbx
movsd  (%rdi),%xmm0
call   1030 <ceil@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @ceil_l_d(double* %0, i64* %1) {
%3 = alloca double*
%4 = alloca i64*
store double* %0, double** %3
store i64* %1, i64** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = call i64 @ceil(double %6)
%8 = load i64*, i64** %4
store i64 %7, i64* %8
ret void
}

LLVM IR (-O2):
define void @ceil_l_d(double* nocapture %0, i64* nocapture writeonly %1) {
%3 = load double, double* %0
%4 = tail call i64 @ceil(double %3)
store i64 %4, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_proplist_get() {
  printf("NOT IMPLEMENTED:"
         "pa_proplist_get"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_proplist_get\00"
define i32 @pa_proplist_get() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ mergetSort_(int *, int /*<<< orphan*/, int);
void mergeSort(int a[], int size) { mergetSort_(a, 0, size - 1); }


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

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

LLVM IR (-O0):
define void @mergeSort(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 @mergetSort_(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @mergeSort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @mergetSort_(i32* %0, i32 0, i32 %3)
ret void
}
extern char *strcat(char *dest, const char *src) {
  char *tmp = dest;
  while (*dest)
    dest++;
  while ((*dest++ = *src++))
    ;
  return tmp;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strcat+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcat+0x14>
jmp    1137 <strcat+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1166 <strcat+0x66>
jmp    1137 <strcat+0x37>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

LLVM IR (-O0):
define i8* @strcat(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
store i8* %6, i8** %5
br label %7
7: ; preds = %11, %2
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
br label %7
14: ; preds = %7
br label %15
15: ; preds = %22, %14
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
%18 = load i8, i8* %16
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
store i8 %18, i8* %19
%21 = icmp ne i8 %18, 0
br i1 %21, label %22, label %23
22: ; preds = %15
br label %15
23: ; preds = %15
%24 = load i8*, i8** %5
ret i8* %24
}

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Type definitions */
struct Queue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dequeue(struct Queue *);
int /*<<< orphan*/ free(struct Queue *);
scalar_t__ queue_has_more_items(struct Queue *);
void queue_destroy(struct Queue *queue) {
  if (queue == NULL)
    return;
  while (queue_has_more_items(queue))
    dequeue(queue);
  free(queue);
}


x86 assembly (clang, -O0):
<queue_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114c <queue_destroy+0x1c>
jmp    117b <queue_destroy+0x4b>
jmp    1151 <queue_destroy+0x21>
mov    -0x8(%rbp),%rdi
call   1040 <queue_has_more_items@plt>
cmp    $0x0,%rax
je     1172 <queue_destroy+0x42>
mov    -0x8(%rbp),%rdi
call   1050 <dequeue@plt>
jmp    1151 <queue_destroy+0x21>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<queue_destroy>:
test   %rdi,%rdi
je     1160 <queue_destroy+0x30>
push   %rbx
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <queue_has_more_items@plt>
test   %rax,%rax
je     1157 <queue_destroy+0x27>
mov    %rbx,%rdi
call   1050 <dequeue@plt>
jmp    1140 <queue_destroy+0x10>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.Queue = type { i32 }
define void @queue_destroy(%struct.Queue* %0) {
%2 = alloca %struct.Queue*
store %struct.Queue* %0, %struct.Queue** %2
%3 = load %struct.Queue*, %struct.Queue** %2
%4 = icmp eq %struct.Queue* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %17
6: ; preds = %1
br label %7
7: ; preds = %11, %6
%8 = load %struct.Queue*, %struct.Queue** %2
%9 = call i64 @queue_has_more_items(%struct.Queue* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load %struct.Queue*, %struct.Queue** %2
%13 = call i32 @dequeue(%struct.Queue* %12)
br label %7
14: ; preds = %7
%15 = load %struct.Queue*, %struct.Queue** %2
%16 = call i32 @free(%struct.Queue* %15)
br label %17
17: ; preds = %14, %5
ret void
}

LLVM IR (-O2):
%struct.Queue = type { i32 }
define void @queue_destroy(%struct.Queue* %0) {
%2 = icmp eq %struct.Queue* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = tail call i64 @queue_has_more_items(%struct.Queue* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3, %6
%7 = tail call i32 @dequeue(%struct.Queue* %0)
%8 = tail call i64 @queue_has_more_items(%struct.Queue* %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %6
10: ; preds = %6, %3
%11 = tail call i32 @free(%struct.Queue* %0)
br label %12
12: ; preds = %1, %10
ret void
}
void POLICY_MAPPING_free(void) {}


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

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

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

LLVM IR (-O2):
define void @POLICY_MAPPING_free() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
size_t writeFLVBool(FILE *fp, int value) {
  size_t datasize = 0;
  unsigned char b;
  b = (value & 1);
  datasize += fwrite(&b, 1, 1, fp);
  return datasize;
}


x86 assembly (clang, -O0):
<writeFLVBool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x19(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeFLVBool>:
push   %rax
mov    %rdi,%rcx
and    $0x1,%sil
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @writeFLVBool(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i64
%6 = alloca i8
store i32* %0, i32** %3
store i32 %1, i32* %4
store i64 0, i64* %5
%7 = load i32, i32* %4
%8 = and i32 %7, 1
%9 = trunc i32 %8 to i8
store i8 %9, i8* %6
%10 = load i32*, i32** %3
%11 = call i64 @fwrite(i8* %6, i32 1, i32 1, i32* %10)
%12 = load i64, i64* %5
%13 = add i64 %12, %11
store i64 %13, i64* %5
%14 = load i64, i64* %5
ret i64 %14
}

LLVM IR (-O2):
define i64 @writeFLVBool(i32* nocapture %0, i32 %1) {
%3 = alloca i8
%4 = trunc i32 %1 to i8
%5 = and i8 %4, 1
store i8 %5, i8* %3
%6 = call i64 @fwrite(i8* %3, i32 1, i32 1, i32* %0)
ret i64 %6
}
long double acosl(long double x) {
  long double res;
  asm("fld	%%st\n\t"
      "fmul	%%st(0)\n\t"
      "fld1\n\t"
      "fsubp\n\t"
      "fsqrt\n\t"
      "fxch	%%st(1)\n\t"
      "fpatan"
      : "=t"(res)
      : "0"(x)
      : "st(1)");
  return res;
}


x86 assembly (clang, -O0):
<acosl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fld    %st(0)
fmul   %st(0),%st
fld1
fsubp  %st,%st(1)
fsqrt
fxch   %st(1)
fpatan
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<acosl>:
fldt   0x8(%rsp)
fld    %st(0)
fmul   %st(0),%st
fld1
fsubp  %st,%st(1)
fsqrt
fxch   %st(1)
fpatan
ret

LLVM IR (-O0):
define x86_fp80 @acosl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = call x86_fp80 asm "fld\09%st\0A\09fmul\09%st(0)\0A\09fld1\0A\09fsubp\0A\09fsqrt\0A\09fxch\09%st(1)\0A\09fpatan", "={st},0,~{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %4)
store x86_fp80 %5, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @acosl(x86_fp80 %0) {
%2 = tail call x86_fp80 asm "fld\09%st\0A\09fmul\09%st(0)\0A\09fld1\0A\09fsubp\0A\09fsqrt\0A\09fxch\09%st(1)\0A\09fpatan", "={st},0,~{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
size_t int_bad_hash(const void *x, void *context) {
  (void)context;
  (void)x;
  return 1337;
}


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

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

LLVM IR (-O0):
define i64 @int_bad_hash(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
ret i64 1337
}

LLVM IR (-O2):
define i64 @int_bad_hash(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i64 1337
}
/* Variables and functions */
unsigned int reg_read32(int);
int /*<<< orphan*/ reg_write32(int, unsigned int);
void pic_enableirq(unsigned int irq) {
  reg_write32(0x14000008, reg_read32(0x14000008) & irq);
}


x86 assembly (clang, -O0):
<pic_enableirq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x14000008,%edi
call   1030 <reg_read32@plt>
mov    %eax,%esi
and    -0x4(%rbp),%esi
mov    $0x14000008,%edi
call   1040 <reg_write32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic_enableirq>:
push   %rbx
mov    %edi,%ebx
mov    $0x14000008,%edi
call   1030 <reg_read32@plt>
and    %eax,%ebx
mov    $0x14000008,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <reg_write32@plt>

LLVM IR (-O0):
define void @pic_enableirq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @reg_read32(i32 335544328)
%4 = load i32, i32* %2
%5 = and i32 %3, %4
%6 = call i32 @reg_write32(i32 335544328, i32 %5)
ret void
}

LLVM IR (-O2):
define void @pic_enableirq(i32 %0) {
%2 = tail call i32 @reg_read32(i32 335544328)
%3 = and i32 %2, %0
%4 = tail call i32 @reg_write32(i32 335544328, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_packet(int);
int init_sniff(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  int sock;
  printf("Sniff ETH0\n Truff & Lionel PRAT & Descript\n");
  sock = init_sniff("eth0");
  get_packet(sock);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1040 <init_sniff@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <get_packet@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1040 <init_sniff@plt>
mov    %eax,%edi
call   1050 <get_packet@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Sniff ETH0\0A Truff & Lionel PRAT & Descript\0A\00"
@.str.1 = [5 x i8] c"eth0\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @init_sniff(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @get_packet(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"eth0\00"
@str = [43 x i8] c"Sniff ETH0\0A Truff & Lionel PRAT & Descript\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @init_sniff(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @get_packet(i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_arr(int myArray[], int elements) {
  int i;
  for (i = 0; i < elements; i++) {
    printf("%d ", myArray[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_arr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_arr+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_arr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_arr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_arr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_arr(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_arr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Salut!\n");
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [7 x i8] c"Salut!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int _kill(int pid, int sig) {
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<_kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ec7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec6(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_kill>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @_kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @_kill(i32 %0, i32 %1) {
%3 = load i32, i32* @EINVAL
store i32 %3, i32* @errno
ret i32 -1
}