xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ f(int);
int nondet_bool();
int main() {
  int c = nondet_bool();
  if (c) {
    f(1);
  } else {
    f(2);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <nondet_bool@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1152 <main+0x32>
mov    $0x1,%edi
call   1030 <f@plt>
jmp    115c <main+0x3c>
mov    $0x2,%edi
call   1030 <f@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <nondet_bool@plt>
cmp    $0x1,%eax
mov    $0x1,%edi
adc    $0x0,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nondet_bool()
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i32 2, i32 1
%4 = tail call i32 @f(i32 %3)
ret i32 0
}
void do_post_lock_event(int id) {}


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

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

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

LLVM IR (-O2):
define void @do_post_lock_event(i32 %0) {
ret void
}
unsigned int x86_tsc_start(void) {
  unsigned int reg_eax, reg_ebx, reg_ecx, reg_edx;
  __asm__ __volatile__("mov %%ebx, %%edi   \n\t"
                       "cpuid              \n\t"
                       "xchg %%edi, %%ebx  \n\t"
                       : "=a"(reg_eax), "=D"(reg_ebx), "=c"(reg_ecx),
                         "=d"(reg_edx)
                       : "a"(0), "c"(0));
  ;
  return x86_readtsc();
}


x86 assembly (clang, -O0):
<x86_tsc_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %ecx,%ecx
mov    %ecx,%eax
mov    %ebx,%edi
cpuid
xchg   %ebx,%edi
mov    %eax,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %ecx,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <x86_readtsc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x86_tsc_start>:
xor    %eax,%eax
xor    %ecx,%ecx
mov    %ebx,%edi
cpuid
xchg   %ebx,%edi
xor    %eax,%eax
jmp    1030 <x86_readtsc@plt>

LLVM IR (-O0):
define i32 @x86_tsc_start() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call { i32, i32, i32, i32 } asm sideeffect "mov %ebx, %edi \0A\09cpuid \0A\09xchg %edi, %ebx \0A\09", "={ax},={di},={cx},={dx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i32 0, i32 0)
%6 = extractvalue { i32, i32, i32, i32 } %5, 0
%7 = extractvalue { i32, i32, i32, i32 } %5, 1
%8 = extractvalue { i32, i32, i32, i32 } %5, 2
%9 = extractvalue { i32, i32, i32, i32 } %5, 3
store i32 %6, i32* %1
store i32 %7, i32* %2
store i32 %8, i32* %3
store i32 %9, i32* %4
%10 = call i32 (...) @x86_readtsc()
ret i32 %10
}

LLVM IR (-O2):
define i32 @x86_tsc_start() {
%1 = tail call { i32, i32, i32, i32 } asm sideeffect "mov %ebx, %edi \0A\09cpuid \0A\09xchg %edi, %ebx \0A\09", "={ax},={di},={cx},={dx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i32 0, i32 0)
%2 = tail call i32 (...) @x86_readtsc()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ set_clear(int);
void f_set(void) { set_clear(0x58000000); }


x86 assembly (clang, -O0):
<f_set>:
push   %rbp
mov    %rsp,%rbp
mov    $0x58000000,%edi
call   1030 <set_clear@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_set>:
mov    $0x58000000,%edi
jmp    1030 <set_clear@plt>

LLVM IR (-O0):
define void @f_set() {
%1 = call i32 @set_clear(i32 1476395008)
ret void
}

LLVM IR (-O2):
define void @f_set() {
%1 = tail call i32 @set_clear(i32 1476395008)
ret void
}
int hostapd_get_hw_features(struct hostapd_iface *iface) { return -1; }


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

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

LLVM IR (-O0):
%struct.hostapd_iface = type opaque
define i32 @hostapd_get_hw_features(%struct.hostapd_iface* %0) {
%2 = alloca %struct.hostapd_iface*
store %struct.hostapd_iface* %0, %struct.hostapd_iface** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.hostapd_iface = type opaque
define i32 @hostapd_get_hw_features(%struct.hostapd_iface* nocapture readnone %0) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ read_word(char *, int, char const *);
scalar_t__ strcmp(char *, char *);
scalar_t__ strlen(char *);
int ignore_line(const char *line) {
  char s[16];
  read_word(s, (sizeof(s) / sizeof(*s)), line);
  if (strlen(s) == 0 || strcmp(s, "#") == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ignore_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x10,%esi
call   1050 <read_word@plt>
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
je     117b <ignore_line+0x4b>
lea    -0x20(%rbp),%rdi
lea    0xe94(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1187 <ignore_line+0x57>
movl   $0x1,-0x4(%rbp)
jmp    118e <ignore_line+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_line>:
sub    $0x18,%rsp
mov    %rdi,%rdx
mov    %rsp,%rdi
mov    $0x10,%esi
call   1040 <read_word@plt>
cmpb   $0x0,(%rsp)
je     1159 <ignore_line+0x39>
lea    0xebf(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x18,%rsp
ret
mov    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"#\00"
define i32 @ignore_line(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [16 x i8]
store i8* %0, i8** %3
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%6 = load i8*, i8** %3
%7 = call i32 @read_word(i8* %5, i32 16, i8* %6)
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%9 = call i64 @strlen(i8* %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %1
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11, %1
store i32 1, i32* %2
br label %17
16: ; preds = %11
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [2 x i8] c"#\00"
define i32 @ignore_line(i8* %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @read_word(i8* %3, i32 16, i8* %0)
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %1
%12 = phi i32 [ 1, %1 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int printf(char *, int);
main() {
  int x;
  x = printf("%d\n", x = printf("%d", 890));
  printf("%d", x);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeec(%rip),%rbx
mov    %rbx,%rdi
mov    $0x37a,%esi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 890)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
void insw(int port, void *addr, int cnt) {
  asm volatile("cld; rep insw"
               : "=D"(addr), "=c"(cnt)
               : "d"(port), "0"(addr), "1"(cnt)
               : "memory", "cc");
}


x86 assembly (clang, -O0):
<insw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%ecx
cld
rep insw (%dx),%es:(%rdi)
mov    %rdi,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insw>:
mov    %edx,%ecx
mov    %edi,%edx
mov    %rsi,%rdi
cld
rep insw (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insw(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call { i8*, i32 } asm sideeffect "cld; rep insw", "={di},={cx},{dx},0,1,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %7, i8* %8, i32 %9)
%11 = extractvalue { i8*, i32 } %10, 0
%12 = extractvalue { i8*, i32 } %10, 1
store i8* %11, i8** %5
store i32 %12, i32* %6
ret void
}

LLVM IR (-O2):
define void @insw(i32 %0, i8* %1, i32 %2) {
%4 = tail call { i8*, i32 } asm sideeffect "cld; rep insw", "={di},={cx},{dx},0,1,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ recur_coroutine();
int main(int argc, char **argv) { recur_coroutine(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @recur_coroutine()
ret i32 0
}
int main() {
  int a = 0;
  int b = 10;
  int c = 0;
  if (a != 0)
    c = b / a;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1134 <main+0x34>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
adr0adr1_set(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (*((int *)10000000)) = (*((int *)11111111)); }


x86 assembly (clang, -O0):
<adr0adr1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    $0xa98ac7,%eax
mov    (%rax),%ecx
mov    $0x989680,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adr1_set>:
mov    0xa98ac7,%eax
mov    %eax,0x989680
ret

LLVM IR (-O0):
define i32 @adr0adr1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* inttoptr (i64 11111111 to i32*)
store i32 %14, i32* inttoptr (i64 10000000 to i32*)
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
define i32 @adr0adr1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = load i32, i32* inttoptr (i64 11111111 to i32*)
store i32 %7, i32* inttoptr (i64 10000000 to i32*)
ret i32 undef
}
long long longlong_ignoring_unsignedlonglong(long long x,
                                             unsigned long long y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @longlong_ignoring_unsignedlonglong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int syscall(int, char *, int /*<<< orphan*/);
int getcwd(char *cwdname) { return syscall(28, cwdname, 0); }


x86 assembly (clang, -O0):
<getcwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1c,%edi
xor    %edx,%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcwd>:
mov    %rdi,%rsi
mov    $0x1c,%edi
xor    %edx,%edx
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @getcwd(i8* %0) {
%2 = tail call i32 @syscall(i32 28, i8* %0, i32 0)
ret i32 %2
}
void ft_swap(void **a, void **b) {
  void *s;
  s = *a;
  *a = *b;
  *b = s;
}


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

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

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

LLVM IR (-O2):
define void @ft_swap(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reply(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void replystr(const char *str) { reply(str, strlen(str)); }


x86 assembly (clang, -O0):
<replystr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <reply@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replystr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <reply@plt>

LLVM IR (-O0):
define void @replystr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @reply(i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @replystr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @reply(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
float ss2qcs();
float ss2qcs_(void) { return ss2qcs(); }


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

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

LLVM IR (-O0):
define float @ss2qcs_() {
%1 = call float (...) @ss2qcs()
ret float %1
}

LLVM IR (-O2):
define float @ss2qcs_() {
%1 = tail call float (...) @ss2qcs()
ret float %1
}
imm0imm1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if (22 <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm0imm1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    %ecx,-0xc(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @imm0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i16
%8 = alloca i16
%9 = alloca i32
%10 = alloca i32
%11 = alloca i16*
%12 = alloca i16*
%13 = trunc i32 %0 to i16
%14 = trunc i32 %1 to i16
store i16 %13, i16* %7
store i16 %14, i16* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i16* %4, i16** %11
store i16* %5, i16** %12
ret i32 1
}

LLVM IR (-O2):
define i32 @imm0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
ret i32 1
}
int my_getfd(int fd) { return fd; }


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

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

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

LLVM IR (-O2):
define i32 @my_getfd(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
struct perf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ perf_pause(struct perf *);
void perf_stop(struct perf *p) { perf_pause(p); }


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

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

LLVM IR (-O0):
%struct.perf = type { i32 }
define void @perf_stop(%struct.perf* %0) {
%2 = alloca %struct.perf*
store %struct.perf* %0, %struct.perf** %2
%3 = load %struct.perf*, %struct.perf** %2
%4 = call i32 @perf_pause(%struct.perf* %3)
ret void
}

LLVM IR (-O2):
%struct.perf = type { i32 }
define void @perf_stop(%struct.perf* %0) {
%2 = tail call i32 @perf_pause(%struct.perf* %0)
ret void
}
int test_imm_4Auint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x4A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_4Auint64_highword_reg>:
movabs $0x4a00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ LC_GLOBAL_LOCALE;
locale_t uselocale(locale_t newloc) {
  ;
  return LC_GLOBAL_LOCALE;
}


x86 assembly (clang, -O0):
<uselocale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@LC_GLOBAL_LOCALE = global i32 0
define i32 @uselocale(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @LC_GLOBAL_LOCALE
ret i32 %3
}

LLVM IR (-O2):
@LC_GLOBAL_LOCALE = global i32 0
define i32 @uselocale(i32 %0) {
%2 = load i32, i32* @LC_GLOBAL_LOCALE
ret i32 %2
}
/* Variables and functions */
int Emmc_powerOff();
int Emmc_powerOn();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ wait(int);
int Emmc_powerCycle(void) {
  int res = 0;
  if ((res = Emmc_powerOff()) < 0) {
    return -1;
  }
  wait(50);
  if ((res = Emmc_powerOn()) < 0)
    printf("ssed - Failed to power on\n");
  return res;
}


x86 assembly (clang, -O0):
<Emmc_powerCycle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <Emmc_powerOff@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    116e <Emmc_powerCycle+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    119d <Emmc_powerCycle+0x5d>
mov    $0x32,%edi
call   1060 <wait@plt>
mov    $0x0,%al
call   1050 <Emmc_powerOn@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1197 <Emmc_powerCycle+0x57>
lea    0xe6e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Emmc_powerCycle>:
push   %rbx
xor    %eax,%eax
call   1030 <Emmc_powerOff@plt>
test   %eax,%eax
js     1171 <Emmc_powerCycle+0x31>
mov    $0x32,%edi
call   1060 <wait@plt>
xor    %eax,%eax
call   1050 <Emmc_powerOn@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1176 <Emmc_powerCycle+0x36>
lea    0xe96(%rip),%rdi
call   1040 <puts@plt>
jmp    1176 <Emmc_powerCycle+0x36>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"ssed - Failed to power on\0A\00"
define i32 @Emmc_powerCycle() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
%3 = call i32 (...) @Emmc_powerOff()
store i32 %3, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 -1, i32* %1
br label %14
6: ; preds = %0
%7 = call i32 @wait(i32 50)
%8 = call i32 (...) @Emmc_powerOn()
store i32 %8, i32* %2
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %6
%13 = load i32, i32* %2
store i32 %13, i32* %1
br label %14
14: ; preds = %12, %5
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@str = [26 x i8] c"ssed - Failed to power on\00"
define i32 @Emmc_powerCycle() {
%1 = tail call i32 (...) @Emmc_powerOff()
%2 = icmp slt i32 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = tail call i32 @wait(i32 50)
%5 = tail call i32 (...) @Emmc_powerOn()
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %3, %7, %0
%10 = phi i32 [ -1, %0 ], [ %5, %7 ], [ %5, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void setPixel(int x, int y) { printf("%d %d\n", x, y); }


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

x86 assembly (clang, -O2):
<setPixel>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
define void @setPixel(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define void @setPixel(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(char *);
int /*<<< orphan*/ free(char *);
char *malloc(int);
void really(void) {
  int i;
  char *p = malloc(10);
  __ESBMC_assume(p);
  for (i = 0; i < 1; i++)
    p[i] = 'z';
  free(p);
}


x86 assembly (clang, -O0):
<really>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <__ESBMC_assume@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    117a <really+0x4a>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movb   $0x7a,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <really+0x26>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<really>:
push   %rbx
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <__ESBMC_assume@plt>
movb   $0x7a,(%rbx)
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @really() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @__ESBMC_assume(i8* %1)
store i8 122, i8* %1
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void KeccakP400_AddByte(void *state, unsigned char byte, unsigned int offset) {
  assert(offset < 50);
  ((unsigned char *)state)[offset] ^= byte;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x32,-0x10(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movzbl -0x9(%rbp),%esi
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movzbl (%rax,%rcx,1),%edx
xor    %esi,%edx
mov    %dl,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%rbp
xor    %edi,%edi
cmp    $0x32,%edx
setb   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
xor    %r14b,0x0(%rbp,%rax,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @KeccakP400_AddByte(i8* %0, i8 zeroext %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 i32, i32* %6
%8 = icmp ult i32 %7, 50
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = load i8*, i8** %4
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = xor i32 %18, %12
%20 = trunc i32 %19 to i8
store i8 %20, i8* %16
ret void
}

LLVM IR (-O2):
define void @KeccakP400_AddByte(i8* nocapture %0, i8 zeroext %1, i32 %2) {
%4 = icmp ult i32 %2, 50
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = zext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = xor i8 %9, %1
store i8 %10, i8* %8
ret void
}
void g_array_remove_index_fast() {}


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

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

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

LLVM IR (-O2):
define void @g_array_remove_index_fast() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ experiment();
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d\n", &n);
  while (n-- > 0)
    experiment();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    115f <main+0x3f>
mov    $0x0,%al
call   1030 <experiment@plt>
jmp    113f <main+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x4(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x4(%rsp)
test   %eax,%eax
jle    1158 <main+0x38>
xor    %eax,%eax
call   1030 <experiment@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* %2
%6 = add nsw i32 %5, -1
store i32 %6, i32* %2
%7 = icmp sgt i32 %5, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = call i32 (...) @experiment()
br label %4
10: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, -1
store i32 %5, i32* %1
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %12
7: ; preds = %0, %7
%8 = call i32 (...) @experiment()
%9 = load i32, i32* %1
%10 = add nsw i32 %9, -1
store i32 %10, i32* %1
%11 = icmp sgt i32 %9, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int TimerEvnet() {
  printf("\n test.c : On Timer Event\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<TimerEvnet>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"\0A test.c : On Timer Event\0A\00"
define i32 @TimerEvnet() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [26 x i8] c"\0A test.c : On Timer Event\00"
define i32 @TimerEvnet() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i32 1
}
void windexit(r) int r;
{
  reset_tty();
  exit(r);
}


x86 assembly (clang, -O0):
<windexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <reset_tty@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<windexit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <reset_tty@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @windexit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @reset_tty()
%4 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
define void @windexit(i32 %0) {
%2 = tail call i32 (...) @reset_tty()
tail call void @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ tcpudp_act_cyc(int /*<<< orphan*/);
void tcpudp_close(void) { tcpudp_act_cyc(0); }


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

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

LLVM IR (-O0):
define void @tcpudp_close() {
%1 = call i32 @tcpudp_act_cyc(i32 0)
ret void
}

LLVM IR (-O2):
define void @tcpudp_close() {
%1 = tail call i32 @tcpudp_act_cyc(i32 0)
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int strlen(char const *);
int length_sort(const char *a, const char *b) {
  int alen = strlen(a), blen = strlen(b);
  if (alen < blen)
    return 1;
  if (blen < alen)
    return -1;
  return strcmp(a, b);
}


x86 assembly (clang, -O0):
<length_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1160 <length_sort+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1188 <length_sort+0x68>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1178 <length_sort+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    1188 <length_sort+0x68>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<length_sort>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%ebp
jl     114b <length_sort+0x2b>
mov    $0xffffffff,%eax
jle    1150 <length_sort+0x30>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @length_sort(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp slt i32 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = icmp slt i32 %4, %3
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
br label %10
10: ; preds = %6, %2, %8
%11 = phi i32 [ %9, %8 ], [ 1, %2 ], [ -1, %6 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ j64_earr_encode(char *, int);
int /*<<< orphan*/ memset(char *, char, int);
scalar_t__ strcmp(char *, char *);
int test_earr_encode_2(void) {
  char buf[2 + 1];
  memset(buf, '\0', sizeof(buf));
  j64_earr_encode(buf, 2);
  return strcmp(buf, "[]") == 0;
}


x86 assembly (clang, -O0):
<test_earr_encode_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x3(%rbp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1040 <memset@plt>
lea    -0x3(%rbp),%rdi
mov    $0x2,%esi
call   1030 <j64_earr_encode@plt>
lea    -0x3(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_earr_encode_2>:
push   %rbx
sub    $0x10,%rsp
lea    0xd(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <j64_earr_encode@plt>
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"[]\00"
define i32 @test_earr_encode_2() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i8 signext 0, i32 3)
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%5 = call i32 @j64_earr_encode(i8* %4, i32 2)
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"[]\00"
define i32 @test_earr_encode_2() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i8 signext 0, i32 3)
%4 = call i32 @j64_earr_encode(i8* %2, i32 2)
%5 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Floyd(int **);
int main() {
  int graph[4][4] = {{0, 5, 99999, 10},
                     {99999, 0, 3, 99999},
                     {99999, 99999, 0, 1},
                     {99999, 99999, 99999, 0}};
  Floyd(graph);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
lea    -0x50(%rbp),%rdi
call   1040 <Floyd@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <Floyd@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.graph = [4 x [4 x i32]] [[4 x i32] [i32 0, i32 5, i32 99999, i32 10], [4 x i32] [i32 99999, i32 0, i32 3, i32 99999], [4 x i32] [i32 99999, i32 99999, i32 0, i32 1], [4 x i32] [i32 99999, i32 99999, i32 99999, i32 0]]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x [4 x i32]]
store i32 0, i32* %1
%3 = bitcast [4 x [4 x i32]]* %2 to i8*
%4 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %2, i64 0, i64 0
%5 = bitcast [4 x i32]* %4 to i32**
%6 = call i32 @Floyd(i32** %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.graph = [4 x [4 x i32]] [[4 x i32] [i32 0, i32 5, i32 99999, i32 10], [4 x i32] [i32 99999, i32 0, i32 3, i32 99999], [4 x i32] [i32 99999, i32 99999, i32 0, i32 1], [4 x i32] [i32 99999, i32 99999, i32 99999, i32 0]]
define i32 @main() {
%1 = alloca [4 x [4 x i32]]
%2 = bitcast [4 x [4 x i32]]* %1 to i8*
%3 = bitcast [4 x [4 x i32]]* %1 to i32**
%4 = call i32 @Floyd(i32** %3)
ret i32 0
}
unsigned xrop3_54_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D | T;
  stk1 = S ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_54_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_54_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
shl    $0x8,%esi
lea    0xff(%rsi),%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_54_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %6
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = xor i32 %29, -1
%31 = and i32 %28, %30
%32 = load i32, i32* %5
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = or i32 %31, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @xrop3_54_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, 255
%8 = xor i32 %4, -1
%9 = and i32 %7, %8
%10 = or i32 %9, %3
ret i32 %10
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XGravityEvent;

/* Variables and functions */
void set_XGravityEvent_type(void *_p, int _v) {
  ((XGravityEvent *)_p)->type = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XGravityEvent_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XGravityEvent_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XGravityEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __tracing_path_set(char *, char const *);
void tracing_path_set(const char *mntpt) {
  __tracing_path_set("tracing/", mntpt);
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"tracing/\00"
define void @tracing_path_set(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @__tracing_path_set(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"tracing/\00"
define void @tracing_path_set(i8* %0) {
%2 = tail call i32 @__tracing_path_set(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

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


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

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

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

LLVM IR (-O2):
define i32 @test_mm_mul_pd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_mul_pd(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ arm_arith_add(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ arm_data_imm_op();
void arm_add_imm() { arm_arith_add(arm_data_imm_op(), 0); }


x86 assembly (clang, -O0):
<arm_add_imm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <arm_data_imm_op@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <arm_arith_add@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_add_imm>:
push   %rax
xor    %eax,%eax
call   1030 <arm_data_imm_op@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <arm_arith_add@plt>

LLVM IR (-O0):
define void @arm_add_imm() {
%1 = call i32 (...) @arm_data_imm_op()
%2 = call i32 @arm_arith_add(i32 %1, i32 0)
ret void
}

LLVM IR (-O2):
define void @arm_add_imm() {
%1 = tail call i32 (...) @arm_data_imm_op()
%2 = tail call i32 @arm_arith_add(i32 %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errnoAbort(char *, char *, char *);
int rename(char *, char *);
void mustRename(char *oldName, char *newName) {
  int err = rename(oldName, newName);
  if (err < 0)
    errnoAbort("Couldn't rename %s to %s", oldName, newName);
}


x86 assembly (clang, -O0):
<mustRename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <rename@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    115e <mustRename+0x3e>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xea7(%rip),%rdi
call   1030 <errnoAbort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mustRename>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <rename@plt>
test   %eax,%eax
js     113b <mustRename+0x1b>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <errnoAbort@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Couldn't rename %s to %s\00"
define void @mustRename(i8* %0, i8* %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 = load i8*, i8** %4
%8 = call i32 @rename(i8* %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i32 @errnoAbort(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
br label %15
15: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Couldn't rename %s to %s\00"
define void @mustRename(i8* %0, i8* %1) {
%3 = tail call i32 @rename(i8* %0, i8* %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @errnoAbort(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %7
7: ; preds = %5, %2
ret void
}