xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ PacketFinish();
int /*<<< orphan*/ PacketStart();
int /*<<< orphan*/ PacketWriteChar(char);
int /*<<< orphan*/ PacketWriteHexNumber(int, int);
void PacketWriteError(int code) {
  PacketStart();
  PacketWriteChar('E');
  PacketWriteHexNumber(code, 2);
  PacketFinish();
}


x86 assembly (clang, -O0):
<PacketWriteError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <PacketStart@plt>
mov    $0x45,%edi
call   1040 <PacketWriteChar@plt>
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1030 <PacketWriteHexNumber@plt>
mov    $0x0,%al
call   1060 <PacketFinish@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PacketWriteError>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <PacketStart@plt>
mov    $0x45,%edi
call   1040 <PacketWriteChar@plt>
mov    %ebx,%edi
mov    $0x2,%esi
call   1030 <PacketWriteHexNumber@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <PacketFinish@plt>

LLVM IR (-O0):
define void @PacketWriteError(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @PacketStart()
%4 = call i32 @PacketWriteChar(i8 signext 69)
%5 = load i32, i32* %2
%6 = call i32 @PacketWriteHexNumber(i32 %5, i32 2)
%7 = call i32 (...) @PacketFinish()
ret void
}

LLVM IR (-O2):
define void @PacketWriteError(i32 %0) {
%2 = tail call i32 (...) @PacketStart()
%3 = tail call i32 @PacketWriteChar(i8 signext 69)
%4 = tail call i32 @PacketWriteHexNumber(i32 %0, i32 2)
%5 = tail call i32 (...) @PacketFinish()
ret void
}
int count_set_bits(int n) {
  int c = 0;
  while (n) {
    c++;
    n &= (n - 1);
  }
  return c;
}


x86 assembly (clang, -O0):
<count_set_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <count_set_bits+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110e <count_set_bits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_set_bits>:
xor    %eax,%eax
test   %edi,%edi
je     111c <count_set_bits+0x1c>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <count_set_bits+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_set_bits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = add nsw i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
int end(int i) {
  if (i)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<end>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111d <end+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1124 <end+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<end>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @end(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printBytes(unsigned int);
int /*<<< orphan*/ printBytesAsNumber(unsigned int);
int /*<<< orphan*/ printBytesAsRank(unsigned int);
void printSet(unsigned int e) {
  printBytesAsRank(e);
  printBytes(e);
  printBytesAsNumber(e);
}


x86 assembly (clang, -O0):
<printSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <printBytesAsRank@plt>
mov    -0x4(%rbp),%edi
call   1030 <printBytes@plt>
mov    -0x4(%rbp),%edi
call   1050 <printBytesAsNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSet>:
push   %rbx
mov    %edi,%ebx
call   1040 <printBytesAsRank@plt>
mov    %ebx,%edi
call   1030 <printBytes@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <printBytesAsNumber@plt>

LLVM IR (-O0):
define void @printSet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printBytesAsRank(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @printBytes(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @printBytesAsNumber(i32 %7)
ret void
}

LLVM IR (-O2):
define void @printSet(i32 %0) {
%2 = tail call i32 @printBytesAsRank(i32 %0)
%3 = tail call i32 @printBytes(i32 %0)
%4 = tail call i32 @printBytesAsNumber(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *const);
void stdlog(const char *const str) {
  FILE *fout = fopen("chatgogol.log", "a");
  if (!fout)
    return;
  fprintf(fout, "entr text : %s\n", str);
  fclose(fout);
}


x86 assembly (clang, -O0):
<stdlog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1163 <stdlog+0x33>
jmp    1180 <stdlog+0x50>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe9e(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlog>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1173 <stdlog+0x43>
mov    %rax,%rbx
lea    0xeb7(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"chatgogol.log\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [16 x i8] c"entr text : %s\0A\00"
define void @stdlog(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
br label %14
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = load i32*, i32** %3
%13 = call i32 @fclose(i32* %12)
br label %14
14: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"chatgogol.log\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [16 x i8] c"entr text : %s\0A\00"
define void @stdlog(i8* %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%6 = tail call i32 @fclose(i32* %2)
br label %7
7: ; preds = %1, %4
ret void
}
double SFMMPHToKTS(double mph) { return (mph / 1.15151515); }


x86 assembly (clang, -O0):
<SFMMPHToKTS>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SFMMPHToKTS>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @SFMMPHToKTS(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 0x3FF26C9B26619399
ret double %4
}

LLVM IR (-O2):
define double @SFMMPHToKTS(double %0) {
%2 = fdiv double %0, 0x3FF26C9B26619399
ret double %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
double decode_angle(uint8_t v) { return (double)v * 360.0 / 32.0; }


x86 assembly (clang, -O0):
<decode_angle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_angle>:
cvtsi2sd %rdi,%xmm0
mulsd  0xef3(%rip),%xmm0
mulsd  0xef3(%rip),%xmm0
ret

LLVM IR (-O0):
define double @decode_angle(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = fmul double %4, 3.600000e+02
%6 = fdiv double %5, 3.200000e+01
ret double %6
}

LLVM IR (-O2):
define double @decode_angle(i64 %0) {
%2 = sitofp i64 %0 to double
%3 = fmul double %2, 3.600000e+02
%4 = fmul double %3, 3.125000e-02
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int osd_clone_task_start(void) {
  printk("++ osd_clone depends on GE2D module!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"++ osd_clone depends on GE2D module!\0A\00"
define i32 @osd_clone_task_start() {
%1 = call i32 @printk(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"++ osd_clone depends on GE2D module!\0A\00"
define i32 @osd_clone_task_start() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void gtk_progress_bar_get_text() {}


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

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

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

LLVM IR (-O2):
define void @gtk_progress_bar_get_text() {
ret void
}
/* Variables and functions */
bool nrf_raal_timeslot_is_granted(void) { return true; }


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

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

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

LLVM IR (-O2):
define i32 @nrf_raal_timeslot_is_granted() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ TCSBRK;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/);
sendbrk() { ioctl(0, TCSBRK, 0); }


x86 assembly (clang, -O0):
<sendbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
mov    %edx,%edi
call   1030 <ioctl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendbrk>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
xor    %edx,%edx
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@TCSBRK = global i32 0
define i32 @sendbrk() {
%1 = alloca i32
%2 = load i32, i32* @TCSBRK
%3 = call i32 @ioctl(i32 0, i32 %2, i32 0)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@TCSBRK = global i32 0
define i32 @sendbrk() {
%1 = load i32, i32* @TCSBRK
%2 = tail call i32 @ioctl(i32 0, i32 %1, i32 0)
ret i32 undef
}
void WriteString(const char *string, int colour) {
  char *video = (char *)0xB8000;
  while (*string != 0) {
    *video++ = *string++;
    *video++ = colour;
  }
}


x86 assembly (clang, -O0):
<WriteString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xb8000,%eax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1161 <WriteString+0x61>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1114 <WriteString+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteString>:
mov    (%rdi),%al
test   %al,%al
je     112c <WriteString+0x2c>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,0xb8000(%rcx,%rcx,1)
mov    %sil,0xb8001(%rcx,%rcx,1)
movzbl 0x1(%rdi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <WriteString+0x10>
ret

LLVM IR (-O0):
define void @WriteString(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
store i8* inttoptr (i64 753664 to i8*), i8** %5
br label %6
6: ; preds = %11, %2
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
%14 = load i8, i8* %12
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %5
store i8 %14, i8* %15
%17 = load i32, i32* %4
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %5
store i8 %18, i8* %19
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @WriteString(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %7
%8 = phi i8 [ %3, %5 ], [ %14, %7 ]
%9 = phi i8* [ inttoptr (i64 753664 to i8*), %5 ], [ %13, %7 ]
%10 = phi i8* [ %0, %5 ], [ %11, %7 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %8, i8* %9
%13 = getelementptr inbounds i8, i8* %9, i64 2
store i8 %6, i8* %12
%14 = load i8, i8* %11
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %2
ret void
}
/* Variables and functions */
int atoi(char *);
int ends_with_101(char *str, size_t len) {
  int n = atoi(str + len - 3);
  if (!((n % 2) & 1))
    return 0;
  n >>= 1;
  if ((n % 2) & 1)
    return 0;
  n >>= 1;
  return (n % 2) & 1;
}


x86 assembly (clang, -O0):
<ends_with_101>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
add    -0x18(%rbp),%rdi
add    $0xfffffffffffffffd,%rdi
call   1030 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
and    $0x1,%edx
cmp    $0x0,%edx
jne    1157 <ends_with_101+0x47>
movl   $0x0,-0x4(%rbp)
jmp    119d <ends_with_101+0x8d>
mov    -0x1c(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
and    $0x1,%edx
cmp    $0x0,%edx
je     1183 <ends_with_101+0x73>
movl   $0x0,-0x4(%rbp)
jmp    119d <ends_with_101+0x8d>
mov    -0x1c(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
and    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ends_with_101>:
push   %rax
add    %rsi,%rdi
add    $0xfffffffffffffffd,%rdi
call   1030 <atoi@plt>
mov    %eax,%ecx
and    $0x3,%ecx
shr    $0x2,%eax
and    $0x1,%eax
xor    %edx,%edx
cmp    $0x1,%ecx
cmovne %edx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ends_with_101(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = getelementptr inbounds i8, i8* %3, i64 -3
%5 = tail call i32 @atoi(i8* %4)
%6 = and i32 %5, 3
%7 = icmp eq i32 %6, 1
%8 = lshr i32 %5, 2
%9 = and i32 %8, 1
%10 = select i1 %7, i32 %9, i32 0
ret i32 %10
}
void rop3_88_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S | T;
  stk2 = *D & stk3;
  stk1 = T ^ stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_88_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%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
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%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_88_0_1>:
mov    %edx,%eax
or     %sil,%al
mov    (%rdi),%r8b
and    %r8b,%al
mov    %edx,%ecx
not    %cl
and    %al,%cl
xor    %dl,%al
and    %sil,%al
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %cl,%sil
or     %al,%sil
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_88_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = xor i8 %6, %2
%8 = and i8 %7, %1
%9 = xor i8 %2, -1
%10 = and i8 %6, %9
%11 = xor i8 %1, -1
%12 = and i8 %11, %2
%13 = and i8 %12, %5
%14 = or i8 %10, %13
%15 = or i8 %14, %8
store i8 %15, i8* %0
ret void
}
int sub3(int i, int j, float f) { return f ? i : j; }


x86 assembly (clang, -O0):
<sub3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    112b <sub3+0x2b>
jp     112b <sub3+0x2b>
jmp    1136 <sub3+0x36>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    113c <sub3+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub3>:
mov    %esi,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
cmovne %edi,%eax
cmovp  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @sub3(i32 %0, i32 %1, float %2) {
%4 = fcmp une float %2, 0.000000e+00
%5 = select i1 %4, i32 %0, i32 %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_panic__();
void die_amqp_error(int err, const char *fmt, ...) { __coverity_panic__(); }


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

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

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

LLVM IR (-O2):
define void @die_amqp_error(i32 %0, i8* nocapture readnone %1, ...) {
%3 = tail call i32 (...) @__coverity_panic__()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmple_sd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmple_sd(__m128d A, __m128d B) { return _mm_cmple_sd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_cmple_sd>:
jmp    1030 <_mm_cmple_sd@plt>

LLVM IR (-O0):
define i32 @test_mm_cmple_sd(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 = call i32 @_mm_cmple_sd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_cmple_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmple_sd(i32 %0, i32 %1)
ret i32 %3
}
int set_i2c(unsigned char address, unsigned char value) { return 0; }


x86 assembly (clang, -O0):
<set_i2c>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @set_i2c(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @set_i2c(i8 zeroext %0, i8 zeroext %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ file_transfer_test();
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(void) {
  setvbuf(stdout, NULL, _IONBF, 0);
  file_transfer_test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
mov    $0x0,%al
call   1030 <file_transfer_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
xor    %eax,%eax
call   1030 <file_transfer_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@_IONBF = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = load i32, i32* @_IONBF
%4 = call i32 @setvbuf(i32 %2, i32* null, i32 %3, i32 0)
%5 = call i32 (...) @file_transfer_test()
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@_IONBF = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = load i32, i32* @_IONBF
%3 = tail call i32 @setvbuf(i32 %1, i32* null, i32 %2, i32 0)
%4 = tail call i32 (...) @file_transfer_test()
ret i32 0
}
void sig_ignore() { return; }


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

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

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

LLVM IR (-O2):
define void @sig_ignore() {
ret void
}
int test_imm_0Auint32_reg(unsigned int val) {
  return ((val) & (0x0A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Auint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xa,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_0Auint32_reg>:
test   $0xa,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Auint32_reg(i32 %0) {
%2 = and i32 %0, 10
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int __pformat(int, int /*<<< orphan*/ *, int /*<<< orphan*/, char const *,
              int /*<<< orphan*/);
int __attribute__((__cdecl__))
__vfprintf(FILE *stream, const char *fmt, va_list argv) {
  return __pformat(0x1000 | 0x2000, stream, 0, fmt, argv);
}


x86 assembly (clang, -O0):
<__vfprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    $0x3000,%edi
xor    %edx,%edx
call   1030 <__pformat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__vfprintf>:
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rsi
mov    $0x3000,%edi
xor    %edx,%edx
jmp    1030 <__pformat@plt>

LLVM IR (-O0):
define i32 @__vfprintf(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @__pformat(i32 12288, i32* %7, i32 0, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @__vfprintf(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @__pformat(i32 12288, i32* %0, i32 0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_sndfile_write_sample_spec() {
  printf("NOT IMPLEMENTED:"
         "pa_sndfile_write_sample_spec"
         "\n");
}


x86 assembly (clang, -O0):
<pa_sndfile_write_sample_spec>:
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_sndfile_write_sample_spec>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [45 x i8] c"NOT IMPLEMENTED:pa_sndfile_write_sample_spec\00"
define i32 @pa_sndfile_write_sample_spec() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ mempcpy(int *, int *, int);
void mempcpy7() {
  int a[4] = {0};
  mempcpy(a + 2, a + 1, 8);
}


x86 assembly (clang, -O0):
<mempcpy7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
lea    -0x10(%rbp),%rdi
add    $0x8,%rdi
lea    -0x10(%rbp),%rsi
add    $0x4,%rsi
mov    $0x8,%edx
call   1040 <mempcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mempcpy7>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rsi
mov    $0x8,%edx
call   1030 <mempcpy@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @mempcpy7() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 2
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 1
%5 = call i32 @mempcpy(i32* %3, i32* %4, i32 8)
ret void
}
int execute_setuid() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_setuid() {
ret i32 0
}
/* Variables and functions */
int descnonblock(int);
int unixnonblock(int sock) { return descnonblock(sock); }


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

x86 assembly (clang, -O2):
<unixnonblock>:
jmp    1030 <descnonblock@plt>

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

LLVM IR (-O2):
define i32 @unixnonblock(i32 %0) {
%2 = tail call i32 @descnonblock(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __attribute__((__always___, __nodebug__)) _mm_free(void *p) {
  if (p)
    free(((void **)p)[-1]);
}


x86 assembly (clang, -O0):
<_mm_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <_mm_free+0x24>
mov    -0x8(%rbp),%rax
mov    -0x8(%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_free>:
test   %rdi,%rdi
je     111e <_mm_free+0xe>
mov    -0x8(%rdi),%rdi
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @_mm_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -8
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @free(i8* %6)
br label %8
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aes_test();
int main(void) {
  aes_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @aes_test()
ret i32 0
}
void avio_pause() {}


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

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

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

LLVM IR (-O2):
define void @avio_pause() {
ret void
}
int imin(int a, int b) {
  if (a < b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<imin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <imin+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <imin+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imin>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @imin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int close() {
  puts("type 'exit' to close\n");
  int a;
  scanf("%d", &a);
  return 0;
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xedb(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"type 'exit' to close\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @close() {
%1 = alloca i32
%2 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"type 'exit' to close\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @close() {
%1 = alloca i32
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret i32 0
}
RX0AX1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((p0[x0]) <= (((short *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<RX0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movswl (%rax,%rcx,2),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac7,%ecx
movswl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     114c <RX0AX1+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <RX0AX1+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0AX1>:
movslq %edx,%rax
movzwl (%r8,%rax,2),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(%rcx,%rcx,1),%dx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @RX0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* %4, i64 %7
%9 = load i16, i16* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %10
%12 = load i16, i16* %11
%13 = icmp sle i16 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
int c070(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c070() {
ret i32 0
}
/* Variables and functions */
double dpow(double, int);
double fact(int);
double sinh(double n) {
  double sum = 0;
  int i;
  for (i = 0; i <= 30; i++) {
    sum += dpow(n, 2 * i + 1) / fact(2 * i + 1);
  }
  return sum;
}


x86 assembly (clang, -O0):
<sinh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1e,-0x14(%rbp)
jg     1190 <sinh+0x70>
movsd  -0x8(%rbp),%xmm0
mov    -0x14(%rbp),%edi
shl    $0x1,%edi
add    $0x1,%edi
call   1040 <dpow@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%edi
shl    $0x1,%edi
add    $0x1,%edi
call   1030 <fact@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113c <sinh+0x1c>
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinh>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm0,0x8(%rsp)
xorpd  %xmm0,%xmm0
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
mov    %ebx,%edi
call   1040 <dpow@plt>
movsd  %xmm0,0x10(%rsp)
mov    %ebx,%edi
call   1030 <fact@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  0x18(%rsp),%xmm0
addsd  %xmm1,%xmm0
add    $0x2,%ebx
cmp    $0x3f,%ebx
jne    1140 <sinh+0x20>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @sinh(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store double %0, double* %2
store double 0.000000e+00, double* %3
store i32 0, i32* %4
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %4
%7 = icmp sle i32 %6, 30
br i1 %7, label %8, label %24
8: ; preds = %5
%9 = load double, double* %2
%10 = load i32, i32* %4
%11 = mul nsw i32 2, %10
%12 = add nsw i32 %11, 1
%13 = call double @dpow(double %9, i32 %12)
%14 = load i32, i32* %4
%15 = mul nsw i32 2, %14
%16 = add nsw i32 %15, 1
%17 = call double @fact(i32 %16)
%18 = fdiv double %13, %17
%19 = load double, double* %3
%20 = fadd double %19, %18
store double %20, double* %3
br label %21
21: ; preds = %8
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %5
24: ; preds = %5
%25 = load double, double* %3
ret double %25
}

LLVM IR (-O2):
define double @sinh(double %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %11, %2 ]
%4 = phi double [ 0.000000e+00, %1 ], [ %10, %2 ]
%5 = shl nuw nsw i32 %3, 1
%6 = or i32 %5, 1
%7 = tail call double @dpow(double %0, i32 %6)
%8 = tail call double @fact(i32 %6)
%9 = fdiv double %7, %8
%10 = fadd double %4, %9
%11 = add nuw nsw i32 %3, 1
%12 = icmp eq i32 %11, 31
br i1 %12, label %13, label %2
13: ; preds = %2
ret double %10
}
int foo() { return 4; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 4
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ checking_free(char *);
int /*<<< orphan*/ defaults();
int /*<<< orphan*/ exit(int);
int run_wgetrc(char *);
char *wgetrc_file_name();
void initialize(void) {
  char *file;
  int ok = 1;
  defaults();
  file = wgetrc_file_name();
  if (!file)
    return;
  ok &= run_wgetrc(file);
  if (!ok)
    exit(2);
  checking_free(file);
  return;
}


x86 assembly (clang, -O0):
<initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0xc(%rbp)
mov    $0x0,%al
call   1070 <defaults@plt>
mov    $0x0,%al
call   1030 <wgetrc_file_name@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1181 <initialize+0x31>
jmp    11ad <initialize+0x5d>
mov    -0x8(%rbp),%rdi
call   1040 <run_wgetrc@plt>
and    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    11a4 <initialize+0x54>
mov    $0x2,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%rdi
call   1050 <checking_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize>:
push   %rbx
xor    %eax,%eax
call   1070 <defaults@plt>
xor    %eax,%eax
call   1030 <wgetrc_file_name@plt>
test   %rax,%rax
je     117c <initialize+0x2c>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <run_wgetrc@plt>
test   $0x1,%al
je     117e <initialize+0x2e>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <checking_free@plt>
pop    %rbx
ret
mov    $0x2,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
define void @initialize() {
%1 = alloca i8*
%2 = alloca i32
store i32 1, i32* %2
%3 = call i32 (...) @defaults()
%4 = call i8* (...) @wgetrc_file_name()
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %0
br label %20
8: ; preds = %0
%9 = load i8*, i8** %1
%10 = call i32 @run_wgetrc(i8* %9)
%11 = load i32, i32* %2
%12 = and i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %8
%16 = call i32 @exit(i32 2)
unreachable
17: ; preds = %8
%18 = load i8*, i8** %1
%19 = call i32 @checking_free(i8* %18)
br label %20
20: ; preds = %17, %7
ret void
}

LLVM IR (-O2):
define void @initialize() {
%1 = tail call i32 (...) @defaults()
%2 = tail call i8* (...) @wgetrc_file_name()
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %0
%5 = tail call i32 @run_wgetrc(i8* %2)
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @exit(i32 2)
unreachable
10: ; preds = %4
%11 = tail call i32 @checking_free(i8* %2)
br label %12
12: ; preds = %0, %10
ret void
}
void blink(void) {
  while (1) {
    int i;
    (*((volatile unsigned short *)0x05FFFFC2)) ^= 0x40;
    for (i = 0; i < 500000; i++) {
    }
  }
}


x86 assembly (clang, -O0):
<blink>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5ffffc2,%eax
mov    (%rax),%ax
movzwl %ax,%eax
xor    $0x40,%eax
mov    %ax,%cx
mov    $0x5ffffc2,%eax
mov    %cx,(%rax)
movl   $0x0,-0x4(%rbp)
cmpl   $0x7a120,-0x4(%rbp)
jge    1144 <blink+0x44>
jmp    1136 <blink+0x36>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <blink+0x24>
jmp    1104 <blink+0x4>

x86 assembly (clang, -O2):
<blink>:
xorw   $0x40,0x5ffffc2
05 40
jmp    1100 <blink>

LLVM IR (-O0):
define void @blink() {
%1 = alloca i32
br label %2
2: ; preds = %0, %14
%3 = load volatile i16, i16* inttoptr (i64 100663234 to i16*)
%4 = zext i16 %3 to i32
%5 = xor i32 %4, 64
%6 = trunc i32 %5 to i16
store volatile i16 %6, i16* inttoptr (i64 100663234 to i16*)
store i32 0, i32* %1
br label %7
7: ; preds = %11, %2
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 500000
br i1 %9, label %10, label %14
10: ; preds = %7
br label %11
11: ; preds = %10
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %7
14: ; preds = %7
br label %2
}

LLVM IR (-O2):
define void @blink() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i16, i16* inttoptr (i64 100663234 to i16*)
%3 = xor i16 %2, 64
store volatile i16 %3, i16* inttoptr (i64 100663234 to i16*)
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ ft_putwchar_fd(int /*<<< orphan*/, int /*<<< orphan*/);
void ft_putwchar(wchar_t chr) { ft_putwchar_fd(chr, STDOUT_FILENO); }


x86 assembly (clang, -O0):
<ft_putwchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ecb(%rip),%rax
mov    (%rax),%esi
call   1030 <ft_putwchar_fd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putwchar>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ft_putwchar_fd@plt>

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

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define void @ft_putwchar(i32 %0) {
%2 = load i32, i32* @STDOUT_FILENO
%3 = tail call i32 @ft_putwchar_fd(i32 %0, i32 %2)
ret void
}
char *string_end(char *str) {
  while (*str != '\0') {
    str++;
  }
  return str - 1;
}


x86 assembly (clang, -O0):
<string_end>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1129 <string_end+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <string_end+0x8>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_end>:
mov    %rdi,%rax
add    $0xfffffffffffffffe,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x2(%rax)
lea    0x1(%rax),%rax
jne    1110 <string_end+0x10>
ret

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

LLVM IR (-O2):
define i8* @string_end(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %3, i64 -1
ret i8* %8
}