xunge/DecIR huggingface dataset:
int mystrcmp(char *s, char *t) {
  for (; *s == *t; s++, t++)
    if (*s == '\0')
      return 0;
  return *s - *t;
}


x86 assembly (clang, -O0):
<mystrcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1160 <mystrcmp+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <mystrcmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1173 <mystrcmp+0x73>
jmp    1143 <mystrcmp+0x43>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <mystrcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <mystrcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <mystrcmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <mystrcmp+0x10>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @mystrcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %21, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %9, %12
br i1 %13, label %14, label %26
14: ; preds = %6
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 0, i32* %3
br label %34
20: ; preds = %14
br label %21
21: ; preds = %20
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %4
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %5
br label %6
26: ; preds = %6
%27 = load i8*, i8** %4
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = load i8*, i8** %5
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = sub nsw i32 %29, %32
store i32 %33, i32* %3
br label %34
34: ; preds = %26, %19
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @mystrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %18 to i32
%21 = sext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
scalar_t__ bm_check(int /*<<< orphan*/ *, int);
int pbm_check(uint8_t **b, uint32_t v) {
  uint32_t top = v >> 16;
  uint32_t bottom = v & 0xFFFF;
  return b[top] && bm_check(b[top], bottom);
}


x86 assembly (clang, -O0):
<pbm_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
xor    %eax,%eax
cmpq   $0x0,(%rcx,%rdx,8)
mov    %al,-0x15(%rbp)
je     1169 <pbm_check+0x59>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x14(%rbp),%esi
call   1030 <bm_check@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbm_check>:
push   %rax
mov    %esi,%eax
sar    $0x10,%eax
cltq
mov    (%rdi,%rax,8),%rdi
test   %rdi,%rdi
je     1136 <pbm_check+0x26>
movzwl %si,%esi
call   1030 <bm_check@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pbm_check(i32** %0, i32 %1) {
%3 = alloca i32**
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32** %0, i32*** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = ashr i32 %7, 16
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = and i32 %9, 65535
store i32 %10, i32* %6
%11 = load i32**, i32*** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32*, i32** %11, i64 %13
%15 = load i32*, i32** %14
%16 = icmp ne i32* %15, null
br i1 %16, label %17, label %26
17: ; preds = %2
%18 = load i32**, i32*** %3
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32*, i32** %18, i64 %20
%22 = load i32*, i32** %21
%23 = load i32, i32* %6
%24 = call i64 @bm_check(i32* %22, i32 %23)
%25 = icmp ne i64 %24, 0
br label %26
26: ; preds = %17, %2
%27 = phi i1 [ false, %2 ], [ %25, %17 ]
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @pbm_check(i32** nocapture %0, i32 %1) {
%3 = ashr i32 %1, 16
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32*, i32** %0, i64 %4
%6 = load i32*, i32** %5
%7 = icmp eq i32* %6, null
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = and i32 %1, 65535
%10 = tail call i64 @bm_check(i32* %6, i32 %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %8, %2
%14 = phi i32 [ 0, %2 ], [ %12, %8 ]
ret i32 %14
}
/* Variables and functions */
int f26(int *);
int f27(int *p) { return f26(p); }


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

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

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

LLVM IR (-O2):
define i32 @f27(i32* %0) {
%2 = tail call i32 @f26(i32* %0)
ret i32 %2
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ snprintf(char *, size_t, char *, char const *, char const *);
int strlen(char const *);
char *pathjoin(const char *path1, const char *path2) {
  size_t pathlen = strlen(path1) + strlen(path2) + 1;
  char *path = malloc(pathlen + 1);
  snprintf(path, pathlen + 1, "%s/%s", path1, path2);
  return path;
}


x86 assembly (clang, -O0):
<pathjoin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xe6f(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathjoin>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
add    %ebp,%eax
movslq %eax,%rbp
add    $0x2,%rbp
mov    %rbp,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xe99(%rip),%rdx
mov    %rax,%rdi
mov    %rbp,%rsi
mov    %r15,%rcx
mov    %r14,%r8
call   1040 <snprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%s\00"
define i8* @pathjoin(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 %8, %10
%12 = add nsw i32 %11, 1
%13 = sext i32 %12 to i64
store i64 %13, i64* %5
%14 = load i64, i64* %5
%15 = add i64 %14, 1
%16 = call i8* @malloc(i64 %15)
store i8* %16, i8** %6
%17 = load i8*, i8** %6
%18 = load i64, i64* %5
%19 = add i64 %18, 1
%20 = load i8*, i8** %3
%21 = load i8*, i8** %4
%22 = call i32 @snprintf(i8* %17, i64 %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %20, i8* %21)
%23 = load i8*, i8** %6
ret i8* %23
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
define i8* @pathjoin(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add nsw i32 %4, %3
%6 = sext i32 %5 to i64
%7 = add nsw i64 %6, 2
%8 = tail call i8* @malloc(i64 %7)
%9 = tail call i32 @snprintf(i8* %8, i64 %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scnaf(char *, int *);
void main() {
  int n;
  scnaf("%d", &n);
  if (n > 0)
    printf("positive\n");
  else if (n < 0)
    printf("negative\n");
  else
    printf("zero\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scnaf@plt>
cmpl   $0x0,-0x4(%rbp)
jle    1153 <main+0x33>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    117f <main+0x5f>
cmpl   $0x0,-0x4(%rbp)
jge    116e <main+0x4e>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    117a <main+0x5a>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    117f <main+0x5f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scnaf@plt>
cmpl   $0x0,0x4(%rsp)
lea    0xeca(%rip),%rax
lea    0xebe(%rip),%rcx
cmovs  %rax,%rcx
lea    0xec1(%rip),%rdi
cmovle %rcx,%rdi
call   1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"positive\0A\00"
@.str.2 = [10 x i8] c"negative\0A\00"
@.str.3 = [6 x i8] c"zero\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @scnaf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %15
7: ; preds = %0
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %14
12: ; preds = %7
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
br label %15
15: ; preds = %14, %5
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [5 x i8] c"zero\00"
@str.4 = [9 x i8] c"negative\00"
@str.5 = [9 x i8] c"positive\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scnaf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
%6 = icmp slt i32 %4, 0
%7 = select i1 %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0)
%8 = select i1 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.5, i64 0, i64 0), i8* %7
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void dv_log_exit(void) { closelog(); }


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

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

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

LLVM IR (-O2):
define void @dv_log_exit() {
%1 = tail call i32 (...) @closelog()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_error_msg(char *);
char unexpected_address(const int addr_cnt) {
  if (addr_cnt > 0) {
    set_error_msg("Unexpected address");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<unexpected_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    113a <unexpected_address+0x2a>
lea    0xed4(%rip),%rdi
call   1030 <set_error_msg@plt>
movb   $0x1,-0x1(%rbp)
jmp    113e <unexpected_address+0x2e>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unexpected_address>:
test   %edi,%edi
jle    1128 <unexpected_address+0x18>
push   %rax
lea    0xee4(%rip),%rdi
call   1030 <set_error_msg@plt>
mov    $0x1,%al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"Unexpected address\00"
define signext i8 @unexpected_address(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @set_error_msg(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
%6 = phi i8 [ 1, %3 ], [ 0, %1 ]
ret i8 %6
}
AR0AR1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((p0[10000000]) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AR0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzbl 0x989680(%rax),%eax
mov    -0x20(%rbp),%rcx
movzbl 0x43d11(%rcx),%ecx
cmp    %ecx,%eax
jg     1148 <AR0AR1+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <AR0AR1+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0AR1>:
mov    0x989680(%r8),%cl
xor    %eax,%eax
cmp    0x43d11(%r9),%cl
setbe  %al
ret

LLVM IR (-O0):
define i32 @AR0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8*, i8** %12
%17 = getelementptr inbounds i8, i8* %16, i64 10000000
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = load i8*, i8** %13
%21 = getelementptr inbounds i8, i8* %20, i64 277777
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = icmp sle i32 %19, %23
br i1 %24, label %25, label %26
25: ; preds = %6
store i32 1, i32* %7
br label %27
26: ; preds = %6
store i32 0, i32* %7
br label %27
27: ; preds = %26, %25
%28 = load i32, i32* %7
ret i32 %28
}

LLVM IR (-O2):
define i32 @AR0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture %5) {
%7 = getelementptr inbounds i8, i8* %4, i64 10000000
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %5, i64 277777
%10 = load i8, i8* %9
%11 = icmp ule i8 %8, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
int test_imm_17int8_mem(signed char *val) {
  return ((*val) & (-0x17 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_17int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffffe9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_17int8_mem>:
testb  $0xe9,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_17int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -23
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ vcall(float *, int);
void v3s(short int *vec) {
  float v[3];
  v[0] = vec[0];
  v[1] = vec[1];
  v[2] = vec[2];
  vcall(v, 3);
}


x86 assembly (clang, -O0):
<v3s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movswl 0x2(%rax),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movswl 0x4(%rax),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
lea    -0x14(%rbp),%rdi
mov    $0x3,%esi
call   1030 <vcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v3s>:
sub    $0x18,%rsp
movswl (%rdi),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,0xc(%rsp)
movswl 0x2(%rdi),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x10(%rsp)
movswl 0x4(%rdi),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x14(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x3,%esi
call   1030 <vcall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @v3s(i16* %0) {
%2 = alloca i16*
%3 = alloca [3 x float]
store i16* %0, i16** %2
%4 = load i16*, i16** %2
%5 = getelementptr inbounds i16, i16* %4, i64 0
%6 = load i16, i16* %5
%7 = sitofp i16 %6 to float
%8 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
store float %7, float* %8
%9 = load i16*, i16** %2
%10 = getelementptr inbounds i16, i16* %9, i64 1
%11 = load i16, i16* %10
%12 = sitofp i16 %11 to float
%13 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 1
store float %12, float* %13
%14 = load i16*, i16** %2
%15 = getelementptr inbounds i16, i16* %14, i64 2
%16 = load i16, i16* %15
%17 = sitofp i16 %16 to float
%18 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 2
store float %17, float* %18
%19 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%20 = call i32 @vcall(float* %19, i32 3)
ret void
}

LLVM IR (-O2):
define void @v3s(i16* nocapture %0) {
%2 = alloca [3 x float]
%3 = bitcast [3 x float]* %2 to i8*
%4 = load i16, i16* %0
%5 = sitofp i16 %4 to float
%6 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
store float %5, float* %6
%7 = getelementptr inbounds i16, i16* %0, i64 1
%8 = load i16, i16* %7
%9 = sitofp i16 %8 to float
%10 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 1
store float %9, float* %10
%11 = getelementptr inbounds i16, i16* %0, i64 2
%12 = load i16, i16* %11
%13 = sitofp i16 %12 to float
%14 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 2
store float %13, float* %14
%15 = call i32 @vcall(float* %6, i32 3)
ret void
}
/* Type definitions */
struct object_t {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
bool armor_create(FILE *fp, struct object_t *ptr) { return true; }


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

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

LLVM IR (-O0):
%struct.object_t = type { i32 }
define i32 @armor_create(i32* %0, %struct.object_t* %1) {
%3 = alloca i32*
%4 = alloca %struct.object_t*
store i32* %0, i32** %3
store %struct.object_t* %1, %struct.object_t** %4
ret i32 1
}

LLVM IR (-O2):
%struct.object_t = type { i32 }
define i32 @armor_create(i32* nocapture readnone %0, %struct.object_t* nocapture readnone %1) {
ret i32 1
}
void strcpy_overlapping(const unsigned char *src, char *dst) {
  while (*src != '\0')
    *(dst++) = *(src++);
  *dst = '\0';
}


x86 assembly (clang, -O0):
<strcpy_overlapping>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     1143 <strcpy_overlapping+0x43>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110c <strcpy_overlapping+0xc>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_overlapping>:
mov    (%rdi),%al
test   %al,%al
je     1121 <strcpy_overlapping+0x21>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rsi)
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcpy_overlapping+0x10>
movb   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define void @strcpy_overlapping(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %1, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret void
}
/* Variables and functions */
int LZ4_decompress_safe(char const *, char *, int, int);
int LZ4F_decompress_safe(const char *source, char *dest, int compressedSize,
                         int maxDecompressedSize, const char *dictStart,
                         int dictSize) {
  (void)dictStart;
  (void)dictSize;
  return LZ4_decompress_safe(source, dest, compressedSize, maxDecompressedSize);
}


x86 assembly (clang, -O0):
<LZ4F_decompress_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <LZ4_decompress_safe@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @LZ4F_decompress_safe(i8* %0, i8* %1, i32 %2, i32 %3, i8* nocapture readnone %4, i32 %5) {
%7 = tail call i32 @LZ4_decompress_safe(i8* %0, i8* %1, i32 %2, i32 %3)
ret i32 %7
}
double test3(double x, int b) {
  double s, c;
  if (b)
    x = x * 2;
  s = __builtin_sin(x);
  c = __builtin_cos(x);
  return s + c;
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114c <test3+0x2c>
movsd  0xebe(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
test   %edi,%edi
je     1128 <test3+0x8>
addsd  %xmm0,%xmm0
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @test3(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load double, double* %3
%11 = fmul double %10, 2.000000e+00
store double %11, double* %3
br label %12
12: ; preds = %9, %2
%13 = load double, double* %3
%14 = call double @sin(double %13)
store double %14, double* %5
%15 = load double, double* %3
%16 = call double @cos(double %15)
store double %16, double* %6
%17 = load double, double* %5
%18 = load double, double* %6
%19 = fadd double %17, %18
ret double %19
}

LLVM IR (-O2):
define double @test3(double %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = fmul double %0, 2.000000e+00
%5 = select i1 %3, double %0, double %4
%6 = tail call double @sin(double %5)
%7 = tail call double @cos(double %5)
%8 = fadd double %6, %7
ret double %8
}
/* Variables and functions */
scalar_t__ EEXIST;
int /*<<< orphan*/ S_IRWXU;
scalar_t__ errno;
int mkdir(char const *, int /*<<< orphan*/);
int os_mkdir(const char *path) {
  int errorcode = mkdir(path, S_IRWXU);
  if (errorcode == 0)
    return 0;
  return (errno == EEXIST) ? 1 : -1;
}


x86 assembly (clang, -O0):
<os_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <mkdir@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1147 <os_mkdir+0x37>
movl   $0x0,-0x4(%rbp)
jmp    116e <os_mkdir+0x5e>
mov    0x2e82(%rip),%rax
mov    (%rax),%rdx
mov    0x2e80(%rip),%rax
mov    (%rax),%rsi
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_mkdir>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
call   1030 <mkdir@plt>
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2ea8(%rip),%rdx
xor    %esi,%esi
cmp    (%rdx),%rcx
sete   %sil
test   %eax,%eax
lea    -0x1(%rsi,%rsi,1),%ecx
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@S_IRWXU = global i32 0
@errno = global i64 0
@EEXIST = global i64 0
define i32 @os_mkdir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @S_IRWXU
%7 = call i32 @mkdir(i8* %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %17
11: ; preds = %1
%12 = load i64, i64* @errno
%13 = load i64, i64* @EEXIST
%14 = icmp eq i64 %12, %13
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 1, i32 -1
store i32 %16, i32* %2
br label %17
17: ; preds = %11, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@S_IRWXU = global i32 0
@errno = global i64 0
@EEXIST = global i64 0
define i32 @os_mkdir(i8* nocapture %0) {
%2 = load i32, i32* @S_IRWXU
%3 = tail call i32 @mkdir(i8* %0, i32 %2)
%4 = icmp eq i32 %3, 0
%5 = load i64, i64* @errno
%6 = load i64, i64* @EEXIST
%7 = icmp eq i64 %5, %6
%8 = select i1 %7, i32 1, i32 -1
%9 = select i1 %4, i32 0, i32 %8
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ fenv_t;

/* Variables and functions */
int fegetenv(fenv_t *envp) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fegetenv(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print(char *, char const *);
int select_splash(const char *binware_file) {
  print("\t(template driver) select_splash(%s)\n", binware_file);
  return 0;
}


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

x86 assembly (clang, -O2):
<select_splash>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"\09(template driver) select_splash(%s)\0A\00"
define i32 @select_splash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @print(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"\09(template driver) select_splash(%s)\0A\00"
define i32 @select_splash(i8* %0) {
%2 = tail call i32 @print(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
void SCB_DisableDCache(void) {}


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

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

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

LLVM IR (-O2):
define void @SCB_DisableDCache() {
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;
struct timespec {
  unsigned long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, struct timespec *);
void my_usleep(unsigned long milliseconds) {
  struct timespec tmReq;
  tmReq.tv_sec = (time_t)0;
  tmReq.tv_nsec = milliseconds;
  (void)nanosleep(&tmReq, (struct timespec *)NULL);
}


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

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

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

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @my_usleep(i64 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %0, i64* %5
%6 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* null)
ret void
}
/* Variables and functions */
int _close(int);
int close(int handle) { return _close(handle); }


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

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

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

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = tail call i32 @_close(i32 %0)
ret i32 %2
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ timespec_from_nsec(struct timespec *, int);
void timespec_from_usec(struct timespec *a, int64_t b) {
  timespec_from_nsec(a, b * 1000);
}


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

x86 assembly (clang, -O2):
<timespec_from_usec>:
imul   $0x3e8,%esi,%esi
jmp    1030 <timespec_from_nsec@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define void @timespec_from_usec(%struct.timespec* %0, i32 %1) {
%3 = alloca %struct.timespec*
%4 = alloca i32
store %struct.timespec* %0, %struct.timespec** %3
store i32 %1, i32* %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 1000
%8 = call i32 @timespec_from_nsec(%struct.timespec* %5, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define void @timespec_from_usec(%struct.timespec* %0, i32 %1) {
%3 = mul nsw i32 %1, 1000
%4 = tail call i32 @timespec_from_nsec(%struct.timespec* %0, i32 %3)
ret void
}
/* Variables and functions */
int SIGCHLD;
int /*<<< orphan*/ claimChildren();
void signalHandler(int signal) {
  if (signal == SIGCHLD) {
    claimChildren();
  }
}


x86 assembly (clang, -O0):
<signalHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    1134 <signalHandler+0x24>
mov    $0x0,%al
call   1030 <claimChildren@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signalHandler>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    1122 <signalHandler+0x12>
xor    %eax,%eax
jmp    1030 <claimChildren@plt>
ret

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

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

/* Variables and functions */
scalar_t__ syscall(int, int, int, int, int *, int);
off_t __lseek(int fd, off_t offset, int whence) {
  off_t result;
  return syscall(140, fd, offset >> 32, offset, &result, whence) ? -1 : result;
}


x86 assembly (clang, -O0):
<__lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x20,%ecx
sar    %cl,%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r9d
mov    $0x8c,%edi
lea    -0x10(%rbp),%r8
call   1030 <syscall@plt>
cmp    $0x0,%rax
je     115a <__lseek+0x4a>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1160 <__lseek+0x50>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lseek>:
push   %rax
mov    %esi,%ecx
mov    %edi,%esi
lea    0x4(%rsp),%r8
mov    $0x8c,%edi
mov    %edx,%r9d
call   1030 <syscall@plt>
neg    %rax
sbb    %eax,%eax
or     0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = ashr i32 %9, 32
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i64 @syscall(i32 140, i32 %8, i32 %10, i32 %11, i32* %7, i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %3
br label %18
16: ; preds = %3
%17 = load i32, i32* %7
br label %18
18: ; preds = %16, %15
%19 = phi i32 [ -1, %15 ], [ %17, %16 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @__lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i64 @syscall(i32 140, i32 %0, i32 poison, i32 %1, i32* %4, i32 %2)
%7 = icmp eq i64 %6, 0
%8 = load i32, i32* %4
%9 = select i1 %7, i32 %8, i32 -1
ret i32 %9
}
float g(float x) { return (x >= 0.f ? -1.f : 1.f); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
movss  0xeea(%rip),%xmm3
movss  0xee6(%rip),%xmm2
xorps  %xmm0,%xmm0
cmpless %xmm1,%xmm0
movaps %xmm0,%xmm1
andps  %xmm3,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setae  %al
lea    0xeee(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @g(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oge float %3, 0.000000e+00
%5 = zext i1 %4 to i64
%6 = select i1 %4, float -1.000000e+00, float 1.000000e+00
ret float %6
}

LLVM IR (-O2):
define float @g(float %0) {
%2 = fcmp oge float %0, 0.000000e+00
%3 = select i1 %2, float -1.000000e+00, float 1.000000e+00
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(char const *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int gsdll_stderr(void *instance, const char *str, int len) {
  fwrite(str, 1, len, stderr);
  fflush(stderr);
  return len;
}


x86 assembly (clang, -O0):
<gsdll_stderr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    0x2e9f(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1040 <fwrite@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsdll_stderr>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%rdi
mov    0x2eb0(%rip),%r14
mov    (%r14),%ecx
mov    $0x1,%esi
call   1040 <fwrite@plt>
mov    (%r14),%edi
call   1030 <fflush@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
define i32 @gsdll_stderr(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = load i32, i32* @stderr
%10 = call i32 @fwrite(i8* %7, i32 1, i32 %8, i32 %9)
%11 = load i32, i32* @stderr
%12 = call i32 @fflush(i32 %11)
%13 = load i32, i32* %6
ret i32 %13
}

LLVM IR (-O2):
@stderr = global i32 0
define i32 @gsdll_stderr(i8* nocapture readnone %0, i8* %1, i32 returned %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fwrite(i8* %1, i32 1, i32 %2, i32 %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fflush(i32 %6)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ cl_mem;
typedef int /*<<< orphan*/ cl_command_queue;

/* Variables and functions */
int ReadFromGPU(cl_command_queue cmd_q, cl_mem c_dev, float *c_host, int size) {
  return 0;
}


x86 assembly (clang, -O0):
<ReadFromGPU>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ReadFromGPU(i32 %0, i32 %1, float* nocapture readnone %2, i32 %3) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ ntru_keccak(int, int /*<<< orphan*/ const *,
                               int /*<<< orphan*/, int, int /*<<< orphan*/ *,
                               int, int /*<<< orphan*/);
int ntru_shake256(uint8_t *h, uint64_t l, const uint8_t *m, uint64_t n) {
  ntru_keccak(17 * 8, m, n, 0x1f, h, 136, l);
  return 1;
}


x86 assembly (clang, -O0):
<ntru_shake256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x8(%rbp),%r8
mov    -0xc(%rbp),%eax
mov    $0x88,%r9d
mov    $0x1f,%ecx
mov    %r9d,%edi
mov    %eax,(%rsp)
call   1030 <ntru_keccak@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntru_shake256>:
push   %rax
mov    %rdi,%r8
mov    %esi,(%rsp)
mov    $0x88,%edi
mov    %rdx,%rsi
mov    %ecx,%edx
mov    $0x1f,%ecx
mov    $0x88,%r9d
call   1030 <ntru_keccak@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ntru_shake256(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %7
%10 = load i32, i32* %8
%11 = load i32*, i32** %5
%12 = load i32, i32* %6
%13 = call i32 @ntru_keccak(i32 136, i32* %9, i32 %10, i32 31, i32* %11, i32 136, i32 %12)
ret i32 1
}

LLVM IR (-O2):
define i32 @ntru_shake256(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @ntru_keccak(i32 136, i32* %2, i32 %3, i32 31, i32* %0, i32 136, i32 %1)
ret i32 1
}
/* Variables and functions */
float sqrtf(float);
float __ocl_native_sqrt_float(float src) { return sqrtf(src); }


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

x86 assembly (clang, -O2):
<__ocl_native_sqrt_float>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111d <__ocl_native_sqrt_float+0xd>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

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

LLVM IR (-O2):
define float @__ocl_native_sqrt_float(float %0) {
%2 = tail call float @sqrtf(float %0)
ret float %2
}
unsigned int hamming_distance2(unsigned int w) { return (w & 1) + !!(w & 2); }


x86 assembly (clang, -O0):
<hamming_distance2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x2,%ecx
cmp    $0x0,%ecx
setne  %cl
xor    $0xff,%cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hamming_distance2>:
mov    %edi,%eax
and    $0x1,%eax
shr    %edi
and    $0x1,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @hamming_distance2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = load i32, i32* %2
%6 = and i32 %5, 2
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = add i32 %4, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @hamming_distance2(i32 %0) {
%2 = and i32 %0, 1
%3 = lshr i32 %0, 1
%4 = and i32 %3, 1
%5 = add nuw nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int foo(int);
int bar(int a) {
  int x = a;
  int w = 5;
  return foo(x);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = tail call i32 @foo(i32 %0)
ret i32 %2
}
const char *g() { return ""; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @g() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @g() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
void qtable_free_keys(char **keys) {
  if (keys) {
    int counter = 0;
    while (keys[counter]) {
      free(keys[counter]);
      counter++;
    }
    free(keys);
  }
}


x86 assembly (clang, -O0):
<qtable_free_keys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1169 <qtable_free_keys+0x59>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1160 <qtable_free_keys+0x50>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <qtable_free_keys+0x1e>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qtable_free_keys>:
test   %rdi,%rdi
je     1150 <qtable_free_keys+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <qtable_free_keys+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <qtable_free_keys+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @qtable_free_keys(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %11, %6 ], [ %4, %3 ]
tail call void @free(i8* %8)
%9 = add nuw nsw i64 %7, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3
%14 = bitcast i8** %0 to i8*
tail call void @free(i8* %14)
br label %15
15: ; preds = %13, %1
ret void
}
int test_imm_60int64_midword_reg(long long val) {
  return ((val >> 16) & (0x60 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_60int64_midword_reg>:
test   $0x600000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_60int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 96
%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_60int64_midword_reg(i64 %0) {
%2 = and i64 %0, 6291456
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}