xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t load_16(const void *p) {
  return (*(uint8_t *)p) + (*(uint8_t *)(p + 1) << 8);
}


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

x86 assembly (clang, -O2):
<load_16>:
mov    0x1(%rdi),%eax
shl    $0x8,%eax
add    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @load_16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = load i8*, i8** %2
%7 = getelementptr i8, i8* %6, i64 1
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = add nsw i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @load_16(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = getelementptr i8, i8* %0, i64 1
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = add nsw i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int gcd(int, int);
int main() { return gcd(6515, 3158); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x1973,%edi
mov    $0xc56,%esi
jmp    1030 <gcd@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @gcd(i32 6515, i32 3158)
ret i32 %1
}
unsigned short net_load16(unsigned char data[2]) {
  return (data[0] << 8) | (data[1] << 0);
}


x86 assembly (clang, -O0):
<net_load16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_load16>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @net_load16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 0
%13 = or i32 %7, %12
%14 = trunc i32 %13 to i16
ret i16 %14
}

LLVM IR (-O2):
define zeroext i16 @net_load16(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
ret i16 %8
}
/* Variables and functions */
int ackerman(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("Valor retornado pela funcao de ackerman quando m=2 e n=6 eh: %d",
         ackerman(2, 6));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x6,%esi
call   1040 <ackerman@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [64 x i8] c"Valor retornado pela funcao de ackerman quando m=2 e n=6 eh: %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @ackerman(i32 2, i32 6)
%3 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [64 x i8] c"Valor retornado pela funcao de ackerman quando m=2 e n=6 eh: %d\00"
define i32 @main() {
%1 = tail call i32 @ackerman(i32 2, i32 6)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void show_message(int type) {}


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

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

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

LLVM IR (-O2):
define void @show_message(i32 %0) {
ret void
}
int open_port(char **port) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @open_port(i8** nocapture readnone %0) {
ret i32 -1
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ override_redirect;
};
struct TYPE_4__ {
  TYPE_1__ xmap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xmap_override_redirect(void *_p) {
  return (int)((XEvent *)_p)->xmap.override_redirect;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xmap_override_redirect(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xmap_override_redirect(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
char const *ptr_glXGetDriverConfig(char const *);
extern const char *glXGetDriverConfig(const char *driverName) {
  return ptr_glXGetDriverConfig(driverName);
}


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

x86 assembly (clang, -O2):
<glXGetDriverConfig>:
jmp    1030 <ptr_glXGetDriverConfig@plt>

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

LLVM IR (-O2):
define i8* @glXGetDriverConfig(i8* %0) {
%2 = tail call i8* @ptr_glXGetDriverConfig(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void blah(void) { write(1, "atexit\n", 7); }


x86 assembly (clang, -O0):
<blah>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x7,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<blah>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x7,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"atexit\0A\00"
define void @blah() {
%1 = call i32 @write(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"atexit\0A\00"
define void @blah() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
ret void
}
/* Variables and functions */
char *malloc(int);
char *xmalloc(int size) {
  char *str;
  int i;
  i = 0;
  if (!(str = malloc(size)))
    return (NULL);
  while (i < size) {
    str[i] = '\0';
    i += 1;
  }
  return (str);
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1145 <xmalloc+0x35>
movq   $0x0,-0x8(%rbp)
jmp    1178 <xmalloc+0x68>
jmp    114a <xmalloc+0x3a>
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1170 <xmalloc+0x60>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114a <xmalloc+0x3a>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1142 <xmalloc+0x22>
test   %ebp,%ebp
jle    1142 <xmalloc+0x22>
mov    %ebp,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp ne i8* %2, null
%4 = icmp sgt i32 %0, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char const *);
void delete_pidfile(const char *pidfile) { unlink(pidfile); }


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

x86 assembly (clang, -O2):
<delete_pidfile>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define void @delete_pidfile(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret void
}
/* Variables and functions */
int get_stcadc2(int, int, int *);
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
void print_stcadc2(int a, int b, int mask) {
  int f, r;
  f = get_stcadc2(a, b, &r);
  f &= mask;
  printf("stcadc"
         " 2"
         " %08x %08x %08x %08x %08x\n",
         a, b, r, f, mask);
}


x86 assembly (clang, -O0):
<print_stcadc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x14(%rbp),%rdx
call   1030 <get_stcadc2@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0xc(%rbp),%r9d
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_stcadc2>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xc(%rsp),%rdx
call   1030 <get_stcadc2@plt>
and    %r14d,%eax
mov    0xc(%rsp),%ecx
lea    0xeb9(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%r8d
mov    %r14d,%r9d
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"stcadc 2 %08x %08x %08x %08x %08x\0A\00"
define void @print_stcadc2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @get_stcadc2(i32 %9, i32 %10, i32* %8)
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = and i32 %13, %12
store i32 %14, i32* %7
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = load i32, i32* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"stcadc 2 %08x %08x %08x %08x %08x\0A\00"
define void @print_stcadc2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @get_stcadc2(i32 %0, i32 %1, i32* %4)
%7 = and i32 %6, %2
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %8, i32 %7, i32 %2)
ret void
}
int direct_equals(const void *a, const void *b) { return a == b; }


x86 assembly (clang, -O0):
<direct_equals>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<direct_equals>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @direct_equals(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @direct_equals(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gmx_rms(int, char **);
int main(int argc, char *argv[]) {
  gmx_rms(argc, argv);
  return 0;
}


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 <gmx_rms@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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 @gmx_rms(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_rms(i32 %0, i8** %1)
ret i32 0
}
void outw_p(unsigned short value, unsigned short port) {
  __asm__ __volatile__("out"
                       "w"
                       " %"
                       "w"
                       "0,%"
                       "w"
                       "1"
                       "\noutb %%al,$0x80"
                       :
                       : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outw_p>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x4(%rbp),%dx
out    %ax,(%dx)
out    %al,$0x80
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw_p>:
mov    %esi,%edx
mov    %edi,%eax
out    %ax,(%dx)
out    %al,$0x80
ret

LLVM IR (-O0):
define void @outw_p(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outw_p(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw ${0:w},${1:w}\0Aoutb %al,$$0x80", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
ret void
}
/* Variables and functions */
int peek32(int);
int uart_txfifo_empty(void) { return peek32((0x20201000 + 0x18)) & (1 << 7); }


x86 assembly (clang, -O0):
<uart_txfifo_empty>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20201018,%edi
call   1030 <peek32@plt>
and    $0x80,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_txfifo_empty>:
push   %rax
mov    $0x20201018,%edi
call   1030 <peek32@plt>
and    $0x80,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @uart_txfifo_empty() {
%1 = call i32 @peek32(i32 538972184)
%2 = and i32 %1, 128
ret i32 %2
}

LLVM IR (-O2):
define i32 @uart_txfifo_empty() {
%1 = tail call i32 @peek32(i32 538972184)
%2 = and i32 %1, 128
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void delay(uint32_t ms) {
  struct timespec sleeptime;
  sleeptime.tv_sec = 0;
  sleeptime.tv_nsec = ms * 1000 * 1000;
  nanosleep(&sleeptime, NULL);
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
imul   $0x3e8,-0x4(%rbp),%eax
imul   $0x3e8,%eax,%eax
mov    %eax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
imul   $0xf4240,%edi,%eax
mov    %eax,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 0, i64* %4
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 1000
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %7, i32* %8
%9 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define void @delay(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %4
%5 = mul i32 %0, 1000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %5, i32* %6
%7 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
int zmDebugInitialise(char const *, char const *, int);
int zmDbgInit(const char *name, const char *id, int level) {
  return (zmDebugInitialise(name, id, level));
}


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

x86 assembly (clang, -O2):
<zmDbgInit>:
jmp    1030 <zmDebugInitialise@plt>

LLVM IR (-O0):
define i32 @zmDbgInit(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 @zmDebugInitialise(i8* %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @zmDbgInit(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @zmDebugInitialise(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ DebugLogEntryHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void DebugLogEntryRequestUpdate() {
  UAVObjRequestUpdate(DebugLogEntryHandle());
}


x86 assembly (clang, -O0):
<DebugLogEntryRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DebugLogEntryHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DebugLogEntryRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <DebugLogEntryHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @DebugLogEntryRequestUpdate() {
%1 = call i32 (...) @DebugLogEntryHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @DebugLogEntryRequestUpdate() {
%1 = tail call i32 (...) @DebugLogEntryHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
bool check_flag(const char *arg, const char *shortFlag, const char *longFlag) {
  return !strcmp(arg, shortFlag) || !strcmp(arg, longFlag);
}


x86 assembly (clang, -O0):
<check_flag>:
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
call   1030 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1159 <check_flag+0x49>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_flag>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strcmp@plt>
test   %eax,%eax
je     1139 <check_flag+0x29>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
jmp    113e <check_flag+0x2e>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @check_flag(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i32 @strcmp(i8* %7, i8* %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = load i8*, i8** %6
%14 = call i32 @strcmp(i8* %12, i8* %13)
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
br label %17
17: ; preds = %11, %3
%18 = phi i1 [ true, %3 ], [ %16, %11 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @check_flag(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
%4 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %2)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ 1, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/);
scalar_t__ isatty(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ testmain();
int main() {
  testmain();
  printf(isatty(fileno(stdout)) ? "\e[32mOK\e[0m\n" : "OK\n");
  printf("\n0\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <testmain@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1060 <fileno@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
mov    %rax,%rcx
lea    0xe98(%rip),%rdi
lea    0xe84(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
call   1050 <printf@plt>
lea    0xe81(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <testmain@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1070 <fileno@plt>
mov    %eax,%edi
call   1040 <isatty@plt>
test   %rax,%rax
lea    0xe96(%rip),%rax
lea    0xe82(%rip),%rdi
cmove  %rax,%rdi
call   1060 <printf@plt>
lea    0xe83(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [13 x i8] c"\1B[32mOK\1B[0m\0A\00"
@.str.1 = [4 x i8] c"OK\0A\00"
@.str.2 = [4 x i8] c"\0A0\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @testmain()
%3 = load i32, i32* @stdout
%4 = call i32 @fileno(i32 %3)
%5 = call i64 @isatty(i32 %4)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%9 = call i32 @printf(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [13 x i8] c"\1B[32mOK\1B[0m\0A\00"
@.str.1 = [4 x i8] c"OK\0A\00"
@str = [3 x i8] c"\0A0\00"
define i32 @main() {
%1 = tail call i32 (...) @testmain()
%2 = load i32, i32* @stdout
%3 = tail call i32 @fileno(i32 %2)
%4 = tail call i64 @isatty(i32 %3)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
%7 = tail call i32 @printf(i8* dereferenceable(1) %6)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int IFF_TUN;
int tun() { return IFF_TUN; }


x86 assembly (clang, -O0):
<tun>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tun>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@IFF_TUN = global i32 0
define i32 @tun() {
%1 = load i32, i32* @IFF_TUN
ret i32 %1
}

LLVM IR (-O2):
@IFF_TUN = global i32 0
define i32 @tun() {
%1 = load i32, i32* @IFF_TUN
ret i32 %1
}
int fun302() { return 302; }


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

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

LLVM IR (-O0):
define i32 @fun302() {
ret i32 302
}

LLVM IR (-O2):
define i32 @fun302() {
ret i32 302
}
void init_timer(struct timer_list *timer) { return; }


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

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

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

LLVM IR (-O2):
%struct.timer_list = type opaque
define void @init_timer(%struct.timer_list* nocapture %0) {
ret void
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ random();
int irand(int from, int to) {
  return (int)(((double)random() / RAND_MAX) * (to - from + 1) + from);
}


x86 assembly (clang, -O0):
<irand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb7(%rip),%rax
divsd  (%rax),%xmm0
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm2
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irand>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <random@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ebe(%rip),%rax
divsd  (%rax),%xmm0
sub    %ebp,%ebx
add    $0x1,%ebx
cvtsi2sd %ebx,%xmm1
cvtsi2sd %ebp,%xmm2
mulsd  %xmm0,%xmm1
addsd  %xmm1,%xmm2
cvttsd2si %xmm2,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @irand(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i64 (...) @random()
%6 = sitofp i64 %5 to double
%7 = load double, double* @RAND_MAX
%8 = fdiv double %6, %7
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = sub nsw i32 %9, %10
%12 = add nsw i32 %11, 1
%13 = sitofp i32 %12 to double
%14 = load i32, i32* %3
%15 = sitofp i32 %14 to double
%16 = call double @llvm.fmuladd.f64(double %8, double %13, double %15)
%17 = fptosi double %16 to i32
ret i32 %17
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @irand(i32 %0, i32 %1) {
%3 = tail call i64 (...) @random()
%4 = sitofp i64 %3 to double
%5 = load double, double* @RAND_MAX
%6 = fdiv double %4, %5
%7 = sub i32 1, %0
%8 = add i32 %7, %1
%9 = sitofp i32 %8 to double
%10 = sitofp i32 %0 to double
%11 = tail call double @llvm.fmuladd.f64(double %6, double %9, double %10)
%12 = fptosi double %11 to i32
ret i32 %12
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
char *mp_encode_extl(char *, int /*<<< orphan*/, int);
char *mp_encode_ext(char *data, int8_t type, const char *str, uint32_t len) {
  data = mp_encode_extl(data, type, len);
  memcpy(data, str, len);
  return data + len;
}


x86 assembly (clang, -O0):
<mp_encode_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1030 <mp_encode_extl@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_encode_ext>:
push   %r15
push   %r14
push   %rbx
mov    %ecx,%ebx
mov    %rdx,%r14
mov    %ecx,%edx
call   1030 <mp_encode_extl@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <memcpy@plt>
movslq %ebx,%rax
add    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @mp_encode_ext(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i8* @mp_encode_extl(i8* %0, i32 %1, i32 %3)
%6 = tail call i32 @memcpy(i8* %5, i8* %2, i32 %3)
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
ret i8* %8
}
void *test_anti_range_105(unsigned long n) {
  extern void *alloc_anti_range_105(unsigned long)
      __attribute__((alloc_size(1)));
  if (0 <= n && n <= 2)
    n = 0 - 1;
  return alloc_anti_range_105(n);
}


x86 assembly (clang, -O0):
<test_anti_range_105>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
ja     113b <test_anti_range_105+0x2b>
cmpq   $0x2,-0x8(%rbp)
ja     113b <test_anti_range_105+0x2b>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rdi
call   1030 <alloc_anti_range_105@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_105>:
cmp    $0x3,%rdi
mov    $0xffffffffffffffff,%rax
cmovb  %rax,%rdi
jmp    1030 <alloc_anti_range_105@plt>

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

LLVM IR (-O2):
define i8* @test_anti_range_105(i64 %0) {
%2 = icmp ult i64 %0, 3
%3 = select i1 %2, i64 -1, i64 %0
%4 = tail call i8* @alloc_anti_range_105(i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void help() {
  printf("%s", "Some standard input is defined below :\n");
  printf("%s", "Help will be provided soon :\n");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rbx
lea    0xee8(%rip),%rbx
lea    0xee4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xefd(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [40 x i8] c"Some standard input is defined below :\0A\00"
@.str.2 = [30 x i8] c"Help will be provided soon :\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [40 x i8] c"Some standard input is defined below :\0A\00"
@.str.2 = [30 x i8] c"Help will be provided soon :\0A\00"
define void @help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
ret void
}
unsigned char even_parity(unsigned long data) {
  unsigned int temp = data ^ (data >> 16);
  temp = temp ^ (temp >> 8);
  temp = temp ^ (temp >> 4);
  temp = temp ^ (temp >> 2);
  temp = temp ^ (temp >> 1);
  return temp & 1;
}


x86 assembly (clang, -O0):
<even_parity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x10,%rcx
xor    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    $0x8,%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    $0x4,%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    $0x2,%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    $0x1,%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<even_parity>:
mov    %rdi,%rax
shr    $0x10,%rax
xor    %edi,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
xor    %ecx,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    %eax
xor    %ecx,%eax
and    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @even_parity(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = load i64, i64* %2
%6 = lshr i64 %5, 16
%7 = xor i64 %4, %6
%8 = trunc i64 %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = lshr i32 %10, 8
%12 = xor i32 %9, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = load i32, i32* %3
%15 = lshr i32 %14, 4
%16 = xor i32 %13, %15
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = load i32, i32* %3
%19 = lshr i32 %18, 2
%20 = xor i32 %17, %19
store i32 %20, i32* %3
%21 = load i32, i32* %3
%22 = load i32, i32* %3
%23 = lshr i32 %22, 1
%24 = xor i32 %21, %23
store i32 %24, i32* %3
%25 = load i32, i32* %3
%26 = and i32 %25, 1
%27 = trunc i32 %26 to i8
ret i8 %27
}

LLVM IR (-O2):
define zeroext i8 @even_parity(i64 %0) {
%2 = lshr i64 %0, 16
%3 = xor i64 %2, %0
%4 = trunc i64 %3 to i32
%5 = lshr i32 %4, 8
%6 = xor i32 %5, %4
%7 = lshr i32 %6, 4
%8 = xor i32 %7, %6
%9 = lshr i32 %8, 2
%10 = xor i32 %9, %8
%11 = lshr i32 %10, 1
%12 = xor i32 %11, %10
%13 = trunc i32 %12 to i8
%14 = and i8 %13, 1
ret i8 %14
}
double find_shift(double slope, double offset) {
  double shift = slope - offset / 600.0;
  double shift2 = slope + 0.3 - offset / 6000.0;
  if (shift2 < shift)
    shift = shift2;
  if (shift < 0)
    return 0.0;
  return shift;
}


x86 assembly (clang, -O0):
<find_shift>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xef0(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xed3(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xeb9(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1172 <find_shift+0x72>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    118d <find_shift+0x8d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1197 <find_shift+0x97>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_shift>:
movsd  0xef8(%rip),%xmm2
addsd  %xmm0,%xmm2
unpcklpd %xmm1,%xmm1
divpd  0xef8(%rip),%xmm1
unpcklpd %xmm0,%xmm2
addpd  %xmm1,%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
minsd  %xmm0,%xmm2
xorpd  %xmm0,%xmm0
maxsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @find_shift(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fdiv double %9, 6.000000e+02
%11 = fsub double %8, %10
store double %11, double* %6
%12 = load double, double* %4
%13 = fadd double %12, 3.000000e-01
%14 = load double, double* %5
%15 = fdiv double %14, 6.000000e+03
%16 = fsub double %13, %15
store double %16, double* %7
%17 = load double, double* %7
%18 = load double, double* %6
%19 = fcmp olt double %17, %18
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = load double, double* %7
store double %21, double* %6
br label %22
22: ; preds = %20, %2
%23 = load double, double* %6
%24 = fcmp olt double %23, 0.000000e+00
br i1 %24, label %25, label %26
25: ; preds = %22
store double 0.000000e+00, double* %3
br label %28
26: ; preds = %22
%27 = load double, double* %6
store double %27, double* %3
br label %28
28: ; preds = %26, %25
%29 = load double, double* %3
ret double %29
}

LLVM IR (-O2):
define double @find_shift(double %0, double %1) {
%3 = fadd double %0, 3.000000e-01
%4 = insertelement <2 x double> poison, double %1, i64 0
%5 = shufflevector <2 x double> %4, <2 x double> poison, <2 x i32> zeroinitializer
%6 = fdiv <2 x double> %5, <double 6.000000e+03, double 6.000000e+02>
%7 = insertelement <2 x double> poison, double %0, i64 1
%8 = insertelement <2 x double> %7, double %3, i64 0
%9 = fsub <2 x double> %8, %6
%10 = extractelement <2 x double> %9, i64 0
%11 = extractelement <2 x double> %9, i64 1
%12 = fcmp olt double %10, %11
%13 = select i1 %12, double %10, double %11
%14 = fcmp olt double %13, 0.000000e+00
%15 = select i1 %14, double 0.000000e+00, double %13
ret double %15
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double epoch_double() {
  struct timeval t;
  gettimeofday(&t, NULL);
  return t.tv_sec + (t.tv_usec * 1.0) / 1000000.0;
}


x86 assembly (clang, -O0):
<epoch_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xec1(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epoch_double>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @epoch_double() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = fmul double %6, 1.000000e+00
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %4, %8
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @epoch_double() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %5, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char **argv) {
  char buf[500];
  strcpy(buf, argv[1]);
  printf("%s\n", buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x210(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x200,%rsp
mov    0x8(%rsi),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [500 x i8]
%4 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i32 @strcpy(i8* %4, i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
void IntDefaultHandler(void) {
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<IntDefaultHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <IntDefaultHandler+0x9>
jmp    1109 <IntDefaultHandler+0x9>

x86 assembly (clang, -O2):
<IntDefaultHandler>:
jmp    1100 <IntDefaultHandler>

LLVM IR (-O0):
define void @IntDefaultHandler() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @IntDefaultHandler() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int printf_1(int err) {
  printf("**ERROR: %d\r\n", err);
  return 0;
}


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

x86 assembly (clang, -O2):
<printf_1>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"**ERROR: %d\0D\0A\00"
define i32 @printf_1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"**ERROR: %d\0D\0A\00"
define i32 @printf_1(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
/* Variables and functions */
__attribute__((visibility("default"))) void *
sd_bus_get_current_userdata(void *bus) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_bus_get_current_userdata(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ gone();
int /*<<< orphan*/ printf(char *);
int main() {
  gone();
  printf("done\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gone@plt>
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"done\0A\00"
define i32 @main() {
%1 = call i32 (...) @gone()
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"done\00"
define i32 @main() {
%1 = tail call i32 (...) @gone()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int f(long long a) {
  int d = a >> 32;
  return d >> 2;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x20,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %rdi,%rax
sar    $0x22,%rax
ret

LLVM IR (-O0):
define i32 @f(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = ashr i64 %4, 32
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = ashr i32 %7, 2
ret i32 %8
}

LLVM IR (-O2):
define i32 @f(i64 %0) {
%2 = lshr i64 %0, 32
%3 = trunc i64 %2 to i32
%4 = ashr i32 %3, 2
ret i32 %4
}
int eqm1_phi(unsigned long a) { return a ? 0 : -1; }


x86 assembly (clang, -O0):
<eqm1_phi>:
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):
<eqm1_phi>:
cmp    $0x1,%rdi
sbb    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @eqm1_phi(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
long syscall(int, int, int, int *);
long syscnt(int sctype, int pid, int *res) {
  return syscall(323, sctype, pid, res);
}


x86 assembly (clang, -O0):
<syscnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    $0x143,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscnt>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x143,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i64 @syscnt(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 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i64 @syscall(i32 323, i32 %7, i32 %8, i32* %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @syscnt(i32 %0, i32 %1, i32* %2) {
%4 = tail call i64 @syscall(i32 323, i32 %0, i32 %1, i32* %2)
ret i64 %4
}