xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_lock(int /*<<< orphan*/ *);
int tx_pthread_mutex_lock(pthread_mutex_t *m) {
  if (0) {
    return pthread_mutex_lock(m);
  }
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @tx_pthread_mutex_lock(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int __setpgid(int /*<<< orphan*/, int /*<<< orphan*/);
int setpgrp(void) { return __setpgid(0, 0); }


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

x86 assembly (clang, -O2):
<setpgrp>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <__setpgid@plt>

LLVM IR (-O0):
define i32 @setpgrp() {
%1 = call i32 @__setpgid(i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @setpgrp() {
%1 = tail call i32 @__setpgid(i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void if_taken(void) { printf("taken\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"taken\00"
define void @if_taken() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(char *);
void _strcatchar(char *str, char c) {
  int len = strlen(str);
  str[len++] = c;
  str[len] = '\0';
}


x86 assembly (clang, -O0):
<_strcatchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x10(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strcatchar>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
mov    %bpl,(%rbx,%rax,1)
movb   $0x0,0x1(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @_strcatchar(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8, i8* %4
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 1
store i32 %11, i32* %5
%12 = sext i32 %10 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
store i8 %8, i8* %13
%14 = load i8*, i8** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 0, i8* %17
ret void
}

LLVM IR (-O2):
define void @_strcatchar(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 1
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %1, i8* %6
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
ret void
}
void g_slice_free1() {}


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

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

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

LLVM IR (-O2):
define void @g_slice_free1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void trancode_5001_(char *buf) { printf("my 5001\n"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"my 5001\0A\00"
define void @trancode_5001_(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [8 x i8] c"my 5001\00"
define void @trancode_5001_(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
int eek(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @eek() {
ret i32 0
}
void change(char a[]) {
  a[0] = 'B';
  a[1] = 'y';
  a[2] = 'e';
  a[3] = '\0';
}


x86 assembly (clang, -O0):
<change>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x42,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x79,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x65,0x2(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<change>:
movl   $0x657942,(%rdi)
ret

LLVM IR (-O0):
define void @change(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 66, i8* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 121, i8* %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 2
store i8 101, i8* %8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 3
store i8 0, i8* %10
ret void
}

LLVM IR (-O2):
define void @change(i8* nocapture writeonly %0) {
store i8 66, i8* %0
%2 = getelementptr inbounds i8, i8* %0, i64 1
store i8 121, i8* %2
%3 = getelementptr inbounds i8, i8* %0, i64 2
store i8 101, i8* %3
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 0, i8* %4
ret void
}
int test_imm_BEuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xBE << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_BEuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 190
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
XUnmapSubwindows() {}


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

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

LLVM IR (-O0):
define i32 @XUnmapSubwindows() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XUnmapSubwindows() {
ret i32 undef
}
unsigned int turris_get_default_color(int turris_version) {
  switch (turris_version) {
  case 10:
    return 0x33FF33;
  case 11:
    return 0xFFFFFF;
  }
  return 0xFFFFFF;
}


x86 assembly (clang, -O0):
<turris_get_default_color>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xa,%eax
je     112c <turris_get_default_color+0x2c>
jmp    111b <turris_get_default_color+0x1b>
mov    -0xc(%rbp),%eax
sub    $0xb,%eax
je     1138 <turris_get_default_color+0x38>
jmp    1144 <turris_get_default_color+0x44>
movl   $0x33ff33,-0x4(%rbp)
jmp    114b <turris_get_default_color+0x4b>
movl   $0xffffff,-0x4(%rbp)
jmp    114b <turris_get_default_color+0x4b>
movl   $0xffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<turris_get_default_color>:
cmp    $0xa,%edi
mov    $0x33ff33,%ecx
mov    $0xffffff,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @turris_get_default_color(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 10, label %5
i32 11, label %6
]
5: ; preds = %1
store i32 3407667, i32* %2
br label %8
6: ; preds = %1
store i32 16777215, i32* %2
br label %8
7: ; preds = %1
store i32 16777215, i32* %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @turris_get_default_color(i32 %0) {
%2 = icmp eq i32 %0, 10
%3 = select i1 %2, i32 3407667, i32 16777215
ret i32 %3
}
unsigned arm_bitcnt32(unsigned long v) {
  unsigned n;
  n = 0;
  while (v != 0) {
    n += 1;
    v &= v - 1;
  }
  return (n);
}


x86 assembly (clang, -O0):
<arm_bitcnt32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <arm_bitcnt32+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
and    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    110f <arm_bitcnt32+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @arm_bitcnt32(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i64 [ %8, %3 ], [ %0, %1 ]
%6 = add i32 %4, 1
%7 = add i64 %5, -1
%8 = and i64 %7, %5
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
void *__builtin_memcpy(void *, void const *, size_t);
void *memcpy(void *dest, void const *src, size_t cnt) {
  return __builtin_memcpy(dest, src, cnt);
}


x86 assembly (clang, -O0):
<memcpy>:
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    %rdi,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @memcpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ sendcmd(int, int);
int sgetc(int);
int seektr0(int s) {
  sendcmd(2, s);
  return (sgetc(s) & 0x04) != 0;
}


x86 assembly (clang, -O0):
<seektr0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1040 <sendcmd@plt>
mov    -0x4(%rbp),%edi
call   1030 <sgetc@plt>
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seektr0>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%edi
mov    %ebx,%esi
call   1040 <sendcmd@plt>
mov    %ebx,%edi
call   1030 <sgetc@plt>
shr    $0x2,%eax
and    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @seektr0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sendcmd(i32 2, i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @sgetc(i32 %5)
%7 = and i32 %6, 4
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @seektr0(i32 %0) {
%2 = tail call i32 @sendcmd(i32 2, i32 %0)
%3 = tail call i32 @sgetc(i32 %0)
%4 = lshr i32 %3, 2
%5 = and i32 %4, 1
ret i32 %5
}
void g_signal_connect_closure() {}


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

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

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

LLVM IR (-O2):
define void @g_signal_connect_closure() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ two();
int main(int argc, char *argv[]) {
  two();
  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    $0x0,%al
call   1030 <two@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <two@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 = call i32 (...) @two()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @two()
ret i32 0
}
/* Type definitions */
struct sembuf {
  int dummy;
};

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int semop(int, struct sembuf *, int);
int r_semop(int semid, struct sembuf *sops, int nsops) {
  while (semop(semid, sops, nsops) == -1)
    if (errno != EINTR)
      return -1;
  return 0;
}


x86 assembly (clang, -O0):
<r_semop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <semop@plt>
cmp    $0xffffffff,%eax
jne    1165 <r_semop+0x55>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rax
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%rax
je     1160 <r_semop+0x50>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <r_semop+0x5c>
jmp    1122 <r_semop+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_semop>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <semop@plt>
cmp    $0xffffffff,%eax
jne    1152 <r_semop+0x42>
mov    (%r15),%rax
cmp    (%r12),%rax
je     1130 <r_semop+0x20>
mov    $0xffffffff,%eax
jmp    1154 <r_semop+0x44>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.sembuf = type { i32 }
@errno = global i64 0
@EINTR = global i64 0
define i32 @r_semop(i32 %0, %struct.sembuf* %1, i32 %2) {
br label %4
4: ; preds = %7, %3
%5 = tail call i32 @semop(i32 %0, %struct.sembuf* %1, i32 %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i64, i64* @errno
%9 = load i64, i64* @EINTR
%10 = icmp eq i64 %8, %9
br i1 %10, label %4, label %11
11: ; preds = %4, %7
%12 = phi i32 [ -1, %7 ], [ 0, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void parseinput() {
  printf("dbg>$ ");
  getchar();
}


x86 assembly (clang, -O0):
<parseinput>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseinput>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"dbg>$ \00"
define void @parseinput() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"dbg>$ \00"
define void @parseinput() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret void
}
unsigned addval_479(unsigned x) { return x + 3372270217U; }


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

x86 assembly (clang, -O2):
<addval_479>:
lea    -0x36ff3d77(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @addval_479(i32 %0) {
%2 = add i32 %0, -922697079
ret i32 %2
}
/* Variables and functions */
long GetPosX69();
long getposx() { return GetPosX69(); }


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

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

LLVM IR (-O0):
define i64 @getposx() {
%1 = call i64 (...) @GetPosX69()
ret i64 %1
}

LLVM IR (-O2):
define i64 @getposx() {
%1 = tail call i64 (...) @GetPosX69()
ret i64 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void write_footer(FILE *out) {
  fprintf(out, "%%%%Trailer\n");
  fprintf(out, "%%%%EOF\n\n");
}


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

x86 assembly (clang, -O2):
<write_footer>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <fprintf@plt>
lea    0xee6(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%%%%Trailer\0A\00"
@.str.1 = [10 x i8] c"%%%%EOF\0A\0A\00"
define void @write_footer(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%%%%Trailer\0A\00"
@.str.1 = [10 x i8] c"%%%%EOF\0A\0A\00"
define void @write_footer(i32* nocapture %0) {
%2 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void walt_inc_cumulative_runnable_avg(struct rq *rq, struct task_struct *p) {}


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

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

LLVM IR (-O0):
%struct.rq = type opaque
%struct.task_struct = type opaque
define void @walt_inc_cumulative_runnable_avg(%struct.rq* %0, %struct.task_struct* %1) {
%3 = alloca %struct.rq*
%4 = alloca %struct.task_struct*
store %struct.rq* %0, %struct.rq** %3
store %struct.task_struct* %1, %struct.task_struct** %4
ret void
}

LLVM IR (-O2):
%struct.rq = type opaque
%struct.task_struct = type opaque
define void @walt_inc_cumulative_runnable_avg(%struct.rq* nocapture %0, %struct.task_struct* nocapture %1) {
ret void
}
int SDL_imageFilterBinarizeUsingThresholdMMX(unsigned char *Src1,
                                             unsigned char *Dest, int length,
                                             unsigned char T) {
  return (0);
}


x86 assembly (clang, -O0):
<SDL_imageFilterBinarizeUsingThresholdMMX>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %al,-0x15(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @SDL_imageFilterBinarizeUsingThresholdMMX(i8* %0, i8* %1, i32 %2, i8 zeroext %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8 %3, i8* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @SDL_imageFilterBinarizeUsingThresholdMMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8 zeroext %3) {
ret i32 0
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memsetZero(void *, int);
void *sys_calloc(int elements, int elementSize) {
  int p = elements * elementSize;
  void *tmp;
  tmp = malloc(p);
  if (tmp == 0)
    return 0;
  memsetZero(tmp, p);
  return tmp;
}


x86 assembly (clang, -O0):
<sys_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115c <sys_calloc+0x3c>
movq   $0x0,-0x8(%rbp)
jmp    1170 <sys_calloc+0x50>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <memsetZero@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
imul   %esi,%ebx
mov    %ebx,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1142 <sys_calloc+0x22>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <memsetZero@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @sys_calloc(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memsetZero(i8* %4, i32 %3)
br label %8
8: ; preds = %2, %6
ret i8* %4
}
void swapshort(void *a, void *b) {
  short t = *((short *)b);
  *((short *)b) = *((short *)a);
  *((short *)a) = t;
}


x86 assembly (clang, -O0):
<swapshort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x12(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x12(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapshort>:
movzwl (%rsi),%eax
movzwl (%rdi),%ecx
mov    %cx,(%rsi)
mov    %ax,(%rdi)
ret

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

LLVM IR (-O2):
define void @swapshort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i16*
%4 = load i16, i16* %3
%5 = bitcast i8* %0 to i16*
%6 = load i16, i16* %5
store i16 %6, i16* %3
store i16 %4, i16* %5
ret void
}
int c045(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c045() {
ret i32 0
}
void mt_trace_tasklet_end(void *func) {}


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

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

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

LLVM IR (-O2):
define void @mt_trace_tasklet_end(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ sub_string(char *, char *, int);
void sub_string_helper(char *s, char *new) {
  int i = 0;
  for (i = 0; i < strlen(s); i++) {
    sub_string(s, new, i + 1);
  }
}


x86 assembly (clang, -O0):
<sub_string_helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    117b <sub_string_helper+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
call   1040 <sub_string@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113e <sub_string_helper+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_string_helper>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    115c <sub_string_helper+0x3c>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <sub_string@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    %eax,%ebp
jl     1140 <sub_string_helper+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @sub_string_helper(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %2, %5
%6 = phi i32 [ %7, %5 ], [ 0, %2 ]
%7 = add nuw nsw i32 %6, 1
%8 = tail call i32 @sub_string(i8* %0, i8* %1, i32 %7)
%9 = tail call i32 @strlen(i8* %0)
%10 = icmp slt i32 %7, %9
br i1 %10, label %5, label %11
11: ; preds = %5, %2
ret void
}
/* Variables and functions */
scalar_t__ write_com_4bit(int);
void lcd_reverse() {
  write_com_4bit(0x0004 | 0x0000);
  while (write_com_4bit(0x0100) != 0)
    ;
}


x86 assembly (clang, -O0):
<lcd_reverse>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <write_com_4bit@plt>
mov    $0x100,%edi
call   1030 <write_com_4bit@plt>
cmp    $0x0,%rax
je     1137 <lcd_reverse+0x27>
jmp    111e <lcd_reverse+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_reverse>:
push   %rax
mov    $0x4,%edi
call   1030 <write_com_4bit@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x100,%edi
call   1030 <write_com_4bit@plt>
test   %rax,%rax
jne    1120 <lcd_reverse+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @lcd_reverse() {
%1 = call i64 @write_com_4bit(i32 4)
br label %2
2: ; preds = %5, %0
%3 = call i64 @write_com_4bit(i32 256)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @lcd_reverse() {
%1 = tail call i64 @write_com_4bit(i32 4)
br label %2
2: ; preds = %2, %0
%3 = tail call i64 @write_com_4bit(i32 256)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
int mycmpfunc(const char *aptr, int asiz, const char *bptr, int bsiz,
              void *op) {
  return 0;
}


x86 assembly (clang, -O0):
<mycmpfunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mycmpfunc(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
ret i32 0
}

LLVM IR (-O2):
define i32 @mycmpfunc(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3, i8* nocapture readnone %4) {
ret i32 0
}
int islower(const int c) { return c >= 'a' && c <= 'z'; }


x86 assembly (clang, -O0):
<islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <islower+0x20>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @islower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
void gdk_display_manager_list_displays() {}


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

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

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

LLVM IR (-O2):
define void @gdk_display_manager_list_displays() {
ret void
}
int maxof(int x, int y) {
  if (x > y)
    return (x);
  else
    return (y);
}


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

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

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

LLVM IR (-O2):
define i32 @maxof(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t swap_bytes16(uint16_t i) {
  uint16_t res = i & 0xff;
  res <<= 8;
  res |= i >> 8;
  return res;
}


x86 assembly (clang, -O0):
<swap_bytes16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_bytes16>:
mov    %edi,%eax
shl    $0x8,%eax
movzwl %ax,%eax
sar    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @swap_bytes16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 255
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = shl i32 %6, 8
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = ashr i32 %8, 8
%10 = load i32, i32* %3
%11 = or i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @swap_bytes16(i32 %0) {
%2 = shl i32 %0, 8
%3 = and i32 %2, 65280
%4 = ashr i32 %0, 8
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int getpid();
int master();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("Welcome to the game Rock-Paper-Scissors! [%d]\n", getpid());
  return (master());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <master@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <master@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"Welcome to the game Rock-Paper-Scissors! [%d]\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getpid()
%3 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @master()
ret i32 %4
}

LLVM IR (-O2):
@.str = [47 x i8] c"Welcome to the game Rock-Paper-Scissors! [%d]\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @master()
ret i32 %3
}
int nls_op_mul(int a, int b) { return a * b; }


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

x86 assembly (clang, -O2):
<nls_op_mul>:
mov    %edi,%eax
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @nls_op_mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ desplayMenuOptions();
int getMenuOption();
int /*<<< orphan*/ performOperation(int);
int /*<<< orphan*/ waitForEnterKey();
int main() {
  while (1) {
    desplayMenuOptions();
    int i = getMenuOption();
    performOperation(i);
    waitForEnterKey();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <desplayMenuOptions@plt>
mov    $0x0,%al
call   1040 <getMenuOption@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <performOperation@plt>
mov    $0x0,%al
call   1030 <waitForEnterKey@plt>
jmp    114f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <desplayMenuOptions@plt>
xor    %eax,%eax
call   1040 <getMenuOption@plt>
mov    %eax,%edi
call   1050 <performOperation@plt>
xor    %eax,%eax
call   1030 <waitForEnterKey@plt>
jmp    1150 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @desplayMenuOptions()
%5 = call i32 (...) @getMenuOption()
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @performOperation(i32 %6)
%8 = call i32 (...) @waitForEnterKey()
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @desplayMenuOptions()
%3 = tail call i32 (...) @getMenuOption()
%4 = tail call i32 @performOperation(i32 %3)
%5 = tail call i32 (...) @waitForEnterKey()
br label %1
}
int strhash(x)
char *x;
{
  unsigned int h = 0;
  while (*x)
    h = h * 13u + (unsigned int)*(x++);
  return h;
}


x86 assembly (clang, -O0):
<strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113c <strhash+0x3c>
imul   $0xd,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strhash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <strhash+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,2),%edx
lea    (%rax,%rdx,4),%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strhash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 13
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_push(int, struct list **);
struct list *list_constructor_head(int n) {
  struct list *head = NULL;
  int i = 0;
  for (i = 0; i < n; i++) {
    list_push(i, &head);
  }
  return head;
}


x86 assembly (clang, -O0):
<list_constructor_head>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1157 <list_constructor_head+0x47>
mov    -0x14(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <list_push@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1131 <list_constructor_head+0x21>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_constructor_head>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
xor    %ebx,%ebx
test   %edi,%edi
jle    1146 <list_constructor_head+0x36>
mov    %edi,%ebp
lea    0x8(%rsp),%r14
xchg   %ax,%ax
mov    %ebx,%edi
mov    %r14,%rsi
call   1030 <list_push@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1130 <list_constructor_head+0x20>
mov    0x8(%rsp),%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.list = type { i32 }
define %struct.list* @list_constructor_head(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.list*
%4 = alloca i32
store i32 %0, i32* %2
store %struct.list* null, %struct.list** %3
store i32 0, i32* %4
store i32 0, i32* %4
br label %5
5: ; preds = %12, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i32, i32* %4
%11 = call i32 @list_push(i32 %10, %struct.list** %3)
br label %12
12: ; preds = %9
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
br label %5
15: ; preds = %5
%16 = load %struct.list*, %struct.list** %3
ret %struct.list* %16
}

LLVM IR (-O2):
%struct.list = type { i32 }
define %struct.list* @list_constructor_head(i32 %0) {
%2 = alloca %struct.list*
%3 = bitcast %struct.list** %2 to i8*
store %struct.list* null, %struct.list** %2
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %12
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 0, %1 ]
%7 = call i32 @list_push(i32 %6, %struct.list** %2)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %5
10: ; preds = %5
%11 = load %struct.list*, %struct.list** %2
br label %12
12: ; preds = %10, %1
%13 = phi %struct.list* [ %11, %10 ], [ null, %1 ]
ret %struct.list* %13
}
/* Type definitions */
struct fid_fabric {
  int dummy;
};
struct fid_domain {
  int dummy;
};
struct fi_info {
  int dummy;
};

/* Variables and functions */
int gnix_domain_open(struct fid_fabric *, struct fi_info *,
                     struct fid_domain **, void *);
int fi_domain(struct fid_fabric *fabric, struct fi_info *info,
              struct fid_domain **domain, void *context) {
  return gnix_domain_open(fabric, info, domain, context);
}


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

x86 assembly (clang, -O2):
<fi_domain>:
jmp    1030 <gnix_domain_open@plt>

LLVM IR (-O0):
%struct.fid_fabric = type { i32 }
%struct.fi_info = type { i32 }
%struct.fid_domain = type { i32 }
define i32 @fi_domain(%struct.fid_fabric* %0, %struct.fi_info* %1, %struct.fid_domain** %2, i8* %3) {
%5 = alloca %struct.fid_fabric*
%6 = alloca %struct.fi_info*
%7 = alloca %struct.fid_domain**
%8 = alloca i8*
store %struct.fid_fabric* %0, %struct.fid_fabric** %5
store %struct.fi_info* %1, %struct.fi_info** %6
store %struct.fid_domain** %2, %struct.fid_domain*** %7
store i8* %3, i8** %8
%9 = load %struct.fid_fabric*, %struct.fid_fabric** %5
%10 = load %struct.fi_info*, %struct.fi_info** %6
%11 = load %struct.fid_domain**, %struct.fid_domain*** %7
%12 = load i8*, i8** %8
%13 = call i32 @gnix_domain_open(%struct.fid_fabric* %9, %struct.fi_info* %10, %struct.fid_domain** %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.fid_fabric = type { i32 }
%struct.fi_info = type { i32 }
%struct.fid_domain = type { i32 }
define i32 @fi_domain(%struct.fid_fabric* %0, %struct.fi_info* %1, %struct.fid_domain** %2, i8* %3) {
%5 = tail call i32 @gnix_domain_open(%struct.fid_fabric* %0, %struct.fi_info* %1, %struct.fid_domain** %2, i8* %3)
ret i32 %5
}
unsigned int def_hashfunc(void *key) {
  unsigned int hash = 0;
  unsigned char *k = (unsigned char *)key;
  while (*k)
    hash += *k++;
  return hash;
}


x86 assembly (clang, -O0):
<def_hashfunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <def_hashfunc+0x41>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movzbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <def_hashfunc+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<def_hashfunc>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <def_hashfunc+0x21>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <def_hashfunc+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @def_hashfunc(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = zext i8 %5 to i32
%10 = add i32 %7, %9
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int f();
int main() {
  if (f() != sizeof("01234"))
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <f@plt>
cltq
cmp    $0x6,%rax
je     1149 <main+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f@plt>
cmp    $0x6,%eax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f()
%3 = sext i32 %2 to i64
%4 = icmp ne i64 %3, 6
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = icmp eq i32 %1, 6
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ play();
void main() { play(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @play()
ret void
}
__float128 from_sign_char(signed char a) { return (__float128)a; }


x86 assembly (clang, -O0):
<from_sign_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
movsbl %al,%edi
call   1120 <__floatsitf>
add    $0x10,%rsp
pop    %rbp
ret
nop

x86 assembly (clang, -O2):
<from_sign_char>:
push   %rax
call   1110 <__floatsitf>
pop    %rax
ret
nopl   0x0(%rax,%rax,1)

LLVM IR (-O0):
define fp128 @from_sign_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sitofp i8 %3 to fp128
ret fp128 %4
}

LLVM IR (-O2):
define fp128 @from_sign_char(i8 signext %0) {
%2 = sitofp i8 %0 to fp128
ret fp128 %2
}