xunge/DecIR huggingface dataset:
adrreg0imm1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((p0[10000000]) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrreg0imm1>:
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
movswl 0x1312d00(%rax),%eax
cmp    $0x21,%eax
jg     113f <adrreg0imm1+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <adrreg0imm1+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0imm1>:
xor    %eax,%eax
cmpw   $0x22,0x1312d00(%r8)
01 22
setl   %al
ret

LLVM IR (-O0):
define i32 @adrreg0imm1(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 = getelementptr inbounds i16, i16* %16, i64 10000000
%18 = load i16, i16* %17
%19 = sext i16 %18 to i32
%20 = icmp sle i32 %19, 33
br i1 %20, label %21, label %22
21: ; preds = %6
store i32 1, i32* %7
br label %23
22: ; preds = %6
store i32 0, i32* %7
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @adrreg0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = getelementptr inbounds i16, i16* %4, i64 10000000
%8 = load i16, i16* %7
%9 = icmp slt i16 %8, 34
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ outchar(char const);
void outstr(const char *str) {
  while (*str)
    outchar(*str);
}


x86 assembly (clang, -O0):
<outstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113a <outstr+0x2a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <outchar@plt>
jmp    111c <outstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     112f <outstr+0x1f>
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <outchar@plt>
movzbl (%rbx),%eax
test   %al,%al
jne    1120 <outstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @outstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 @outchar(i8 signext %5)
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_head() {
  printf("  Sent.                        Matched  Bracket   Cross        "
         "Correct Tag\n");
  printf(" ID  Len.  Stat. Recal  Prec.  Bracket gold test Bracket Words  Tags "
         "Accracy\n");
  printf("====================================================================="
         "=======\n");
}


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

x86 assembly (clang, -O2):
<print_head>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf27(%rip),%rdi
call   1030 <puts@plt>
lea    0xf68(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [76 x i8] c" Sent. Matched Bracket Cross Correct Tag\0A\00"
@.str.1 = [78 x i8] c" ID Len. Stat. Recal Prec. Bracket gold test Bracket Words Tags Accracy\0A\00"
@.str.2 = [78 x i8] c"============================================================================\0A\00"
define void @print_head() {
%1 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [75 x i8] c" Sent. Matched Bracket Cross Correct Tag\00"
@str.3 = [77 x i8] c" ID Len. Stat. Recal Prec. Bracket gold test Bracket Words Tags Accracy\00"
@str.4 = [77 x i8] c"============================================================================\00"
define void @print_head() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
void strreverse(char *begin, char *end) {
  while (end > begin) {
    char aux = *end;
    *end-- = *begin;
    *begin++ = aux;
  }
}


x86 assembly (clang, -O0):
<strreverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    1153 <strreverse+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <strreverse+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strreverse>:
cmp    %rdi,%rsi
jbe    112c <strreverse+0x2c>
add    $0xffffffffffffffff,%rsi
nopl   0x0(%rax)
movzbl 0x1(%rsi),%eax
movzbl (%rdi),%ecx
mov    %cl,0x1(%rsi)
mov    %al,(%rdi)
add    $0x1,%rdi
lea    -0x1(%rsi),%rax
cmp    %rdi,%rsi
mov    %rax,%rsi
ja     1110 <strreverse+0x10>
ret

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

LLVM IR (-O2):
define void @strreverse(i8* %0, i8* %1) {
%3 = icmp ugt i8* %1, %0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8* [ %10, %4 ], [ %0, %2 ]
%6 = phi i8* [ %9, %4 ], [ %1, %2 ]
%7 = load i8, i8* %6
%8 = load i8, i8* %5
%9 = getelementptr inbounds i8, i8* %6, i64 -1
store i8 %8, i8* %6
%10 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%11 = icmp ugt i8* %9, %10
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
int foo(int a, int b) { return (a & !a) | (b & (b == 0)); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmpl   $0x0,-0x4(%rbp)
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
cmpl   $0x0,-0x8(%rbp)
sete   %dl
and    $0x1,%dl
movzbl %dl,%edx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %ecx,%ecx
test   %edi,%edi
sete   %cl
and    %edi,%ecx
xor    %eax,%eax
test   %esi,%esi
sete   %al
and    %esi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo(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* %3
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
%10 = and i32 %5, %9
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
%15 = and i32 %11, %14
%16 = or i32 %10, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = zext i1 %3 to i32
%5 = and i32 %4, %0
%6 = icmp eq i32 %1, 0
%7 = zext i1 %6 to i32
%8 = and i32 %7, %1
%9 = or i32 %8, %5
ret i32 %9
}
int fun1111() { return 1111; }


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

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

LLVM IR (-O0):
define i32 @fun1111() {
ret i32 1111
}

LLVM IR (-O2):
define i32 @fun1111() {
ret i32 1111
}
void av_guess_frame_rate() {}


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

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

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

LLVM IR (-O2):
define void @av_guess_frame_rate() {
ret void
}
void U_EMRSAVEDC_print(const char *contents) { (void)contents; }


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

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

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

LLVM IR (-O2):
define void @U_EMRSAVEDC_print(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void nfshead(int osvers, int osrel, int ossub) {
  printf("  rpc/s  rpcread/s rpcwrite/s MBcr/s  MBcw/s  "
         "nettcp/s netudp/s _nfs_");
}


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

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

LLVM IR (-O0):
@.str = [70 x i8] c" rpc/s rpcread/s rpcwrite/s MBcr/s MBcw/s nettcp/s netudp/s _nfs_\00"
define void @nfshead(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c" rpc/s rpcread/s rpcwrite/s MBcr/s MBcw/s nettcp/s netudp/s _nfs_\00"
define void @nfshead(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}
int _hclib_atomic_load_acquire(volatile int *target) {
  int res = *target;
  __sync_synchronize();
  return res;
}


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

x86 assembly (clang, -O2):
<_hclib_atomic_load_acquire>:
mov    (%rdi),%eax
mfence
ret

LLVM IR (-O0):
define i32 @_hclib_atomic_load_acquire(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load volatile i32, i32* %4
store i32 %5, i32* %3
fence seq_cst
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @_hclib_atomic_load_acquire(i32* %0) {
%2 = load volatile i32, i32* %0
fence seq_cst
ret i32 %2
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ vmefail();
void *xmalloc(size_t size) {
  register void *value;
  value = malloc(size);
  if (value == NULL)
    vmefail();
  return value;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xmalloc+0x2b>
mov    $0x0,%al
call   1040 <vmefail@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xmalloc+0x15>
xor    %eax,%eax
call   1040 <vmefail@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @vmefail()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @vmefail()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t shiftr64(uint64_t a, uint8_t r) { return (a >> r); }


x86 assembly (clang, -O0):
<shiftr64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shiftr64>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @shiftr64(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
ret i32 %3
}
/* Type definitions */
struct rlimit {
  int dummy;
};
typedef scalar_t__ __rlimit_resource_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_getrlimit;
int syscall(int /*<<< orphan*/, long, long);
int getrlimit(__rlimit_resource_t resource, struct rlimit *rlim) {
  return syscall(SYS_getrlimit, (long)resource, (long)rlim);
}


x86 assembly (clang, -O0):
<getrlimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getrlimit>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@SYS_getrlimit = global i32 0
define i32 @getrlimit(i64 %0, %struct.rlimit* %1) {
%3 = alloca i64
%4 = alloca %struct.rlimit*
store i64 %0, i64* %3
store %struct.rlimit* %1, %struct.rlimit** %4
%5 = load i32, i32* @SYS_getrlimit
%6 = load i64, i64* %3
%7 = load %struct.rlimit*, %struct.rlimit** %4
%8 = ptrtoint %struct.rlimit* %7 to i64
%9 = call i32 @syscall(i32 %5, i64 %6, i64 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@SYS_getrlimit = global i32 0
define i32 @getrlimit(i64 %0, %struct.rlimit* %1) {
%3 = load i32, i32* @SYS_getrlimit
%4 = ptrtoint %struct.rlimit* %1 to i64
%5 = tail call i32 @syscall(i32 %3, i64 %0, i64 %4)
ret i32 %5
}
/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int read(int, char *, int);
int plm_comm_read(int fd, char *buf, int n) {
  int nr;
TRY:
  nr = read(fd, buf, n);
  if (nr < 0) {
    if (EINTR == errno)
      goto TRY;
  }
  return (nr);
}


x86 assembly (clang, -O0):
<plm_comm_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1162 <plm_comm_read+0x52>
mov    0x2e93(%rip),%rax
mov    (%rax),%rax
mov    0x2e91(%rip),%rcx
cmp    (%rcx),%rax
jne    115d <plm_comm_read+0x4d>
jmp    1122 <plm_comm_read+0x12>
jmp    1162 <plm_comm_read+0x52>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plm_comm_read>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb1(%rip),%r15
mov    0x2eb2(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <read@plt>
test   %eax,%eax
jns    114a <plm_comm_read+0x3a>
mov    (%r15),%rcx
cmp    (%r12),%rcx
je     1130 <plm_comm_read+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@EINTR = global i64 0
@errno = global i64 0
define i32 @plm_comm_read(i32 %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %7, %3
%5 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i64, i64* @EINTR
%9 = load i64, i64* @errno
%10 = icmp eq i64 %8, %9
br i1 %10, label %4, label %11
11: ; preds = %7, %4
ret i32 %5
}
/* Variables and functions */
int naive_scanf(char *, char *);
int mygets(char *s) {
  char *p = s;
  while (naive_scanf("%c", p) == 1 && *p++ != '\n')
    ;
  return p > s;
}


x86 assembly (clang, -O0):
<mygets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1030 <naive_scanf@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
mov    %al,-0x11(%rbp)
jne    115f <mygets+0x4f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    116f <mygets+0x5f>
jmp    1174 <mygets+0x64>
jmp    1124 <mygets+0x14>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mygets>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0xee1(%rip),%r15
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <naive_scanf@plt>
cmp    $0x1,%eax
jne    114e <mygets+0x3e>
lea    0x1(%rbx),%rcx
cmpb   $0xa,(%rbx)
mov    %rcx,%rbx
jne    1130 <mygets+0x20>
jmp    1151 <mygets+0x41>
mov    %rbx,%rcx
xor    %eax,%eax
cmp    %r14,%rcx
seta   %al
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @mygets(i8* %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = tail call i32 @naive_scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = load i8, i8* %3
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %2
10: ; preds = %2, %6
%11 = phi i8* [ %7, %6 ], [ %3, %2 ]
%12 = icmp ugt i8* %11, %0
%13 = zext i1 %12 to i32
ret i32 %13
}
void avcodec_copy_context() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_copy_context() {
ret void
}
unsigned short int _ldecomp(const char *ptr) {
  unsigned short int i;
  i = 0xc0 ^ ptr[0];
  i <<= 8;
  i |= (unsigned char)ptr[1];
  if (i >= 4096)
    i = 4095;
  return i;
}


x86 assembly (clang, -O0):
<_ldecomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
xor    $0xc0,%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
shl    $0x8,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%ecx
movzwl -0xa(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
cmp    $0x1000,%eax
jl     114a <_ldecomp+0x4a>
movw   $0xfff,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ldecomp>:
movzwl (%rdi),%ecx
rol    $0x8,%cx
xor    $0xffffc000,%ecx
movzwl %cx,%eax
cmp    $0xfff,%eax
mov    $0xfff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @_ldecomp(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = xor i32 192, %7
%9 = trunc i32 %8 to i16
store i16 %9, i16* %3
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = shl i32 %11, 8
%13 = trunc i32 %12 to i16
store i16 %13, i16* %3
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i16, i16* %3
%19 = zext i16 %18 to i32
%20 = or i32 %19, %17
%21 = trunc i32 %20 to i16
store i16 %21, i16* %3
%22 = load i16, i16* %3
%23 = zext i16 %22 to i32
%24 = icmp sge i32 %23, 4096
br i1 %24, label %25, label %26
25: ; preds = %1
store i16 4095, i16* %3
br label %26
26: ; preds = %25, %1
%27 = load i16, i16* %3
ret i16 %27
}

LLVM IR (-O2):
define zeroext i16 @_ldecomp(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl nuw i16 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = or i16 %4, %7
%9 = xor i16 %8, -16384
%10 = icmp ult i16 %9, 4095
%11 = select i1 %10, i16 %9, i16 4095
ret i16 %11
}
/* Variables and functions */
int ls_main(int, char **);
int main(int argc, char *argv[]) { return ls_main(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <ls_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @ls_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ die_memory();
extern void *check_memory(void *mem) {
  if (mem == NULL)
    die_memory();
  return mem;
}


x86 assembly (clang, -O0):
<check_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112e <check_memory+0x1e>
mov    $0x0,%al
call   1030 <die_memory@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_memory>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1120 <check_memory+0x10>
xor    %eax,%eax
call   1030 <die_memory@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @check_memory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @die_memory()
br label %7
7: ; preds = %5, %1
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
define i8* @check_memory(i8* readnone returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @die_memory()
br label %5
5: ; preds = %3, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__16__IO__makeOutput();
void OscilloscopeC__IOC0__makeOutput(void) {
  HplAtm128GeneralIOPinP__16__IO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @OscilloscopeC__IOC0__makeOutput() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__16__IO__makeOutput()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(char *, int /*<<< orphan*/ *, int);
char *write_uint16(char *buf, uint16_t val) {
  uint16_t tmp = htons(val);
  memcpy(buf, &tmp, 2);
  return buf + 2;
}


x86 assembly (clang, -O0):
<write_uint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x2,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_uint16>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htons@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1040 <memcpy@plt>
add    $0x2,%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @write_uint16(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @htons(i32 %1)
store i32 %5, i32* %3
%6 = call i32 @memcpy(i8* %0, i32* %3, i32 2)
%7 = getelementptr inbounds i8, i8* %0, i64 2
ret i8* %7
}
void scfdtab_dummy(void) {}


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

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

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

LLVM IR (-O2):
define void @scfdtab_dummy() {
ret void
}
__attribute__((__weak__)) int _close(int file __attribute__((unused))) {
  return -1;
}


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

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

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

LLVM IR (-O2):
define weak i32 @_close(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ mtrace();
int /*<<< orphan*/ test_echo_client();
int main() {
  mtrace();
  test_echo_client();
  getchar();
  getchar();
  getchar();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mtrace()
%2 = tail call i32 (...) @test_echo_client()
%3 = tail call i32 (...) @getchar()
%4 = tail call i32 (...) @getchar()
%5 = tail call i32 (...) @getchar()
ret i32 0
}
int dnear(double x, double y) {
  double t = x - y;
  return t == 0 || x / t > 100000000000000.0;
}


x86 assembly (clang, -O0):
<dnear>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%al
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x19(%rbp)
jne    113f <dnear+0x3f>
jp     113f <dnear+0x3f>
jmp    115b <dnear+0x5b>
movsd  -0x8(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  0xeaf(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dnear>:
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
mov    $0x1,%eax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm2
jne    111a <dnear+0x1a>
jp     111a <dnear+0x1a>
ret
divsd  %xmm2,%xmm0
xor    %eax,%eax
ucomisd 0xed8(%rip),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @dnear(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fsub double %6, %7
store double %8, double* %5
%9 = load double, double* %5
%10 = fcmp oeq double %9, 0.000000e+00
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = load double, double* %3
%13 = load double, double* %5
%14 = fdiv double %12, %13
%15 = fcmp ogt double %14, 1.000000e+14
br label %16
16: ; preds = %11, %2
%17 = phi i1 [ true, %2 ], [ %15, %11 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @dnear(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fcmp oeq double %3, 0.000000e+00
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = fdiv double %0, %3
%7 = fcmp ogt double %6, 1.000000e+14
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
void f1(void) {
  int i, j;
#pragma omp critical
  {
#pragma omp simd
    for (i = 0; i < 64; i++) {
#pragma omp ordered simd
      ;
    }
  }
#pragma omp ordered threads
  {
#pragma omp simd
    for (i = 0; i < 64; i++) {
#pragma omp ordered simd
      ;
    }
  }
#pragma omp task
  {
#pragma omp simd
    for (i = 0; i < 64; i++) {
#pragma omp ordered simd
      ;
    }
  }
#pragma omp taskloop
  for (j = 0; j < 64; j++)
#pragma omp simd
    for (i = 0; i < 64; i++) {
#pragma omp ordered simd
      ;
    }
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jge    1128 <f1+0x28>
jmp    111a <f1+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <f1+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jge    114c <f1+0x4c>
jmp    113e <f1+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <f1+0x2f>
movl   $0x0,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jge    1170 <f1+0x70>
jmp    1162 <f1+0x62>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <f1+0x53>
movl   $0x0,-0x8(%rbp)
cmpl   $0x40,-0x8(%rbp)
jge    11b8 <f1+0xb8>
movl   $0x0,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jge    11a5 <f1+0xa5>
jmp    1197 <f1+0x97>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1188 <f1+0x88>
jmp    11aa <f1+0xaa>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1177 <f1+0x77>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f1() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 64
br i1 %5, label %6, label %10
6: ; preds = %3
br label %7
7: ; preds = %6
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %3
10: ; preds = %3
store i32 0, i32* %1
br label %11
11: ; preds = %15, %10
%12 = load i32, i32* %1
%13 = icmp slt i32 %12, 64
br i1 %13, label %14, label %18
14: ; preds = %11
br label %15
15: ; preds = %14
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1
store i32 %17, i32* %1
br label %11
18: ; preds = %11
store i32 0, i32* %1
br label %19
19: ; preds = %23, %18
%20 = load i32, i32* %1
%21 = icmp slt i32 %20, 64
br i1 %21, label %22, label %26
22: ; preds = %19
br label %23
23: ; preds = %22
%24 = load i32, i32* %1
%25 = add nsw i32 %24, 1
store i32 %25, i32* %1
br label %19
26: ; preds = %19
store i32 0, i32* %2
br label %27
27: ; preds = %39, %26
%28 = load i32, i32* %2
%29 = icmp slt i32 %28, 64
br i1 %29, label %30, label %42
30: ; preds = %27
store i32 0, i32* %1
br label %31
31: ; preds = %35, %30
%32 = load i32, i32* %1
%33 = icmp slt i32 %32, 64
br i1 %33, label %34, label %38
34: ; preds = %31
br label %35
35: ; preds = %34
%36 = load i32, i32* %1
%37 = add nsw i32 %36, 1
store i32 %37, i32* %1
br label %31
38: ; preds = %31
br label %39
39: ; preds = %38
%40 = load i32, i32* %2
%41 = add nsw i32 %40, 1
store i32 %41, i32* %2
br label %27
42: ; preds = %27
ret void
}

LLVM IR (-O2):
define void @f1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void __attribute__((noreturn)) usage(void) {
  fprintf(stderr, "usage: bios_dumper <filename>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"usage: bios_dumper <filename>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"usage: bios_dumper <filename>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ BETestDictionary();
int /*<<< orphan*/ BETestInteger();
int /*<<< orphan*/ BETestList();
int /*<<< orphan*/ BETestString();
int main(void) {
  BETestString();
  BETestInteger();
  BETestList();
  BETestDictionary();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <BETestString@plt>
xor    %eax,%eax
call   1050 <BETestInteger@plt>
xor    %eax,%eax
call   1040 <BETestList@plt>
xor    %eax,%eax
call   1060 <BETestDictionary@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @BETestString()
%2 = tail call i32 (...) @BETestInteger()
%3 = tail call i32 (...) @BETestList()
%4 = tail call i32 (...) @BETestDictionary()
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timespec {
  int tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
uint64_t timespecDiff(struct timespec *timeA_p, struct timespec *timeB_p) {
  return ((timeA_p->tv_sec * 1000000000) + timeA_p->tv_nsec) -
         ((timeB_p->tv_sec * 1000000000) + timeB_p->tv_nsec);
}


x86 assembly (clang, -O0):
<timespecDiff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3b9aca00,(%rax),%eax
cltq
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%rax
mov    -0x10(%rbp),%rcx
imul   $0x3b9aca00,(%rcx),%ecx
movslq %ecx,%rcx
mov    -0x10(%rbp),%rdx
add    0x8(%rdx),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespecDiff>:
movslq (%rdi),%rax
imul   $0x3b9aca00,%rax,%rax
movslq (%rsi),%rcx
add    0x8(%rdi),%rax
imul   $0x3b9aca00,%rcx,%rcx
add    0x8(%rsi),%rcx
sub    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i64 @timespecDiff(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000000000
%9 = sext i32 %8 to i64
%10 = load %struct.timespec*, %struct.timespec** %3
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 1
%12 = load i64, i64* %11
%13 = add nsw i64 %9, %12
%14 = load %struct.timespec*, %struct.timespec** %4
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = mul nsw i32 %16, 1000000000
%18 = sext i32 %17 to i64
%19 = load %struct.timespec*, %struct.timespec** %4
%20 = getelementptr inbounds %struct.timespec, %struct.timespec* %19, i32 0, i32 1
%21 = load i64, i64* %20
%22 = add nsw i64 %18, %21
%23 = sub nsw i64 %13, %22
ret i64 %23
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define i64 @timespecDiff(%struct.timespec* nocapture %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000000
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%8 = load i64, i64* %7
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i32, i32* %9
%11 = mul nsw i32 %10, 1000000000
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%14 = load i64, i64* %13
%15 = add i64 %8, %6
%16 = add i64 %14, %12
%17 = sub i64 %15, %16
ret i64 %17
}
/* Variables and functions */
int /*<<< orphan*/ CopierZone(int, int, int, int, int, int, int, int);
void buff_save_zone(int x, int y, int w, int h, int x_buff, int y_buff) {
  CopierZone(3, 1, x, y, w, h, x_buff, y_buff);
}


x86 assembly (clang, -O0):
<buff_save_zone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r9d
mov    -0x14(%rbp),%r10d
mov    -0x18(%rbp),%eax
mov    $0x3,%edi
mov    $0x1,%esi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <CopierZone@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buff_save_zone>:
push   %rax
mov    %r9d,%eax
mov    %r8d,%r10d
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %esi,%ecx
mov    %edi,%edx
mov    $0x3,%edi
mov    $0x1,%esi
push   %rax
push   %r10
call   1030 <CopierZone@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @buff_save_zone(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = call i32 @CopierZone(i32 3, i32 1, i32 %13, i32 %14, i32 %15, i32 %16, i32 %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @buff_save_zone(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @CopierZone(i32 3, i32 1, i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5)
ret void
}
int re_assemble_14(int as14) {
  return (((as14 & 0x1fff) << 1) | ((as14 & 0x2000) >> 13));
}


x86 assembly (clang, -O0):
<re_assemble_14>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1fff,%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x2000,%ecx
sar    $0xd,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @re_assemble_14(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 8191
%5 = shl i32 %4, 1
%6 = load i32, i32* %2
%7 = and i32 %6, 8192
%8 = ashr i32 %7, 13
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @re_assemble_14(i32 %0) {
%2 = shl i32 %0, 1
%3 = and i32 %2, 16382
%4 = lshr i32 %0, 13
%5 = and i32 %4, 1
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ NapiszTekst(char *);
int /*<<< orphan*/ PiszW(int, int);
void WyswietlEkranPrzegranej() {
  PiszW(4, 4);
  NapiszTekst("Luuuzer");
}


x86 assembly (clang, -O0):
<WyswietlEkranPrzegranej>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%esi
mov    %esi,%edi
call   1030 <PiszW@plt>
lea    0xec9(%rip),%rdi
call   1040 <NapiszTekst@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WyswietlEkranPrzegranej>:
push   %rax
mov    $0x4,%edi
mov    $0x4,%esi
call   1030 <PiszW@plt>
lea    0xec9(%rip),%rdi
pop    %rax
jmp    1040 <NapiszTekst@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Luuuzer\00"
define void @WyswietlEkranPrzegranej() {
%1 = call i32 @PiszW(i32 4, i32 4)
%2 = call i32 @NapiszTekst(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Luuuzer\00"
define void @WyswietlEkranPrzegranej() {
%1 = tail call i32 @PiszW(i32 4, i32 4)
%2 = tail call i32 @NapiszTekst(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
int py_round_up_divide(int x, int y) { return (x - 1) / y + 1; }


x86 assembly (clang, -O0):
<py_round_up_divide>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x8(%rbp)
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<py_round_up_divide>:
lea    -0x1(%rdi),%eax
cltd
idiv   %esi
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @py_round_up_divide(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 = sub nsw i32 %5, 1
%7 = load i32, i32* %4
%8 = sdiv i32 %6, %7
%9 = add nsw i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @py_round_up_divide(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -1
%4 = sdiv i32 %3, %1
%5 = add nsw i32 %4, 1
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/ const);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void serial_uint16(uint8_t **const ptr, const uint16_t v) {
  uint16_t vo = htons(v);
  memcpy(*ptr, &vo, sizeof vo);
  *ptr += sizeof vo;
}


x86 assembly (clang, -O0):
<serial_uint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x10,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_uint16>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htons@plt>
mov    %eax,0xc(%rsp)
mov    (%rbx),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
addq   $0x10,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @serial_uint16(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* %4
%7 = call i32 @htons(i32 %6)
store i32 %7, i32* %5
%8 = load i32**, i32*** %3
%9 = load i32*, i32** %8
%10 = call i32 @memcpy(i32* %9, i32* %5, i32 4)
%11 = load i32**, i32*** %3
%12 = load i32*, i32** %11
%13 = getelementptr inbounds i32, i32* %12, i64 4
store i32* %13, i32** %11
ret void
}

LLVM IR (-O2):
define void @serial_uint16(i32** nocapture %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @htons(i32 %1)
store i32 %5, i32* %3
%6 = load i32*, i32** %0
%7 = call i32 @memcpy(i32* %6, i32* %3, i32 4)
%8 = load i32*, i32** %0
%9 = getelementptr inbounds i32, i32* %8, i64 4
store i32* %9, i32** %0
ret void
}
int main() {
  float *pf;
  float f1();
  float *f2();
  float (*f3)();
  void (*fp)();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char *strdup(char const *);
char *sstrdup(const char *s) {
  if (s != NULL)
    return strdup(s);
  else
    return NULL;
}


x86 assembly (clang, -O0):
<sstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1139 <sstrdup+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    1141 <sstrdup+0x31>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sstrdup>:
test   %rdi,%rdi
je     111a <sstrdup+0xa>
jmp    1030 <strdup@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @sstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ hello();
int main(void) {
  hello();
  return 0;
}


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

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

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

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