xunge/DecIR huggingface dataset:
int sysfs_create_link_nowarn(struct kobject *kobj, struct kobject *target,
                             const char *name) {
  return 0;
}


x86 assembly (clang, -O0):
<sysfs_create_link_nowarn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.kobject = type opaque
define i32 @sysfs_create_link_nowarn(%struct.kobject* %0, %struct.kobject* %1, i8* %2) {
%4 = alloca %struct.kobject*
%5 = alloca %struct.kobject*
%6 = alloca i8*
store %struct.kobject* %0, %struct.kobject** %4
store %struct.kobject* %1, %struct.kobject** %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
%struct.kobject = type opaque
define i32 @sysfs_create_link_nowarn(%struct.kobject* nocapture readnone %0, %struct.kobject* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
void RTMemExecAllocTag(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemExecAllocTag() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int create_socket() {
  int fd;
  fd = socket(AF_INET, SOCK_STREAM, 0);
  if (fd < 0) {
    printf("Could not create socket");
    exit(1);
  }
  printf("socket created...\n");
  return fd;
}


x86 assembly (clang, -O0):
<create_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1174 <create_socket+0x44>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_socket>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    0x2e87(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1060 <socket@plt>
test   %eax,%eax
js     1170 <create_socket+0x30>
mov    %eax,%ebx
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [24 x i8] c"Could not create socket\00"
@.str.1 = [19 x i8] c"socket created...\0A\00"
define i32 @create_socket() {
%1 = alloca i32
%2 = load i32, i32* @AF_INET
%3 = load i32, i32* @SOCK_STREAM
%4 = call i32 @socket(i32 %2, i32 %3, i32 0)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [24 x i8] c"Could not create socket\00"
@str = [18 x i8] c"socket created...\00"
define i32 @create_socket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 %3
}
double double_div(double a, double b) { return a / b; }


x86 assembly (clang, -O0):
<double_div>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_div>:
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @double_div(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @double_div(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
char *strchr(register const char *s, int c) {
  do {
    if (*s == ((char)c)) {
      return (char *)s;
    }
  } while (*s++);
  return 0;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    112d <strchr+0x2d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <strchr+0x52>
jmp    1132 <strchr+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    110b <strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
nopw   0x0(%rax,%rax,1)
movsbl (%rax),%edx
cmp    %edx,%ecx
je     1121 <strchr+0x21>
add    $0x1,%rax
test   %dl,%dl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
br label %5
5: ; preds = %10, %2
%6 = phi i8* [ %0, %2 ], [ %11, %10 ]
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %4, %8
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = icmp eq i8 %7, 0
br i1 %12, label %13, label %5
13: ; preds = %10, %5
%14 = phi i8* [ %6, %5 ], [ null, %10 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void darray_delete_ptr(void *arr) {
  struct {
    char *data;
    size_t len;
    size_t size;
  } *p = arr;
  free(p->data);
}


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

x86 assembly (clang, -O2):
<darray_delete_ptr>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.anon = type { i8*, i64, i64 }
define void @darray_delete_ptr(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.anon*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.anon*
store %struct.anon* %5, %struct.anon** %3
%6 = load %struct.anon*, %struct.anon** %3
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 0
%8 = load i8*, i8** %7
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
define void @darray_delete_ptr(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
ret void
}
void draw_plankton(int x, int y) {}


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

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

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

LLVM IR (-O2):
define void @draw_plankton(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Led2__set();
void LedsP__Leds__led2Off(void) {
  LedsP__Led2__set();
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @LedsP__Leds__led2Off() {
%1 = tail call i32 (...) @LedsP__Led2__set()
ret void
}
/* Variables and functions */
char *xbp_getcwd(char *, int);
char *__wrap_getcwd(char *buf, int size) { return xbp_getcwd(buf, size); }


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

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

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

LLVM IR (-O2):
define i8* @__wrap_getcwd(i8* %0, i32 %1) {
%3 = tail call i8* @xbp_getcwd(i8* %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ gl_insert(int);
void gl_read(void) {
  int tmp;
  int tmp___0;
  {
    {
      while (1) {
      while_19_continue:;
        {
          tmp = __VERIFIER_nondet_int();
          gl_insert(tmp);
          tmp___0 = __VERIFIER_nondet_int();
        }
        if (tmp___0) {
        } else {
          goto while_19_break;
        }
      }
    while_19_break:;
    }
    return;
  }
}


x86 assembly (clang, -O0):
<gl_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
jmp    112d <gl_read+0xd>
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <gl_insert@plt>
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1158 <gl_read+0x38>
jmp    115d <gl_read+0x3d>
jmp    1162 <gl_read+0x42>
jmp    1128 <gl_read+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gl_read>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,%edi
call   1030 <gl_insert@plt>
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
jne    1130 <gl_read+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
define void @gl_read() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 @gl_insert(i32 %2)
%4 = tail call i32 (...) @__VERIFIER_nondet_int()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int comp(uint32_t a, uint32_t b) {
  while (a) {
    if (!b)
      return 1;
    a >>= 1;
    b >>= 1;
  }
  return b ? -1 : 0;
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1141 <comp+0x41>
cmpl   $0x0,-0xc(%rbp)
jne    112a <comp+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1154 <comp+0x54>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110a <comp+0xa>
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
test   %edi,%edi
je     1121 <comp+0x21>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
test   %esi,%esi
je     1126 <comp+0x26>
mov    %edi,%eax
sar    %eax
sar    %esi
cmp    $0x1,%edi
mov    %eax,%edi
ja     1110 <comp+0x10>
neg    %esi
sbb    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @comp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %9
store i32 1, i32* %3
br label %23
13: ; preds = %9
%14 = load i32, i32* %4
%15 = ashr i32 %14, 1
store i32 %15, i32* %4
%16 = load i32, i32* %5
%17 = ashr i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
%19 = load i32, i32* %5
%20 = icmp ne i32 %19, 0
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 -1, i32 0
store i32 %22, i32* %3
br label %23
23: ; preds = %18, %12
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @comp(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %8
%5 = phi i32 [ %10, %8 ], [ %1, %2 ]
%6 = phi i32 [ %9, %8 ], [ %0, %2 ]
%7 = icmp eq i32 %5, 0
br i1 %7, label %16, label %8
8: ; preds = %4
%9 = ashr i32 %6, 1
%10 = ashr i32 %5, 1
%11 = icmp ult i32 %6, 2
br i1 %11, label %12, label %4
12: ; preds = %8, %2
%13 = phi i32 [ %1, %2 ], [ %10, %8 ]
%14 = icmp ne i32 %13, 0
%15 = sext i1 %14 to i32
br label %16
16: ; preds = %4, %12
%17 = phi i32 [ %15, %12 ], [ 1, %4 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ commSend(int const, char *, int *, void *);
int /*<<< orphan*/ procLgModule(char const *, int const, char *, int *);
void procLpMsg(const char *logicName, const int fd, const char *recvbuf,
               const int recvlen, void *from) {
  char sendbuf[1024] = {0};
  int sendlen = 0;
  procLgModule(recvbuf, recvlen, sendbuf, &sendlen);
  commSend(fd, sendbuf, &sendlen, from);
}


x86 assembly (clang, -O0):
<procLpMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
lea    -0x430(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
movl   $0x0,-0x434(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
lea    -0x430(%rbp),%rdx
lea    -0x434(%rbp),%rcx
call   1050 <procLgModule@plt>
mov    -0xc(%rbp),%edi
lea    -0x430(%rbp),%rsi
mov    -0x28(%rbp),%rcx
lea    -0x434(%rbp),%rdx
call   1030 <commSend@plt>
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<procLpMsg>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
mov    %r8,%r14
mov    %ecx,%ebp
mov    %rdx,%rbx
mov    %esi,%r15d
lea    0x10(%rsp),%r12
mov    $0x400,%edx
mov    %r12,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%r13
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r12,%rdx
mov    %r13,%rcx
call   1050 <procLgModule@plt>
mov    %r15d,%edi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %r14,%rcx
call   1030 <commSend@plt>
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @procLpMsg(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*
%11 = alloca [1024 x i8]
%12 = alloca i32
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
%13 = bitcast [1024 x i8]* %11 to i8*
store i32 0, i32* %12
%14 = load i8*, i8** %8
%15 = load i32, i32* %9
%16 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%17 = call i32 @procLgModule(i8* %14, i32 %15, i8* %16, i32* %12)
%18 = load i32, i32* %7
%19 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%20 = load i8*, i8** %10
%21 = call i32 @commSend(i32 %18, i8* %19, i32* %12, i8* %20)
ret void
}

LLVM IR (-O2):
define void @procLpMsg(i8* nocapture readnone %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca [1024 x i8]
%7 = alloca i32
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%9 = bitcast i32* %7 to i8*
store i32 0, i32* %7
%10 = call i32 @procLgModule(i8* %2, i32 %3, i8* %8, i32* %7)
%11 = call i32 @commSend(i32 %1, i8* %8, i32* %7, i8* %4)
ret void
}
int ismyalpha(int c) {
  return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'));
}


x86 assembly (clang, -O0):
<ismyalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1120 <ismyalpha+0x20>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    113f <ismyalpha+0x3f>
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1139 <ismyalpha+0x39>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ismyalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ismyalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int error(int, char *);
int /*<<< orphan*/ unhash();
int b_unhash(int argc, char *argv[]) {
  if (argc > 1)
    return error(1, argv[0]);
  unhash();
  return 0;
}


x86 assembly (clang, -O0):
<b_unhash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1152 <b_unhash+0x32>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x1,%edi
call   1030 <error@plt>
mov    %eax,-0x4(%rbp)
jmp    1160 <b_unhash+0x40>
mov    $0x0,%al
call   1040 <unhash@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_unhash>:
push   %rax
cmp    $0x2,%edi
jl     1134 <b_unhash+0x14>
mov    (%rsi),%rsi
mov    $0x1,%edi
pop    %rax
jmp    1030 <error@plt>
xor    %eax,%eax
call   1040 <unhash@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @b_unhash(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @error(i32 1, i8* %11)
store i32 %12, i32* %3
br label %15
13: ; preds = %2
%14 = call i32 (...) @unhash()
store i32 0, i32* %3
br label %15
15: ; preds = %13, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @b_unhash(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @error(i32 1, i8* %5)
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @unhash()
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %6, %4 ], [ 0, %7 ]
ret i32 %10
}
/* Variables and functions */
float floorf(float);
float futrts_floor32(float x) { return floorf(x); }


x86 assembly (clang, -O0):
<futrts_floor32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <floorf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @futrts_floor32(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.floor.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @futrts_floor32(float %0) {
%2 = tail call float @llvm.floor.f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char **argv) {
  int rank;
  int size;
  printf("Hello world! I am rank %d of %d.\n", rank, size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"Hello world! I am rank %d of %d.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %6
%9 = load i32, i32* %7
%10 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Hello world! I am rank %d of %d.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 undef, i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __attribute__((no, noclone)) bar(int a) {
  if (a != -1)
    abort();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     112c <bar+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
cmp    $0xffffffff,%edi
jne    1116 <bar+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @bar(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret void
}
unsigned xrop3_168_1_1(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 = T | S;
  stk1 = D & stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_168_1_1>:
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    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_168_1_1(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* %7
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = and 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* %7
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = and i32 %35, %36
%38 = or i32 %34, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %7
%41 = and i32 %39, %40
%42 = or i32 %38, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @xrop3_168_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint16_t;
typedef scalar_t__ s;

/* Variables and functions */
uint16_t msbtohost16(uint16_t s) {
  return ((uint16_t)((((uint16_t)(s) & (uint16_t)0x00ffU) << 8) |
                     (((uint16_t)(s) & (uint16_t)0xff00U) >> 8)));
}


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

x86 assembly (clang, -O2):
<msbtohost16>:
rol    $0x8,%di
movzwl %di,%eax
ret

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

LLVM IR (-O2):
define i32 @msbtohost16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ _unsupported();
int pthread_detach(pthread_t thread) {
  _unsupported();
  return -1;
}


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

x86 assembly (clang, -O2):
<pthread_detach>:
push   %rax
xor    %eax,%eax
call   1030 <_unsupported@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @pthread_detach(i32 %0) {
%2 = tail call i32 (...) @_unsupported()
ret i32 -1
}
/* Variables and functions */
unsigned char *md5_buffer(unsigned char *, unsigned char const *, size_t);
unsigned char *hash_buffer_md5(unsigned char *out, const unsigned char *in,
                               size_t in_len) {
  return md5_buffer(out, in, in_len);
}


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

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

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

LLVM IR (-O2):
define i8* @hash_buffer_md5(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @md5_buffer(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
void uart_putc(char c) {
  while ((((((0x7f000000) | 0x9000000000000000)) + 4) & 0xFFFF) == 0) {
    asm("dadd $v0, $v0, $0");
  }
  *(char *)((((0x7f000000) | 0x9000000000000000))) = c;
}


x86 assembly (clang, -O0):
x86 assembly (clang, -O2):
<uart_putc>:
movabs $0x900000007f000000,%rax
mov    %dil,(%rax)
ret

LLVM IR (-O0):
LLVM IR (-O2):
define void @uart_putc(i8 signext %0) {
store i8 %0, i8* inttoptr (i64 -8070450530117222400 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hangman();
int /*<<< orphan*/ input();
int /*<<< orphan*/ printf(char *);
int word();
int main() {
  if (word() == 1) {
    return 1;
  }
  printf("Welcome to Hangman! Enter your guess\n");
  hangman();
  input();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <word@plt>
cmp    $0x1,%eax
jne    116b <main+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1185 <main+0x45>
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <hangman@plt>
mov    $0x0,%al
call   1030 <input@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <word@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x1,%ecx
je     1170 <main+0x30>
lea    0xea5(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <hangman@plt>
xor    %eax,%eax
call   1030 <input@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Welcome to Hangman! Enter your guess\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @word()
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %9
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @hangman()
%8 = call i32 (...) @input()
br label %9
9: ; preds = %5, %4
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@str = [37 x i8] c"Welcome to Hangman! Enter your guess\00"
define i32 @main() {
%1 = tail call i32 (...) @word()
%2 = icmp eq i32 %1, 1
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (...) @hangman()
%6 = tail call i32 (...) @input()
br label %7
7: ; preds = %0, %3
%8 = phi i32 [ 0, %3 ], [ 1, %0 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ __aeabi_memset(void *, size_t, int /*<<< orphan*/);
void __aeabi_memclr(void *dest, size_t n) { __aeabi_memset(dest, n, 0); }


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

x86 assembly (clang, -O2):
<__aeabi_memclr>:
xor    %edx,%edx
jmp    1030 <__aeabi_memset@plt>

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

LLVM IR (-O2):
define void @__aeabi_memclr(i8* %0, i64 %1) {
%3 = tail call i32 @__aeabi_memset(i8* %0, i64 %1, i32 0)
ret void
}
/* Variables and functions */
char *Com_Parse(char const **);
scalar_t__ atof(char const *);
int Com_ParseInt(const char *(*buf_p)) {
  const char *token;
  token = Com_Parse(buf_p);
  if (!token[0]) {
    return 0;
  }
  return (int)atof(token);
}


x86 assembly (clang, -O0):
<Com_ParseInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <Com_Parse@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1152 <Com_ParseInt+0x32>
movl   $0x0,-0x4(%rbp)
jmp    115e <Com_ParseInt+0x3e>
mov    -0x18(%rbp),%rdi
call   1030 <atof@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_ParseInt>:
push   %rax
call   1040 <Com_Parse@plt>
cmpb   $0x0,(%rax)
je     1135 <Com_ParseInt+0x15>
mov    %rax,%rdi
call   1030 <atof@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @Com_ParseInt(i8** %0) {
%2 = tail call i8* @Com_Parse(i8** %0)
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i64 @atof(i8* %2)
%7 = trunc i64 %6 to i32
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ %7, %5 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void help(char *prname) {
  fprintf(stderr, "USE: %s <n><wordsizeinbits>\n", prname);
  exit(1);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"USE: %s <n><wordsizeinbits>\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"USE: %s <n><wordsizeinbits>\0A\00"
define void @help(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
long TestingAscending(long index, long total) { return index; }


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

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

LLVM IR (-O0):
define i64 @TestingAscending(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 @TestingAscending(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ STDOUT_FILENO;
int write(int /*<<< orphan*/, char *, int);
int putchar(int str) {
  char c;
  int ret;
  c = (uint8_t)str;
  ret = write(STDOUT_FILENO, &c, 1);
  ret = (ret == -1) ? EOF : str;
  return ret;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1156 <putchar+0x46>
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    115c <putchar+0x4c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %bl,0xf(%rsp)
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
lea    0xf(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    1141 <putchar+0x31>
mov    0x2ea1(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@EOF = global i32 0
define i32 @putchar(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = trunc i32 %5 to i8
store i8 %6, i8* %3
%7 = load i32, i32* @STDOUT_FILENO
%8 = call i32 @write(i32 %7, i8* %3, i32 1)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i32, i32* @EOF
br label %15
13: ; preds = %1
%14 = load i32, i32* %2
br label %15
15: ; preds = %13, %11
%16 = phi i32 [ %12, %11 ], [ %14, %13 ]
store i32 %16, i32* %4
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@EOF = global i32 0
define i32 @putchar(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i32, i32* @STDOUT_FILENO
%5 = call i32 @write(i32 %4, i8* %2, i32 1)
%6 = icmp eq i32 %5, -1
%7 = load i32, i32* @EOF
%8 = select i1 %6, i32 %7, i32 %0
ret i32 %8
}
void s_memset1(void *dest, int c, int n) {
  unsigned char dc = (unsigned char)c;
  unsigned char *d = (unsigned char *)dest;
  while (n--) {
    *d++ = dc;
  };
}


x86 assembly (clang, -O0):
<s_memset1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
cmp    $0x0,%eax
je     1149 <s_memset1+0x49>
mov    -0x11(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    111c <s_memset1+0x1c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_memset1>:
test   %edx,%edx
je     1120 <s_memset1+0x10>
push   %rax
mov    %edx,%edx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @s_memset1(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %5, %3
ret void
}
void PSG_close() {}


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

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

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

LLVM IR (-O2):
define void @PSG_close() {
ret void
}
void push_f(float *f, float val) {
  f[0] = f[1];
  f[1] = f[2];
  f[2] = f[3];
  f[3] = val;
}


x86 assembly (clang, -O0):
<push_f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<push_f>:
mov    0x4(%rdi),%rax
mov    %rax,(%rdi)
movss  0xc(%rdi),%xmm1
movss  %xmm1,0x8(%rdi)
movss  %xmm0,0xc(%rdi)
ret

LLVM IR (-O0):
define void @push_f(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 1
%7 = load float, float* %6
%8 = load float*, float** %3
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load float*, float** %3
%11 = getelementptr inbounds float, float* %10, i64 2
%12 = load float, float* %11
%13 = load float*, float** %3
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 3
%17 = load float, float* %16
%18 = load float*, float** %3
%19 = getelementptr inbounds float, float* %18, i64 2
store float %17, float* %19
%20 = load float, float* %4
%21 = load float*, float** %3
%22 = getelementptr inbounds float, float* %21, i64 3
store float %20, float* %22
ret void
}

LLVM IR (-O2):
define void @push_f(float* nocapture %0, float %1) {
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
store float %4, float* %0
%5 = getelementptr inbounds float, float* %0, i64 2
%6 = load float, float* %5
store float %6, float* %3
%7 = getelementptr inbounds float, float* %0, i64 3
%8 = load float, float* %7
store float %8, float* %5
store float %1, float* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void say_hello(void) { printf("Hello world.\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello world.\00"
define void @say_hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *ntfs_malloc(size_t size) {
  void *p;
  p = malloc(size);
  if (!p)
    ;
  return p;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @ntfs_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double log10l(long double x) { return __infer_nondet_long_double(); }


x86 assembly (clang, -O0):
<log10l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
xor    %eax,%eax
call   1030 <__infer_nondet_long_double@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @log10l(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @log10l(x86_fp80 %0) {
%2 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %2
}
void g_string_append_len() {}


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

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

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

LLVM IR (-O2):
define void @g_string_append_len() {
ret void
}
int is_utf8(char ch) { return (ch & 0x80) != 0x00; }


x86 assembly (clang, -O0):
<is_utf8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_utf8>:
shr    $0x7,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @is_utf8(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 128
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_utf8(i8 signext %0) {
%2 = lshr i8 %0, 7
%3 = zext i8 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
void print_address_of_variable(int a) {
  printf("%p - Function address of n passed by copy.\n", &a);
}


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

x86 assembly (clang, -O2):
<print_address_of_variable>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0xee4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [44 x i8] c"%p - Function address of n passed by copy.\0A\00"
define void @print_address_of_variable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32* %2)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"%p - Function address of n passed by copy.\0A\00"
define void @print_address_of_variable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void shld_reg32_reg32_cl(unsigned int reg1, unsigned int reg2) {
  put8(0x0F);
  put8(0xA5);
  put8(0xC0 | (reg2 << 3) | reg1);
}


x86 assembly (clang, -O0):
<shld_reg32_reg32_cl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xa5,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x4(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shld_reg32_reg32_cl>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xa5,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @shld_reg32_reg32_cl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 15)
%6 = call i32 @put8(i32 165)
%7 = load i32, i32* %4
%8 = shl i32 %7, 3
%9 = or i32 192, %8
%10 = load i32, i32* %3
%11 = or i32 %9, %10
%12 = call i32 @put8(i32 %11)
ret void
}

LLVM IR (-O2):
define void @shld_reg32_reg32_cl(i32 %0, i32 %1) {
%3 = tail call i32 @put8(i32 15)
%4 = tail call i32 @put8(i32 165)
%5 = shl i32 %1, 3
%6 = or i32 %5, %0
%7 = or i32 %6, 192
%8 = tail call i32 @put8(i32 %7)
ret void
}