xunge/DecIR huggingface dataset:
void cb_save_as(struct Screen *scrn) {}


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

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

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

LLVM IR (-O2):
%struct.Screen = type opaque
define void @cb_save_as(%struct.Screen* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned char eeread(int /*<<< orphan*/);
int /*<<< orphan*/ spb(unsigned char);
void eeputs(int addr) {
  for (;;) {
    unsigned char c = eeread(addr++);
    if (!c || (c == ((unsigned char)255)))
      return;
    else
      spb(c);
  }
}


x86 assembly (clang, -O0):
<eeputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
call   1040 <eeread@plt>
mov    %al,-0x5(%rbp)
cmpb   $0x0,-0x5(%rbp)
je     1157 <eeputs+0x37>
movzbl -0x5(%rbp),%eax
cmp    $0xff,%eax
jne    115d <eeputs+0x3d>
add    $0x10,%rsp
pop    %rbp
ret
movzbl -0x5(%rbp),%edi
call   1030 <spb@plt>
jmp    112b <eeputs+0xb>

x86 assembly (clang, -O2):
<eeputs>:
push   %rbx
mov    %edi,%ebx
call   1040 <eeread@plt>
lea    0x1(%rax),%ecx
cmp    $0x2,%cl
jb     115c <eeputs+0x3c>
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl %al,%edi
call   1030 <spb@plt>
mov    %ebx,%edi
call   1040 <eeread@plt>
mov    %eax,%ecx
add    $0x1,%cl
add    $0x1,%ebx
cmp    $0x1,%cl
ja     1140 <eeputs+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @eeputs(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
br label %4
4: ; preds = %18, %1
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = call zeroext i8 @eeread(i32 %5)
store i8 %7, i8* %3
%8 = load i8, i8* %3
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %4
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, 255
br i1 %13, label %14, label %15
14: ; preds = %10, %4
ret void
15: ; preds = %10
%16 = load i8, i8* %3
%17 = call i32 @spb(i8 zeroext %16)
br label %18
18: ; preds = %15
br label %4
}

LLVM IR (-O2):
define void @eeputs(i32 %0) {
%2 = tail call zeroext i8 @eeread(i32 %0)
%3 = add i8 %2, 1
%4 = icmp ult i8 %3, 2
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %10, %5 ], [ %2, %1 ]
%7 = phi i32 [ %8, %5 ], [ %0, %1 ]
%8 = add nsw i32 %7, 1
%9 = tail call i32 @spb(i8 zeroext %6)
%10 = tail call zeroext i8 @eeread(i32 %8)
%11 = add i8 %10, 1
%12 = icmp ult i8 %11, 2
br i1 %12, label %13, label %5
13: ; preds = %5, %1
ret void
}
/* Variables and functions */
scalar_t__ rand_int(int const);
float rand_float(const int range) {
  return (float)rand_int(range * 100) / 100.0;
}


x86 assembly (clang, -O0):
<rand_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x64,-0x4(%rbp),%edi
call   1030 <rand_int@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecb(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_float>:
push   %rax
imul   $0x64,%edi,%edi
call   1030 <rand_int@plt>
cvtsi2ss %rax,%xmm0
divss  0xeda(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @rand_float(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 100
%5 = call i64 @rand_int(i32 %4)
%6 = sitofp i64 %5 to float
%7 = fpext float %6 to double
%8 = fdiv double %7, 1.000000e+02
%9 = fptrunc double %8 to float
ret float %9
}

LLVM IR (-O2):
define float @rand_float(i32 %0) {
%2 = mul nsw i32 %0, 100
%3 = tail call i64 @rand_int(i32 %2)
%4 = sitofp i64 %3 to float
%5 = fdiv float %4, 1.000000e+02
ret float %5
}
/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  fork();
  fork() && fork() || fork();
  fork();
  printf("+");
  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)
mov    $0x0,%al
call   1040 <fork@plt>
mov    $0x0,%al
call   1040 <fork@plt>
cmp    $0x0,%rax
je     1167 <main+0x47>
mov    $0x0,%al
call   1040 <fork@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    1178 <main+0x58>
mov    $0x0,%al
call   1040 <fork@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    $0x0,%al
call   1040 <fork@plt>
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
je     1140 <main+0x20>
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
jne    1147 <main+0x27>
xor    %eax,%eax
call   1040 <fork@plt>
xor    %eax,%eax
call   1040 <fork@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"+\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 (...) @fork()
%7 = call i64 (...) @fork()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i64 (...) @fork()
%11 = icmp ne i64 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %9, %2
%13 = call i64 (...) @fork()
%14 = icmp ne i64 %13, 0
br label %15
15: ; preds = %12, %9
%16 = phi i1 [ true, %9 ], [ %14, %12 ]
%17 = zext i1 %16 to i32
%18 = call i64 (...) @fork()
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @fork()
%4 = tail call i64 (...) @fork()
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i64 (...) @fork()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6, %2
%10 = tail call i64 (...) @fork()
br label %11
11: ; preds = %9, %6
%12 = tail call i64 (...) @fork()
%13 = tail call i32 @putchar(i32 43)
ret i32 0
}
void os_restore_mode(int fd) { return; }


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

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

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

LLVM IR (-O2):
define void @os_restore_mode(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ VIM_HIF_GetReg8(int);
unsigned long VIM_JPEG_GetVideoWordCount(void) {
  unsigned long value32;
  value32 = (unsigned long)VIM_HIF_GetReg8((0x0000 + 0x00F));
  value32 |= (unsigned long)VIM_HIF_GetReg8((0x0000 + 0x00E)) << 8;
  value32 |= (unsigned long)VIM_HIF_GetReg8((0x0000 + 0x00D)) << 16;
  value32 |= (unsigned long)VIM_HIF_GetReg8((0x0000 + 0x00C)) << 24;
  value32 <<= 2;
  return value32;
}


x86 assembly (clang, -O0):
<VIM_JPEG_GetVideoWordCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xf,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %rax,-0x8(%rbp)
mov    $0xe,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shl    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    $0xd,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shl    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    $0xc,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shl    $0x18,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_JPEG_GetVideoWordCount>:
push   %r15
push   %r14
push   %rbx
mov    $0xf,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %rax,%r15
mov    $0xe,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %rax,%r14
mov    $0xd,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %rax,%rbx
mov    $0xc,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shl    $0x1a,%rax
shl    $0x12,%rbx
or     %rbx,%rax
shl    $0xa,%r14
shl    $0x2,%r15
or     %r14,%r15
or     %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @VIM_JPEG_GetVideoWordCount() {
%1 = alloca i64
%2 = call i64 @VIM_HIF_GetReg8(i32 15)
store i64 %2, i64* %1
%3 = call i64 @VIM_HIF_GetReg8(i32 14)
%4 = shl i64 %3, 8
%5 = load i64, i64* %1
%6 = or i64 %5, %4
store i64 %6, i64* %1
%7 = call i64 @VIM_HIF_GetReg8(i32 13)
%8 = shl i64 %7, 16
%9 = load i64, i64* %1
%10 = or i64 %9, %8
store i64 %10, i64* %1
%11 = call i64 @VIM_HIF_GetReg8(i32 12)
%12 = shl i64 %11, 24
%13 = load i64, i64* %1
%14 = or i64 %13, %12
store i64 %14, i64* %1
%15 = load i64, i64* %1
%16 = shl i64 %15, 2
store i64 %16, i64* %1
%17 = load i64, i64* %1
ret i64 %17
}

LLVM IR (-O2):
define i64 @VIM_JPEG_GetVideoWordCount() {
%1 = tail call i64 @VIM_HIF_GetReg8(i32 15)
%2 = tail call i64 @VIM_HIF_GetReg8(i32 14)
%3 = tail call i64 @VIM_HIF_GetReg8(i32 13)
%4 = tail call i64 @VIM_HIF_GetReg8(i32 12)
%5 = shl i64 %4, 26
%6 = shl i64 %3, 18
%7 = shl i64 %2, 10
%8 = shl i64 %1, 2
%9 = or i64 %7, %8
%10 = or i64 %9, %6
%11 = or i64 %10, %5
ret i64 %11
}
int do_780() { return 780; }


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

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

LLVM IR (-O0):
define i32 @do_780() {
ret i32 780
}

LLVM IR (-O2):
define i32 @do_780() {
ret i32 780
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void qh_free(void *mem) { free(mem); }


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

x86 assembly (clang, -O2):
<qh_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @qh_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void rop3_135_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & S;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_135_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_135_1_0>:
mov    (%rdi),%al
and    %sil,%al
xor    %al,%dl
or     %sil,%dl
not    %dl
or     %al,%dl
mov    %dl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_135_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = xor i8 %5, %2
%7 = or i8 %6, %1
%8 = xor i8 %7, -1
%9 = or i8 %5, %8
store i8 %9, i8* %0
ret void
}
/* Variables and functions */
bool isrestricted(char ch) {
  return ch == '{' || ch == '}' || ch == ':' || ch == '"' || ch == '#';
}


x86 assembly (clang, -O0):
<isrestricted>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7b,%ecx
mov    %al,-0x2(%rbp)
je     115f <isrestricted+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7d,%ecx
mov    %al,-0x2(%rbp)
je     115f <isrestricted+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3a,%ecx
mov    %al,-0x2(%rbp)
je     115f <isrestricted+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x22,%ecx
mov    %al,-0x2(%rbp)
je     115f <isrestricted+0x5f>
movsbl -0x1(%rbp),%eax
cmp    $0x23,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isrestricted>:
mov    $0x1,%eax
cmp    $0x7a,%dil
jg     1118 <isrestricted+0x18>
cmp    $0x22,%dil
je     1117 <isrestricted+0x17>
cmp    $0x3a,%dil
jne    1124 <isrestricted+0x24>
ret
cmp    $0x7b,%dil
je     1117 <isrestricted+0x17>
cmp    $0x7d,%dil
je     1117 <isrestricted+0x17>
xor    %eax,%eax
cmp    $0x23,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isrestricted(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 123
br i1 %5, label %22, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 125
br i1 %9, label %22, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 58
br i1 %13, label %22, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 34
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 35
br label %22
22: ; preds = %18, %14, %10, %6, %1
%23 = phi i1 [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isrestricted(i8 signext %0) {
switch i8 %0, label %2 [
i8 125, label %5
i8 123, label %5
i8 58, label %5
i8 34, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 35
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
int test_018(int a, int b, int c, int d) { return a + (a & 1) + a; }


x86 assembly (clang, -O0):
<test_018>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
add    %ecx,%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_018>:
mov    %edi,%eax
and    $0x1,%eax
lea    (%rax,%rdi,2),%eax
ret

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

LLVM IR (-O2):
define i32 @test_018(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %0, 1
%6 = shl i32 %0, 1
%7 = or i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ close_newabc();
void event_eof() { close_newabc(); }


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

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

LLVM IR (-O0):
define void @event_eof() {
%1 = call i32 (...) @close_newabc()
ret void
}

LLVM IR (-O2):
define void @event_eof() {
%1 = tail call i32 (...) @close_newabc()
ret void
}
long long llclamp(long long min, long long n, long long max) {
  return (min < n) ? (n < max ? n : max) : min;
}


x86 assembly (clang, -O0):
<llclamp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    114e <llclamp+0x4e>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1139 <llclamp+0x39>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1141 <llclamp+0x41>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1156 <llclamp+0x56>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llclamp>:
mov    %rdx,%rax
cmp    %rdx,%rsi
cmovl  %rsi,%rax
cmp    %rsi,%rdi
cmovge %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @llclamp(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %1
%5 = icmp slt i64 %1, %2
%6 = select i1 %5, i64 %1, i64 %2
%7 = select i1 %4, i64 %6, i64 %0
ret i64 %7
}
long concatenate(int a, int b) {
  int b_orig = b;
  long result = a;
  while (b > 0) {
    result *= 10;
    b /= 10;
  }
  return result + b_orig;
}


x86 assembly (clang, -O0):
<concatenate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    113e <concatenate+0x3e>
imul   $0xa,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1118 <concatenate+0x18>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<concatenate>:
movslq %edi,%rcx
test   %esi,%esi
jle    1128 <concatenate+0x28>
mov    $0xcccccccd,%eax
mov    %esi,%edx
xchg   %ax,%ax
add    %rcx,%rcx
lea    (%rcx,%rcx,4),%rcx
mov    %edx,%edi
imul   %rax,%rdi
shr    $0x23,%rdi
cmp    $0x9,%edx
mov    %edi,%edx
ja     1110 <concatenate+0x10>
movslq %esi,%rax
add    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @concatenate(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %11
5: ; preds = %2, %5
%6 = phi i64 [ %8, %5 ], [ %3, %2 ]
%7 = phi i32 [ %9, %5 ], [ %1, %2 ]
%8 = mul nsw i64 %6, 10
%9 = udiv i32 %7, 10
%10 = icmp ult i32 %7, 10
br i1 %10, label %11, label %5
11: ; preds = %5, %2
%12 = phi i64 [ %3, %2 ], [ %8, %5 ]
%13 = sext i32 %1 to i64
%14 = add nsw i64 %12, %13
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_ldbuio(unsigned char *);
void test_ldbuio(unsigned char *p1, unsigned char *p2) {
  __builtin_ldbuio(p1);
  __builtin_ldbuio(p2);
  __builtin_ldbuio(p2 + 1);
  __builtin_ldbuio(p2 + 2);
  __builtin_ldbuio(p2 + 2047);
  __builtin_ldbuio(p2 + 2048);
}


x86 assembly (clang, -O0):
<test_ldbuio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__builtin_ldbuio@plt>
mov    -0x10(%rbp),%rdi
call   1030 <__builtin_ldbuio@plt>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <__builtin_ldbuio@plt>
mov    -0x10(%rbp),%rdi
add    $0x2,%rdi
call   1030 <__builtin_ldbuio@plt>
mov    -0x10(%rbp),%rdi
add    $0x7ff,%rdi
call   1030 <__builtin_ldbuio@plt>
mov    -0x10(%rbp),%rdi
add    $0x800,%rdi
call   1030 <__builtin_ldbuio@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ldbuio>:
push   %rbx
mov    %rsi,%rbx
call   1030 <__builtin_ldbuio@plt>
mov    %rbx,%rdi
call   1030 <__builtin_ldbuio@plt>
lea    0x1(%rbx),%rdi
call   1030 <__builtin_ldbuio@plt>
lea    0x2(%rbx),%rdi
call   1030 <__builtin_ldbuio@plt>
lea    0x7ff(%rbx),%rdi
call   1030 <__builtin_ldbuio@plt>
add    $0x800,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <__builtin_ldbuio@plt>

LLVM IR (-O0):
define void @test_ldbuio(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @__builtin_ldbuio(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @__builtin_ldbuio(i8* %7)
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = call i32 @__builtin_ldbuio(i8* %10)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = call i32 @__builtin_ldbuio(i8* %13)
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 2047
%17 = call i32 @__builtin_ldbuio(i8* %16)
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 2048
%20 = call i32 @__builtin_ldbuio(i8* %19)
ret void
}

LLVM IR (-O2):
define void @test_ldbuio(i8* %0, i8* %1) {
%3 = tail call i32 @__builtin_ldbuio(i8* %0)
%4 = tail call i32 @__builtin_ldbuio(i8* %1)
%5 = getelementptr inbounds i8, i8* %1, i64 1
%6 = tail call i32 @__builtin_ldbuio(i8* %5)
%7 = getelementptr inbounds i8, i8* %1, i64 2
%8 = tail call i32 @__builtin_ldbuio(i8* %7)
%9 = getelementptr inbounds i8, i8* %1, i64 2047
%10 = tail call i32 @__builtin_ldbuio(i8* %9)
%11 = getelementptr inbounds i8, i8* %1, i64 2048
%12 = tail call i32 @__builtin_ldbuio(i8* %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fwide(int /*<<< orphan*/, int);
int /*<<< orphan*/ stdout;
void cnv_init_fwide() {
  if (!fwide(stdout, 1)) {
    exit(1);
  }
}


x86 assembly (clang, -O0):
<cnv_init_fwide>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1030 <fwide@plt>
cmp    $0x0,%eax
jne    114a <cnv_init_fwide+0x2a>
mov    $0x1,%edi
call   1040 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cnv_init_fwide>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1030 <fwide@plt>
test   %eax,%eax
je     113a <cnv_init_fwide+0x1a>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @cnv_init_fwide() {
%1 = load i32, i32* @stdout
%2 = call i32 @fwide(i32 %1, i32 1)
%3 = icmp ne i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = call i32 @exit(i32 1)
unreachable
6: ; preds = %0
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @cnv_init_fwide() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fwide(i32 %1, i32 1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int store_dobldobl_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(641, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<store_dobldobl_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x281,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_dobldobl_solutions>:
mov    $0x281,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @store_dobldobl_solutions() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 641, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int is_file_dir(const char *filename) {
  struct stat buf;
  if (stat(filename, &buf) < 0) {
    return -1;
  }
  if (S_ISDIR(buf.st_mode))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_file_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jge    114f <is_file_dir+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <is_file_dir+0x54>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
je     116d <is_file_dir+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1174 <is_file_dir+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_file_dir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
test   %rax,%rax
js     1143 <is_file_dir+0x23>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_file_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %16
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i64 @S_ISDIR(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 1, i32* %2
br label %16
15: ; preds = %9
store i32 0, i32* %2
br label %16
16: ; preds = %15, %14, %8
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_file_dir(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISDIR(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ -1, %1 ], [ %11, %6 ]
ret i32 %13
}
int NPG(int *raf, int *deg) {
  return raf[0] * raf[1] * raf[2] * (deg[0] + 1) * (deg[1] + 1) * (deg[2] + 1);
}


x86 assembly (clang, -O0):
<NPG>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
imul   0x4(%rcx),%eax
mov    -0x8(%rbp),%rcx
imul   0x8(%rcx),%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NPG>:
mov    0x4(%rdi),%ecx
imul   (%rdi),%ecx
imul   0x8(%rdi),%ecx
mov    (%rsi),%eax
mov    0x4(%rsi),%edx
add    $0x1,%eax
add    $0x1,%edx
imul   %eax,%edx
mov    0x8(%rsi),%eax
add    $0x1,%eax
imul   %edx,%eax
imul   %ecx,%eax
ret

LLVM IR (-O0):
define i32 @NPG(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 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = mul nsw i32 %7, %10
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = mul nsw i32 %11, %14
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i64 0
%18 = load i32, i32* %17
%19 = add nsw i32 %18, 1
%20 = mul nsw i32 %15, %19
%21 = load i32*, i32** %4
%22 = getelementptr inbounds i32, i32* %21, i64 1
%23 = load i32, i32* %22
%24 = add nsw i32 %23, 1
%25 = mul nsw i32 %20, %24
%26 = load i32*, i32** %4
%27 = getelementptr inbounds i32, i32* %26, i64 2
%28 = load i32, i32* %27
%29 = add nsw i32 %28, 1
%30 = mul nsw i32 %25, %29
ret i32 %30
}

LLVM IR (-O2):
define i32 @NPG(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, %3
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = mul nsw i32 %6, %8
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
%12 = mul nsw i32 %9, %11
%13 = getelementptr inbounds i32, i32* %1, i64 1
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
%16 = mul nsw i32 %12, %15
%17 = getelementptr inbounds i32, i32* %1, i64 2
%18 = load i32, i32* %17
%19 = add nsw i32 %18, 1
%20 = mul nsw i32 %16, %19
ret i32 %20
}
void wifi_evt_sme_scan_sort_finished(const void *nul) {}


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

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

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

LLVM IR (-O2):
define void @wifi_evt_sme_scan_sort_finished(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int AcceptConnection(int socket) {
  struct sockaddr addr;
  socklen_t addrLen;
  int newSock;
  addrLen = sizeof(addr);
  newSock = accept(socket, &addr, &addrLen);
  if (newSock == 1)
    return -1;
  else
    return newSock;
}


x86 assembly (clang, -O0):
<AcceptConnection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <accept@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jne    114b <AcceptConnection+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <AcceptConnection+0x41>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AcceptConnection>:
sub    $0x18,%rsp
movl   $0x4,0xc(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1030 <accept@plt>
cmp    $0x1,%eax
mov    $0xffffffff,%ecx
cmove  %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @AcceptConnection(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.sockaddr
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 4, i32* %5
%7 = load i32, i32* %3
%8 = call i32 @accept(i32 %7, %struct.sockaddr* %4, i32* %5)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* %6
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %11
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @AcceptConnection(i32 %0) {
%2 = alloca %struct.sockaddr
%3 = alloca i32
%4 = bitcast %struct.sockaddr* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = call i32 @accept(i32 %0, %struct.sockaddr* %2, i32* %3)
%7 = icmp eq i32 %6, 1
%8 = select i1 %7, i32 -1, i32 %6
ret i32 %8
}
/* Type definitions */
struct pri {
  int dummy;
};

/* Variables and functions */
void q931_destroy(struct pri *, int, int /*<<< orphan*/ *);
void q931_destroycall(struct pri *pri, int cr) {
  return q931_destroy(pri, cr, NULL);
}


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

x86 assembly (clang, -O2):
<q931_destroycall>:
xor    %edx,%edx
jmp    1030 <q931_destroy@plt>

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

LLVM IR (-O2):
%struct.pri = type { i32 }
define void @q931_destroycall(%struct.pri* %0, i32 %1) {
tail call void @q931_destroy(%struct.pri* %0, i32 %1, i32* null)
ret void
}
unsigned int foo(unsigned int x, int *p) {
  unsigned int src = x;
  unsigned int dst;
  *p = sizeof(unsigned int);
  __builtin___memcpy_chk(&dst, &src, *p, 16);
  return dst;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x4,(%rax)
lea    -0x18(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    -0x10(%rbp),%rax
movslq (%rax),%rdx
mov    $0x10,%ecx
call   1030 <__memcpy_chk@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
movl   $0x4,(%rsi)
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32, i32* %3
store i32 %7, i32* %5
%8 = load i32*, i32** %4
store i32 4, i32* %8
%9 = bitcast i32* %6 to i8*
%10 = bitcast i32* %5 to i8*
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = sext i32 %12 to i64
%14 = call i8* @__memcpy_chk(i8* %9, i8* %10, i64 %13, i64 16)
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
define i32 @foo(i32 returned %0, i32* nocapture writeonly %1) {
store i32 4, i32* %1
ret i32 %0
}
/* Variables and functions */
int truncate_caller(int /*<<< orphan*/);
int truncate_down(void) { return truncate_caller(0); }


x86 assembly (clang, -O0):
<truncate_down>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <truncate_caller@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @truncate_down() {
%1 = call i32 @truncate_caller(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @truncate_down() {
%1 = tail call i32 @truncate_caller(i32 0)
ret i32 %1
}
/* Variables and functions */
scalar_t__ _fun1(int, long, int);
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ scanf(char *, long *);
long _main() {
  long EV_i;
  EV_i = 0;
  scanf("%ld", &EV_i);
  while ((EV_i < 10000)) {
    printf("%ld\n", (long)_fun1(3, EV_i, 5));
    EV_i = (EV_i + 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    0xeb9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpq   $0x2710,-0x8(%rbp)
jge    1191 <_main+0x61>
mov    -0x8(%rbp),%rsi
mov    $0x3,%edi
mov    $0x5,%edx
call   1050 <_fun1@plt>
mov    %rax,%rsi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1150 <_main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
lea    0xebb(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%rsi
cmp    $0x270f,%rsi
jg     11a0 <_main+0x70>
lea    0xea0(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x3,%edi
mov    $0x5,%edx
call   1050 <_fun1@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x8(%rsp),%rax
lea    0x1(%rax),%rsi
mov    %rsi,0x8(%rsp)
cmp    $0x270f,%rax
jl     1170 <_main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i64 @_main() {
%1 = alloca i64
store i64 0, i64* %1
%2 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
br label %3
3: ; preds = %6, %0
%4 = load i64, i64* %1
%5 = icmp slt i64 %4, 10000
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i64, i64* %1
%8 = call i64 @_fun1(i32 3, i64 %7, i32 5)
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %8)
%10 = load i64, i64* %1
%11 = add nsw i64 %10, 1
store i64 %11, i64* %1
br label %3
12: ; preds = %3
ret i64 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i64 @_main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 0, i64* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = icmp slt i64 %4, 10000
br i1 %5, label %6, label %13
6: ; preds = %0, %6
%7 = phi i64 [ %11, %6 ], [ %4, %0 ]
%8 = call i64 @_fun1(i32 3, i64 %7, i32 5)
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %8)
%10 = load i64, i64* %1
%11 = add nsw i64 %10, 1
store i64 %11, i64* %1
%12 = icmp slt i64 %10, 9999
br i1 %12, label %6, label %13
13: ; preds = %6, %0
ret i64 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fwrite(char const *, int, int, int /*<<< orphan*/ *);
void WriteFile(const char *fn, const char *data, int size) {
  FILE *f = fopen(fn, "wb");
  fwrite(data, size, 1, f);
  fclose(f);
}


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

x86 assembly (clang, -O2):
<WriteFile>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
lea    0xebf(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %r14d,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbp,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"wb\00"
define void @WriteFile(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %7
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = call i32 @fwrite(i8* %10, i32 %11, i32 1, i32* %12)
%14 = load i32*, i32** %7
%15 = call i32 @fclose(i32* %14)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
define void @WriteFile(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fwrite(i8* %1, i32 %2, i32 1, i32* %4)
%6 = tail call i32 @fclose(i32* %4)
ret void
}
double aint(x)
double x;
{
  long l;
  l = x;
  if ((int)(-0.5) != 0 && l < 0)
    l++;
  x = l;
  return x;
}


x86 assembly (clang, -O0):
<aint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<aint>:
cvttsd2si %xmm0,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
ret

LLVM IR (-O0):
define double @aint(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = sitofp i64 %6 to double
store double %7, double* %2
%8 = load double, double* %2
ret double %8
}

LLVM IR (-O2):
define double @aint(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ seqNumBuf;

/* Variables and functions */
int RAND_bytes(unsigned char *, int);
int /*<<< orphan*/ error_handling(char *);
uint32_t randNum() {
  unsigned char seqNumBuf[sizeof(uint32_t)];
  if (RAND_bytes(seqNumBuf, sizeof(seqNumBuf)) != 1) {
    error_handling("Failed to generate random bytes");
  }
  return *((uint32_t *)seqNumBuf);
}


x86 assembly (clang, -O0):
<randNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1030 <RAND_bytes@plt>
cmp    $0x1,%eax
je     114b <randNum+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <error_handling@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randNum>:
push   %rax
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <RAND_bytes@plt>
cmp    $0x1,%eax
je     1141 <randNum+0x21>
lea    0xec4(%rip),%rdi
call   1040 <error_handling@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Failed to generate random bytes\00"
define i32 @randNum() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = call i32 @RAND_bytes(i8* %2, i32 4)
%4 = icmp ne i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @error_handling(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
@.str = [32 x i8] c"Failed to generate random bytes\00"
define i32 @randNum() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @RAND_bytes(i8* %2, i32 4)
%4 = icmp eq i32 %3, 1
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @error_handling(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* %1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf(
      "usage: f64_2csv <input.csv> <output.data> <total_rows> <total_cols>\n");
}


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

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

LLVM IR (-O0):
@.str = [69 x i8] c"usage: f64_2csv <input.csv> <output.data> <total_rows> <total_cols>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [68 x i8] c"usage: f64_2csv <input.csv> <output.data> <total_rows> <total_cols>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct ifreq {
  int dummy;
};

/* Variables and functions */
unsigned long ifr_size() { return (unsigned long)sizeof(struct ifreq); }


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

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

LLVM IR (-O0):
define i64 @ifr_size() {
ret i64 4
}

LLVM IR (-O2):
define i64 @ifr_size() {
ret i64 4
}
char *hello() { return "lua_extension_hello"; }


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

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

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

LLVM IR (-O2):
@.str = [20 x i8] c"lua_extension_hello\00"
define i8* @hello() {
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
}
int main() {
  int a = 5;
  int *pa = &a;
  pa++;
  pa--;
  return 5 == *pa;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x5,%eax
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 5, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i32 1
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i32 -1
store i32* %7, i32** %3
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = icmp eq i32 5, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ vet;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int vetor(int, int *);
void main(void) {
  int a, b;
  int vet[] = {1, 2, 3};
  a = sizeof(vet) / 4;
  b = vetor(a, vet);
  printf("%d\n", b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0xc(%rbp)
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   1040 <vetor@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x3,%edi
call   1040 <vetor@plt>
lea    0xebc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.vet = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [3 x i32]
%4 = bitcast [3 x i32]* %3 to i8*
store i32 3, i32* %1
%5 = load i32, i32* %1
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%7 = call i32 @vetor(i32 %5, i32* %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@__const.main.vet = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @vetor(i32 3, i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_store_tbu();
void spr_write_tbu(void *opaque, int sprn) { gen_op_store_tbu(); }


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

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

LLVM IR (-O0):
define void @spr_write_tbu(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @gen_op_store_tbu()
ret void
}

LLVM IR (-O2):
define void @spr_write_tbu(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @gen_op_store_tbu()
ret void
}