xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ mpd_freeDirectory(int /*<<< orphan*/);
int /*<<< orphan*/ mpd_freePlaylistFile(int /*<<< orphan*/);
int /*<<< orphan*/ mpd_freeSong(int /*<<< orphan*/);
int /*<<< orphan*/ mpd_getDirectory_st();
int /*<<< orphan*/ mpd_getPlaylistFile_st();
int /*<<< orphan*/ mpd_getSong_st();
void mpd_freeInfoEntityInfo_st(void) {
  mpd_freeDirectory(mpd_getDirectory_st());
  mpd_freeSong(mpd_getSong_st());
  mpd_freePlaylistFile(mpd_getPlaylistFile_st());
}


x86 assembly (clang, -O0):
<mpd_freeInfoEntityInfo_st>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mpd_getDirectory_st@plt>
mov    %eax,%edi
call   1040 <mpd_freeDirectory@plt>
mov    $0x0,%al
call   1080 <mpd_getSong_st@plt>
mov    %eax,%edi
call   1070 <mpd_freeSong@plt>
mov    $0x0,%al
call   1050 <mpd_getPlaylistFile_st@plt>
mov    %eax,%edi
call   1060 <mpd_freePlaylistFile@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpd_freeInfoEntityInfo_st>:
push   %rax
xor    %eax,%eax
call   1030 <mpd_getDirectory_st@plt>
mov    %eax,%edi
call   1040 <mpd_freeDirectory@plt>
xor    %eax,%eax
call   1080 <mpd_getSong_st@plt>
mov    %eax,%edi
call   1070 <mpd_freeSong@plt>
xor    %eax,%eax
call   1050 <mpd_getPlaylistFile_st@plt>
mov    %eax,%edi
pop    %rax
jmp    1060 <mpd_freePlaylistFile@plt>

LLVM IR (-O0):
define void @mpd_freeInfoEntityInfo_st() {
%1 = call i32 (...) @mpd_getDirectory_st()
%2 = call i32 @mpd_freeDirectory(i32 %1)
%3 = call i32 (...) @mpd_getSong_st()
%4 = call i32 @mpd_freeSong(i32 %3)
%5 = call i32 (...) @mpd_getPlaylistFile_st()
%6 = call i32 @mpd_freePlaylistFile(i32 %5)
ret void
}

LLVM IR (-O2):
define void @mpd_freeInfoEntityInfo_st() {
%1 = tail call i32 (...) @mpd_getDirectory_st()
%2 = tail call i32 @mpd_freeDirectory(i32 %1)
%3 = tail call i32 (...) @mpd_getSong_st()
%4 = tail call i32 @mpd_freeSong(i32 %3)
%5 = tail call i32 (...) @mpd_getPlaylistFile_st()
%6 = tail call i32 @mpd_freePlaylistFile(i32 %5)
ret void
}
int test_imm_84int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x84 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_84int64_midword_mem>:
testb  $0x84,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_84int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 8650752
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ft_print(int);
int /*<<< orphan*/ ft_putchar(char);
void ft_putnbr(int n) {
  if (n < 0) {
    ft_putchar('-');
    ft_putnbr(-n);
  } else if (n > 9) {
    ft_putnbr(n / 10);
    ft_print(n % 10);
  }
}


x86 assembly (clang, -O0):
<ft_putnbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    115e <ft_putnbr+0x2e>
mov    $0x2d,%edi
call   1030 <ft_putchar@plt>
xor    %edi,%edi
sub    -0x4(%rbp),%edi
call   1040 <ft_putnbr@plt>
jmp    1191 <ft_putnbr+0x61>
cmpl   $0x9,-0x4(%rbp)
jle    118c <ft_putnbr+0x5c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <ft_putnbr@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1050 <ft_print@plt>
jmp    1191 <ft_putnbr+0x61>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
test   %edi,%edi
js     113d <ft_putnbr+0xd>
mov    %ebp,%ebx
jmp    1152 <ft_putnbr+0x22>
mov    %ebp,%ebx
nop
mov    $0x2d,%edi
call   1030 <ft_putchar@plt>
neg    %ebx
test   %ebp,%ebp
mov    %ebx,%ebp
jg     1140 <ft_putnbr+0x10>
cmp    $0x9,%ebx
jbe    1182 <ft_putnbr+0x52>
mov    %ebx,%eax
mov    $0xcccccccd,%ebp
imul   %rax,%rbp
shr    $0x23,%rbp
mov    %ebp,%edi
call   1040 <ft_putnbr@plt>
add    %ebp,%ebp
lea    0x0(%rbp,%rbp,4),%eax
sub    %eax,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <ft_print@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @ft_putnbr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 @ft_putchar(i8 signext 45)
%7 = load i32, i32* %2
%8 = sub nsw i32 0, %7
br label %19
9: ; preds = %1
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 9
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i32, i32* %2
%14 = sdiv i32 %13, 10
%15 = load i32, i32* %2
%16 = srem i32 %15, 10
%17 = call i32 @ft_print(i32 %16)
br label %18
18: ; preds = %12, %9
br label %19
19: ; preds = %18, %5
ret void
}

LLVM IR (-O2):
define void @ft_putnbr(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @ft_putchar(i8 signext 45)
%6 = sub nsw i32 0, %4
%7 = icmp sgt i32 %4, 0
br i1 %7, label %3, label %8
8: ; preds = %3, %1
%9 = phi i32 [ %0, %1 ], [ %6, %3 ]
%10 = icmp ugt i32 %9, 9
br i1 %10, label %12, label %11
11: ; preds = %8, %12
ret void
12: ; preds = %8
%13 = udiv i32 %9, 10
tail call void @ft_putnbr(i32 %13)
%14 = urem i32 %9, 10
%15 = tail call i32 @ft_print(i32 %14)
br label %11
}
/* Variables and functions */
int /*<<< orphan*/ BitVectorC__1__BitVector__clearAll();
void TrickleTimerImplP__0__Changed__clearAll(void) {
  BitVectorC__1__BitVector__clearAll();
}


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

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

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

LLVM IR (-O2):
define void @TrickleTimerImplP__0__Changed__clearAll() {
%1 = tail call i32 (...) @BitVectorC__1__BitVector__clearAll()
ret void
}
/* Variables and functions */
int f218(int *);
int f219(int *p) { return f218(p); }


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

x86 assembly (clang, -O2):
<f219>:
jmp    1030 <f218@plt>

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

LLVM IR (-O2):
define i32 @f219(i32* %0) {
%2 = tail call i32 @f218(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ twi_start();
int /*<<< orphan*/ twi_stop();
int /*<<< orphan*/ twi_write(unsigned char);
void DS3231_Write(unsigned char address, unsigned char value) {
  twi_start();
  twi_write(((0x68 << 1) & 0xFE));
  twi_write(address);
  twi_write(value);
  twi_stop();
}


x86 assembly (clang, -O0):
<DS3231_Write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1030 <twi_start@plt>
mov    $0xd0,%edi
call   1040 <twi_write@plt>
movzbl -0x1(%rbp),%edi
call   1040 <twi_write@plt>
movzbl -0x2(%rbp),%edi
call   1040 <twi_write@plt>
mov    $0x0,%al
call   1050 <twi_stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DS3231_Write>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <twi_start@plt>
mov    $0xd0,%edi
call   1040 <twi_write@plt>
mov    %ebp,%edi
call   1040 <twi_write@plt>
mov    %ebx,%edi
call   1040 <twi_write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <twi_stop@plt>

LLVM IR (-O0):
define void @DS3231_Write(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call i32 (...) @twi_start()
%6 = call i32 @twi_write(i8 zeroext -48)
%7 = load i8, i8* %3
%8 = call i32 @twi_write(i8 zeroext %7)
%9 = load i8, i8* %4
%10 = call i32 @twi_write(i8 zeroext %9)
%11 = call i32 (...) @twi_stop()
ret void
}

LLVM IR (-O2):
define void @DS3231_Write(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 (...) @twi_start()
%4 = tail call i32 @twi_write(i8 zeroext -48)
%5 = tail call i32 @twi_write(i8 zeroext %0)
%6 = tail call i32 @twi_write(i8 zeroext %1)
%7 = tail call i32 (...) @twi_stop()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_fmadd_pd(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int /*<<< orphan*/ _mm_set1_pd(double);
__m128d _fma_dd_vec(__m128d *veca, __m128d *vecb, double C) {
  __m128d vecc = _mm_set1_pd(C);
  return _mm_fmadd_pd(*veca, *vecb, vecc);
}


x86 assembly (clang, -O0):
<_fma_dd_vec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <_mm_set1_pd@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x1c(%rbp),%edx
call   1040 <_mm_fmadd_pd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fma_dd_vec>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <_mm_set1_pd@plt>
mov    (%rbx),%edi
mov    (%r14),%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <_mm_fmadd_pd@plt>

LLVM IR (-O0):
define i32 @_fma_dd_vec(i32* %0, i32* %1, double %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca double
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store double %2, double* %6
%8 = load double, double* %6
%9 = call i32 @_mm_set1_pd(double %8)
store i32 %9, i32* %7
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = load i32*, i32** %5
%13 = load i32, i32* %12
%14 = load i32, i32* %7
%15 = call i32 @_mm_fmadd_pd(i32 %11, i32 %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @_fma_dd_vec(i32* nocapture %0, i32* nocapture %1, double %2) {
%4 = tail call i32 @_mm_set1_pd(double %2)
%5 = load i32, i32* %0
%6 = load i32, i32* %1
%7 = tail call i32 @_mm_fmadd_pd(i32 %5, i32 %6, i32 %4)
ret i32 %7
}
int psync_fs_need_per_folder_refresh_f() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @psync_fs_need_per_folder_refresh_f() {
ret i32 0
}
double mul2(int a, float b, double c) { return a * b * c; }


x86 assembly (clang, -O0):
<mul2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul2>:
cvtsi2ss %edi,%xmm2
mulss  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @mul2(i32 %0, float %1, double %2) {
%4 = alloca i32
%5 = alloca float
%6 = alloca double
store i32 %0, i32* %4
store float %1, float* %5
store double %2, double* %6
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to float
%9 = load float, float* %5
%10 = fmul float %8, %9
%11 = fpext float %10 to double
%12 = load double, double* %6
%13 = fmul double %11, %12
ret double %13
}

LLVM IR (-O2):
define double @mul2(i32 %0, float %1, double %2) {
%4 = sitofp i32 %0 to float
%5 = fmul float %4, %1
%6 = fpext float %5 to double
%7 = fmul double %6, %2
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x = 0;
  while (1) {
    assert(x == 0);
  }
  assert(x == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
mov    %al,-0x9(%rbp)
movzbl %al,%edi
call   1030 <assert@plt>
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <assert@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %0, %3
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @assert(i32 1)
br label %1
}
const char *gp_file_name_directory_separator(void) { return "/"; }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i8* @gp_file_name_directory_separator() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ baz();
int /*<<< orphan*/ foo();
int /*<<< orphan*/ printf(char *);
void bar(void) {
  printf("This is bar!\n");
  printf("Ahhh!\n");
  foo();
  bar();
  foo();
  baz();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb7(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <foo@plt>
call   1040 <bar@plt>
mov    $0x0,%al
call   1060 <foo@plt>
mov    $0x0,%al
call   1030 <baz@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb9(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <foo@plt>
call   1050 <bar@plt>
xor    %eax,%eax
call   1060 <foo@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <baz@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"This is bar!\0A\00"
@.str.1 = [7 x i8] c"Ahhh!\0A\00"
define void @bar() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @foo()
%4 = call i32 (...) @foo()
%5 = call i32 (...) @baz()
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"This is bar!\00"
@str.2 = [6 x i8] c"Ahhh!\00"
define void @bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 (...) @foo()
tail call void @bar()
%4 = tail call i32 (...) @foo()
%5 = tail call i32 (...) @baz()
ret void
}
void NoSoundDrv_MIDI_Unlock(void) {}


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

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

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

LLVM IR (-O2):
define void @NoSoundDrv_MIDI_Unlock() {
ret void
}
char *get_pointer_at_position(char *pstring, int position) { return pstring; }


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

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

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

LLVM IR (-O2):
define i8* @get_pointer_at_position(i8* readnone returned %0, i32 %1) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ errflush();
void dflush(void) { errflush(); }


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

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

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

LLVM IR (-O2):
define void @dflush() {
%1 = tail call i32 (...) @errflush()
ret void
}
/* Variables and functions */
unsigned char *gost_buffer(unsigned char *, unsigned char const *, size_t);
unsigned char *hash_buffer_gost(unsigned char *out, const unsigned char *in,
                                size_t in_len) {
  return gost_buffer(out, in, in_len);
}


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

x86 assembly (clang, -O2):
<hash_buffer_gost>:
jmp    1030 <gost_buffer@plt>

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

LLVM IR (-O2):
define i8* @hash_buffer_gost(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @gost_buffer(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
int check_ptr(const void *ptr) { return ptr ? 0 : -1; }


x86 assembly (clang, -O0):
<check_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_ptr>:
cmp    $0x1,%rdi
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @check_ptr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 0, i32 -1
ret i32 %6
}

LLVM IR (-O2):
define i32 @check_ptr(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = sext i1 %2 to i32
ret i32 %3
}
unsigned long hardclock(void) {
  unsigned long lo, hi;
  asm("rdtsc" : "=a"(lo), "=d"(hi));
  return (lo | (hi << 32));
}


x86 assembly (clang, -O0):
<hardclock>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %rax,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x20,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hardclock>:
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @hardclock() {
%1 = alloca i64
%2 = alloca i64
%3 = call { i64, i64 } asm "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i64, i64 } %3, 0
%5 = extractvalue { i64, i64 } %3, 1
store i64 %4, i64* %1
store i64 %5, i64* %2
%6 = load i64, i64* %1
%7 = load i64, i64* %2
%8 = shl i64 %7, 32
%9 = or i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @hardclock() {
%1 = tail call { i64, i64 } asm "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i64, i64 } %1, 0
%3 = extractvalue { i64, i64 } %1, 1
%4 = shl i64 %3, 32
%5 = or i64 %4, %2
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(int *array, int size) {
  int i;
  for (i = 0; i < size; i++) {
    printf("%d ", array[i]);
  }
  printf("\n");
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
uint8_t inside(uint8_t a0, uint8_t a1, uint8_t b0, uint8_t b1) {
  return ((a0 >= b0) && (a1 <= b1));
}


x86 assembly (clang, -O0):
<inside>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x18(%rbp),%rcx
mov    %al,-0x21(%rbp)
jl     1135 <inside+0x35>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
setle  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<inside>:
cmp    %rdx,%rdi
setge  %al
cmp    %rcx,%rsi
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i64 @inside(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %7
%11 = icmp sge i64 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %4
%13 = load i64, i64* %6
%14 = load i64, i64* %8
%15 = icmp sle i64 %13, %14
br label %16
16: ; preds = %12, %4
%17 = phi i1 [ false, %4 ], [ %15, %12 ]
%18 = zext i1 %17 to i32
%19 = sext i32 %18 to i64
ret i64 %19
}

LLVM IR (-O2):
define i64 @inside(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp sge i64 %0, %2
%6 = icmp sle i64 %1, %3
%7 = and i1 %5, %6
%8 = zext i1 %7 to i64
ret i64 %8
}
int hashFunction(char a[20]) {
  int sum, i;
  for (i = 0; i < 20; i++) {
    sum += a[i];
  }
  sum = (sum % 255);
  return sum;
}


x86 assembly (clang, -O0):
<hashFunction>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x14,-0x10(%rbp)
jge    1139 <hashFunction+0x39>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    110f <hashFunction+0xf>
mov    -0xc(%rbp),%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @hashFunction(i8* nocapture %0) {
ret i32 0
}
/* Variables and functions */
int Fibonacci(int);
int FibonacciTask(int n) {
  int x, y;
  if (n < 2)
    return n;
  else {
#pragma omp task shared(x)
    x = Fibonacci(n - 1);
#pragma omp task shared(y)
    y = Fibonacci(n - 2);
#pragma omp taskwait
    return (x + y);
  }
}


x86 assembly (clang, -O0):
<FibonacciTask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1130 <FibonacciTask+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <FibonacciTask+0x45>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <Fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <Fibonacci@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FibonacciTask>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    $0x2,%edi
jl     1132 <FibonacciTask+0x22>
lea    -0x1(%rbx),%edi
call   1030 <Fibonacci@plt>
mov    %eax,%ebp
add    $0xfffffffe,%ebx
mov    %ebx,%edi
call   1030 <Fibonacci@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @FibonacciTask(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @Fibonacci(i32 %4)
%6 = add nsw i32 %0, -2
%7 = tail call i32 @Fibonacci(i32 %6)
%8 = add nsw i32 %7, %5
br label %9
9: ; preds = %1, %3
%10 = phi i32 [ %8, %3 ], [ %0, %1 ]
ret i32 %10
}
void gtk_text_buffer_insert_pixbuf() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_insert_pixbuf() {
ret void
}
/* Type definitions */
struct RNAfold_args_info {
  int dummy;
};

/* Variables and functions */
int RNAfold_cmdline_parser2(int, char **, struct RNAfold_args_info *,
                            int /*<<< orphan*/, int, int);
int RNAfold_cmdline_parser(int argc, char **argv,
                           struct RNAfold_args_info *args_info) {
  return RNAfold_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<RNAfold_cmdline_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <RNAfold_cmdline_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNAfold_cmdline_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <RNAfold_cmdline_parser2@plt>

LLVM IR (-O0):
%struct.RNAfold_args_info = type { i32 }
define i32 @RNAfold_cmdline_parser(i32 %0, i8** %1, %struct.RNAfold_args_info* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.RNAfold_args_info*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.RNAfold_args_info* %2, %struct.RNAfold_args_info** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load %struct.RNAfold_args_info*, %struct.RNAfold_args_info** %6
%10 = call i32 @RNAfold_cmdline_parser2(i32 %7, i8** %8, %struct.RNAfold_args_info* %9, i32 0, i32 1, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.RNAfold_args_info = type { i32 }
define i32 @RNAfold_cmdline_parser(i32 %0, i8** %1, %struct.RNAfold_args_info* %2) {
%4 = tail call i32 @RNAfold_cmdline_parser2(i32 %0, i8** %1, %struct.RNAfold_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
/* Variables and functions */
int advance_window_start_to_next_snp_with_start_end_index(int, int *, char *,
                                                          int,
                                                          int /*<<< orphan*/,
                                                          int);
int advance_window_start_to_next_snp(int window_start_coordinate,
                                     int *snp_locations, char *child_sequence,
                                     int number_of_branch_snps) {
  return advance_window_start_to_next_snp_with_start_end_index(
      window_start_coordinate, snp_locations, child_sequence,
      number_of_branch_snps, 0, number_of_branch_snps);
}


x86 assembly (clang, -O0):
<advance_window_start_to_next_snp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x1c(%rbp),%r9d
xor    %r8d,%r8d
call   1030 <advance_window_start_to_next_snp_with_start_end_index@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<advance_window_start_to_next_snp>:
xor    %r8d,%r8d
mov    %ecx,%r9d
jmp    1030 <advance_window_start_to_next_snp_with_start_end_index@plt>

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

LLVM IR (-O2):
define i32 @advance_window_start_to_next_snp(i32 %0, i32* %1, i8* %2, i32 %3) {
%5 = tail call i32 @advance_window_start_to_next_snp_with_start_end_index(i32 %0, i32* %1, i8* %2, i32 %3, i32 0, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void or_reg64_imm32(int reg64, unsigned int imm32) {
  put8(0x48);
  put8(0x81);
  put8(0xC8 + reg64);
  put32(imm32);
}


x86 assembly (clang, -O0):
<or_reg64_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0x81,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
add    $0xc8,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<or_reg64_imm32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0x81,%edi
call   1030 <put8@plt>
add    $0xc8,%ebp
mov    %ebp,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @or_reg64_imm32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 72)
%6 = call i32 @put8(i32 129)
%7 = load i32, i32* %3
%8 = add nsw i32 200, %7
%9 = call i32 @put8(i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @put32(i32 %10)
ret void
}

LLVM IR (-O2):
define void @or_reg64_imm32(i32 %0, i32 %1) {
%3 = tail call i32 @put8(i32 72)
%4 = tail call i32 @put8(i32 129)
%5 = add nsw i32 %0, 200
%6 = tail call i32 @put8(i32 %5)
%7 = tail call i32 @put32(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int openpl(void) {
  printf("#FIG 2.0\n");
  printf("%d %d\n", 80, 2);
  return 0;
}


x86 assembly (clang, -O0):
<openpl>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x50,%esi
mov    $0x2,%edx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<openpl>:
push   %rax
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x50,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"#FIG 2.0\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @openpl() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 80, i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%d %d\0A\00"
@str = [9 x i8] c"#FIG 2.0\00"
define i32 @openpl() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 80, i32 2)
ret i32 0
}
/* Variables and functions */
int ft_strequ(char const *, char const *);
size_t ft_strlen(char const *);
int ft_strendwith(const char *s1, const char *s2) {
  size_t s1len;
  size_t s2len;
  s1len = ft_strlen(s1);
  s2len = ft_strlen(s2);
  if (s2len > s1len)
    return (0);
  return (ft_strequ(s1 + (s1len - s2len), s2));
}


x86 assembly (clang, -O0):
<ft_strendwith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ft_strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <ft_strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jbe    1164 <ft_strendwith+0x44>
movl   $0x0,-0x4(%rbp)
jmp    117f <ft_strendwith+0x5f>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
sub    -0x28(%rbp),%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
call   1040 <ft_strequ@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strendwith>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <ft_strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <ft_strlen@plt>
sub    %rax,%rbx
jae    1148 <ft_strendwith+0x28>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
add    %rbx,%r15
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <ft_strequ@plt>

LLVM IR (-O0):
define i32 @ft_strendwith(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call i64 @ft_strlen(i8* %8)
store i64 %9, i64* %6
%10 = load i8*, i8** %5
%11 = call i64 @ft_strlen(i8* %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = load i64, i64* %6
%14 = icmp ugt i64 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 0, i32* %3
br label %24
16: ; preds = %2
%17 = load i8*, i8** %4
%18 = load i64, i64* %6
%19 = load i64, i64* %7
%20 = sub i64 %18, %19
%21 = getelementptr inbounds i8, i8* %17, i64 %20
%22 = load i8*, i8** %5
%23 = call i32 @ft_strequ(i8* %21, i8* %22)
store i32 %23, i32* %3
br label %24
24: ; preds = %16, %15
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @ft_strendwith(i8* %0, i8* %1) {
%3 = tail call i64 @ft_strlen(i8* %0)
%4 = tail call i64 @ft_strlen(i8* %1)
%5 = icmp ult i64 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = sub i64 %3, %4
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = tail call i32 @ft_strequ(i8* %8, i8* %1)
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int accept_connection(int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getpid();
int /*<<< orphan*/ handle_fork(int);
int listen_on(int);
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *argv[]) {
  printf("\nThis is the server with pid %d listening on port %d\n", getpid(),
         2000);
  int s = listen_on(2000);
  while (1) {
    int msgsock = accept_connection(s);
    handle_fork(msgsock);
  }
  close(s);
  exit(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 <getpid@plt>
mov    %eax,%esi
lea    0xe8a(%rip),%rdi
mov    $0x7d0,%edx
call   1060 <printf@plt>
mov    $0x7d0,%edi
call   1030 <listen_on@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1070 <accept_connection@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1050 <handle_fork@plt>
jmp    118d <main+0x3d>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
mov    $0x7d0,%edx
call   1060 <printf@plt>
mov    $0x7d0,%edi
call   1030 <listen_on@plt>
mov    %eax,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1070 <accept_connection@plt>
mov    %eax,%edi
call   1050 <handle_fork@plt>
jmp    1180 <main+0x30>

LLVM IR (-O0):
@.str = [54 x i8] c"\0AThis is the server with pid %d listening on port %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @getpid()
%9 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %8, i32 2000)
%10 = call i32 @listen_on(i32 2000)
store i32 %10, i32* %6
br label %11
11: ; preds = %2, %11
%12 = load i32, i32* %6
%13 = call i32 @accept_connection(i32 %12)
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = call i32 @handle_fork(i32 %14)
br label %11
}

LLVM IR (-O2):
@.str = [54 x i8] c"\0AThis is the server with pid %d listening on port %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %3, i32 2000)
%5 = tail call i32 @listen_on(i32 2000)
br label %6
6: ; preds = %6, %2
%7 = tail call i32 @accept_connection(i32 %5)
%8 = tail call i32 @handle_fork(i32 %7)
br label %6
}
int WIFI_GET_PA_CUR_MODE(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @WIFI_GET_PA_CUR_MODE() {
ret i32 0
}
void clear_line(char line[]) {
  int i = 0;
  for (i = 0; line[i] != '\0'; i++) {
    line[i] = 0;
  }
}


x86 assembly (clang, -O0):
<clear_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1145 <clear_line+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <clear_line+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_line>:
cmpb   $0x0,(%rdi)
je     111d <clear_line+0x1d>
add    $0x1,%rdi
nopl   0x0(%rax)
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <clear_line+0x10>
ret

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

LLVM IR (-O2):
define void @clear_line(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
store i8 0, i8* %6
%7 = add nuw nsw i64 %5, 1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void tosMemory_formatString(char *buffer, char *fmt, int value) {
  sprintf(buffer, fmt, value);
}


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

x86 assembly (clang, -O2):
<tosMemory_formatString>:
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
define void @tosMemory_formatString(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1, i32 %2)
ret void
}
/* Type definitions */
struct msg {
  int dummy;
};

/* Variables and functions */
struct msg *msg_new_with_arg(int /*<<< orphan*/ *);
struct msg *msg_new(void) {
  return msg_new_with_arg(NULL);
}


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

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

LLVM IR (-O0):
%struct.msg = type { i32 }
define %struct.msg* @msg_new() {
%1 = call %struct.msg* @msg_new_with_arg(i32* null)
ret %struct.msg* %1
}

LLVM IR (-O2):
%struct.msg = type { i32 }
define %struct.msg* @msg_new() {
%1 = tail call %struct.msg* @msg_new_with_arg(i32* null)
ret %struct.msg* %1
}
void swap(int *left, int *right) {
  int blank;
  blank = *left;
  *left = *right;
  *right = blank;
}


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

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
void clear_bit(int nr, unsigned long *addr) {
  unsigned long mask = (1UL << ((nr) % (sizeof(unsigned long) * 8)));
  unsigned long *p = addr + ((nr) / (sizeof(unsigned long) * 8));
  *p &= ~mask;
}


x86 assembly (clang, -O0):
<clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rcx
and    $0x3f,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
shr    $0x6,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
mov    -0x20(%rbp),%rax
and    (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit>:
movslq %edi,%rcx
mov    %rcx,%rax
mov    $0xfffffffffffffffe,%rdx
rol    %cl,%rdx
shr    $0x6,%rax
and    %rdx,(%rsi,%rax,8)
ret

LLVM IR (-O0):
define void @clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = urem i64 %8, 64
%10 = shl i64 1, %9
store i64 %10, i64* %5
%11 = load i64*, i64** %4
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = udiv i64 %13, 64
%15 = getelementptr inbounds i64, i64* %11, i64 %14
store i64* %15, i64** %6
%16 = load i64, i64* %5
%17 = xor i64 %16, -1
%18 = load i64*, i64** %6
%19 = load i64, i64* %18
%20 = and i64 %19, %17
store i64 %20, i64* %18
ret void
}

LLVM IR (-O2):
define void @clear_bit(i32 %0, i64* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = and i64 %3, 63
%5 = shl nuw i64 1, %4
%6 = lshr i64 %3, 6
%7 = getelementptr inbounds i64, i64* %1, i64 %6
%8 = xor i64 %5, -1
%9 = load i64, i64* %7
%10 = and i64 %9, %8
store i64 %10, i64* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FileError(char *, char *);
void default_action_warning(char *s) {
  FileError("the default action for %s assigns an undefined value to $$", s);
}


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

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

LLVM IR (-O0):
@.str = [59 x i8] c"the default action for %s assigns an undefined value to $$\00"
define void @default_action_warning(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @FileError(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"the default action for %s assigns an undefined value to $$\00"
define void @default_action_warning(i8* %0) {
%2 = tail call i32 @FileError(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}