xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, int, int);
int /*<<< orphan*/ stderr;
void usage(char *av0, int exvalue) {
  fprintf(
      stderr,
      "Usage: %s [-i <n>] [-n <n>] [-b] [-q] [-s <n>] <N>\n"
      " -i        insertion sort threshold, default %d\n"
      " -m        minimum task size before using serial mergesort, default %d\n"
      " -n        number of threads in pool, default %d\n"
      " -b        run built-in qsort\n"
      " -s        specify srand() seed\n"
      " -q        also run serial mergesort\n",
      av0, 16, 1000, 4);
  exit(exvalue);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rsi
mov    $0x10,%ecx
mov    $0x3e8,%r8d
mov    $0x4,%r9d
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
mov    $0x10,%ecx
mov    $0x3e8,%r8d
mov    $0x4,%r9d
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [319 x i8] c"Usage: %s [-i <n>] [-n <n>] [-b] [-q] [-s <n>] <N>\0A -i insertion sort threshold, default %d\0A -m minimum task size before using serial mergesort, default %d\0A -n number of threads in pool, default %d\0A -b run built-in qsort\0A -s specify srand() seed\0A -q also run serial mergesort\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([319 x i8], [319 x i8]* @.str, i64 0, i64 0), i8* %6, i32 16, i32 1000, i32 4)
%8 = load i32, i32* %4
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [319 x i8] c"Usage: %s [-i <n>] [-n <n>] [-b] [-q] [-s <n>] <N>\0A -i insertion sort threshold, default %d\0A -m minimum task size before using serial mergesort, default %d\0A -n number of threads in pool, default %d\0A -b run built-in qsort\0A -s specify srand() seed\0A -q also run serial mergesort\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([319 x i8], [319 x i8]* @.str, i64 0, i64 0), i8* %0, i32 16, i32 1000, i32 4)
%5 = tail call i32 @exit(i32 %1)
unreachable
}
void foo573(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo573(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __pipe2(int pipedes[2], int flags) {
  if (pipedes == NULL) {
    __set_errno(EINVAL);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__pipe2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <__pipe2+0x34>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <__pipe2+0x49>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pipe2>:
push   %rax
test   %rdi,%rdi
jne    111f <__pipe2+0xf>
mov    0x2ebb(%rip),%rax
jmp    1126 <__pipe2+0x16>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__pipe2(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32*, i32** %4
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @EINVAL
%10 = call i32 @__set_errno(i32 %9)
store i32 -1, i32* %3
br label %14
11: ; preds = %2
%12 = load i32, i32* @ENOSYS
%13 = call i32 @__set_errno(i32 %12)
store i32 -1, i32* %3
br label %14
14: ; preds = %11, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__pipe2(i32* readnone %0, i32 %1) {
%3 = icmp eq i32* %0, null
%4 = load i32, i32* @EINVAL
%5 = load i32, i32* @ENOSYS
%6 = select i1 %3, i32 %4, i32 %5
%7 = tail call i32 @__set_errno(i32 %6)
ret i32 -1
}
unsigned long lemon_type_hash(struct lemon *lemon, void *key) {
  return (unsigned long)key;
}


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

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

LLVM IR (-O0):
%struct.lemon = type opaque
define i64 @lemon_type_hash(%struct.lemon* %0, i8* %1) {
%3 = alloca %struct.lemon*
%4 = alloca i8*
store %struct.lemon* %0, %struct.lemon** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = ptrtoint i8* %5 to i64
ret i64 %6
}

LLVM IR (-O2):
%struct.lemon = type opaque
define i64 @lemon_type_hash(%struct.lemon* nocapture readnone %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void version(char *nombre) { printf("%s 1.0.0\n", nombre); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"%s 1.0.0\0A\00"
define void @version(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
char *cliSkipToken(char *pc) {
  while (pc && *pc && !isspace(*pc)) {
    pc++;
  }
  return pc;
}


x86 assembly (clang, -O0):
<cliSkipToken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1158 <cliSkipToken+0x48>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1158 <cliSkipToken+0x48>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1168 <cliSkipToken+0x58>
jmp    1179 <cliSkipToken+0x69>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <cliSkipToken+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cliSkipToken>:
push   %rbx
test   %rdi,%rdi
je     113a <cliSkipToken+0x2a>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     113c <cliSkipToken+0x2c>
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    113c <cliSkipToken+0x2c>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <cliSkipToken+0x10>
jmp    113c <cliSkipToken+0x2c>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @cliSkipToken(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, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = tail call i32 @isspace(i8 signext %7)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %6, %3, %1
%16 = phi i8* [ null, %1 ], [ %0, %3 ], [ %8, %6 ], [ %12, %11 ]
ret i8* %16
}
int yas_bma150_unlock(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @yas_bma150_unlock() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_year;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ timegm(struct tm *);
void fixv6time(time_t *t) {
  struct tm *T;
  T = gmtime(t);
  if (T->tm_year > 98)
    T->tm_year = 98;
  *t = timegm(T);
}


x86 assembly (clang, -O0):
<fixv6time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <gmtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x62,(%rax)
jle    1150 <fixv6time+0x30>
mov    -0x10(%rbp),%rax
movl   $0x62,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <timegm@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixv6time>:
push   %rbx
mov    %rdi,%rbx
call   1040 <gmtime@plt>
cmpl   $0x63,(%rax)
jl     1134 <fixv6time+0x14>
movl   $0x62,(%rax)
mov    %rax,%rdi
call   1030 <timegm@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @fixv6time(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.tm*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call %struct.tm* @gmtime(i32* %4)
store %struct.tm* %5, %struct.tm** %3
%6 = load %struct.tm*, %struct.tm** %3
%7 = getelementptr inbounds %struct.tm, %struct.tm* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = icmp sgt i32 %8, 98
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load %struct.tm*, %struct.tm** %3
%12 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 0
store i32 98, i32* %12
br label %13
13: ; preds = %10, %1
%14 = load %struct.tm*, %struct.tm** %3
%15 = call i32 @timegm(%struct.tm* %14)
%16 = load i32*, i32** %2
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @fixv6time(i32* %0) {
%2 = tail call %struct.tm* @gmtime(i32* %0)
%3 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 0
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 98
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 98, i32* %3
br label %7
7: ; preds = %6, %1
%8 = tail call i32 @timegm(%struct.tm* %2)
store i32 %8, i32* %0
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t enshift(int32_t x) { return x & 0x0000001f; }


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

x86 assembly (clang, -O2):
<enshift>:
mov    %edi,%eax
and    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @enshift(i32 %0) {
%2 = and i32 %0, 31
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "tty"
        "\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Usage: tty\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [12 x i8] c"Usage: tty\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int read_standard_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(11, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<read_standard_target_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xb,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_standard_target_system>:
mov    $0xb,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @read_standard_target_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 11, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @read_standard_target_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 11, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ _reverse(char *, int *, int *);
void reverse(char *s) {
  int idx = 0;
  int p = 0;
  _reverse(s, &idx, &p);
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <_reverse@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <_reverse@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @reverse(i8* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = call i32 @_reverse(i8* %0, i32* %2, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int square(int);
int main(void) {
  printf("%d\n", square(2));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @square(i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
void zeroVec64(int sz, int64_t *v) { memset(v, 0, 8 * sz); }


x86 assembly (clang, -O0):
<zeroVec64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
shl    $0x3,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeroVec64>:
lea    0x0(,%rdi,8),%edx
mov    %rsi,%rdi
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @zeroVec64(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %3
%7 = mul nsw i32 8, %6
%8 = call i32 @memset(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @zeroVec64(i32 %0, i32* %1) {
%3 = shl nsw i32 %0, 3
%4 = tail call i32 @memset(i32* %1, i32 0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void boz(void) { abort(); }


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

x86 assembly (clang, -O2):
<boz>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @boz() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @boz() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ msleep(unsigned int);
__attribute__((always_)) void ssleep(unsigned int seconds) {
  msleep(seconds * 1000);
}


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

x86 assembly (clang, -O2):
<ssleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <msleep@plt>

LLVM IR (-O0):
define void @ssleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 1000
%5 = call i32 @msleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @ssleep(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @msleep(i32 %2)
ret void
}
/* Variables and functions */
int getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main(void) {
  int len = 0;
  char inputLine[1000];
  while ((len = getline(inputLine, 1000)) > 0) {
    reverse(inputLine);
    printf("%s\n", inputLine);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    118a <main+0x5a>
lea    -0x3f0(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
jmp    1149 <main+0x19>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %eax,%eax
jle    1184 <main+0x54>
mov    %rsp,%rbx
lea    0xeab(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %8, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @getline(i8* %5, i32 1000)
store i32 %6, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%10 = call i32 @reverse(i8* %9)
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %4
13: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = call i32 @reverse(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = call i32 @getline(i8* %2, i32 1000)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
short wmbusManufacturerStringToCode(char *code) {
  return (code[0] - 0x40) * 0x20 * 0x20 + (code[1] - 0x40) * 0x20 +
         (code[2] - 0x40);
}


x86 assembly (clang, -O0):
<wmbusManufacturerStringToCode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x40,%eax
shl    $0x5,%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
sub    $0x40,%ecx
shl    $0x5,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
sub    $0x40,%ecx
add    %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<wmbusManufacturerStringToCode>:
movzbl (%rdi),%eax
shl    $0xa,%eax
movsbl 0x1(%rdi),%ecx
shl    $0x5,%ecx
add    %eax,%ecx
movsbl 0x2(%rdi),%eax
add    %ecx,%eax
add    $0xfffff7c0,%eax
ret

LLVM IR (-O0):
define signext i16 @wmbusManufacturerStringToCode(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 64
%8 = mul nsw i32 %7, 32
%9 = mul nsw i32 %8, 32
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 64
%15 = mul nsw i32 %14, 32
%16 = add nsw i32 %9, %15
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 2
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = sub nsw i32 %20, 64
%22 = add nsw i32 %16, %21
%23 = trunc i32 %22 to i16
ret i16 %23
}

LLVM IR (-O2):
define signext i16 @wmbusManufacturerStringToCode(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl i16 %3, 10
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i16
%8 = shl nsw i16 %7, 5
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i16
%12 = add i16 %4, -2112
%13 = add i16 %12, %8
%14 = add i16 %13, %11
ret i16 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *ckalloc(size_t size) {
  void *ptr;
  if (!(ptr = malloc(size))) {
    fprintf(stderr, "Unable to allocate storage.");
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<ckalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1172 <ckalloc+0x42>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ckalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <ckalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Unable to allocate storage.\00"
define i8* @ckalloc(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 = icmp ne i8* %5, null
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Unable to allocate storage.\00"
define noalias i8* @ckalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ CLR_DEBUG_VALID();
int /*<<< orphan*/ SET_DEBUG_LEVEL(int);
int /*<<< orphan*/ SET_DEBUG_VALID();
void ddr_debug(int data) {
  SET_DEBUG_LEVEL(data & 0xffff);
  SET_DEBUG_VALID();
  CLR_DEBUG_VALID();
  SET_DEBUG_LEVEL((data >> 16) & 0xffff);
  SET_DEBUG_VALID();
  CLR_DEBUG_VALID();
}


x86 assembly (clang, -O0):
<ddr_debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xffff,%edi
call   1050 <SET_DEBUG_LEVEL@plt>
mov    $0x0,%al
call   1040 <SET_DEBUG_VALID@plt>
mov    $0x0,%al
call   1030 <CLR_DEBUG_VALID@plt>
mov    -0x4(%rbp),%edi
sar    $0x10,%edi
and    $0xffff,%edi
call   1050 <SET_DEBUG_LEVEL@plt>
mov    $0x0,%al
call   1040 <SET_DEBUG_VALID@plt>
mov    $0x0,%al
call   1030 <CLR_DEBUG_VALID@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddr_debug>:
push   %rbx
mov    %edi,%ebx
movzwl %bx,%edi
call   1050 <SET_DEBUG_LEVEL@plt>
xor    %eax,%eax
call   1040 <SET_DEBUG_VALID@plt>
xor    %eax,%eax
call   1030 <CLR_DEBUG_VALID@plt>
shr    $0x10,%ebx
mov    %ebx,%edi
call   1050 <SET_DEBUG_LEVEL@plt>
xor    %eax,%eax
call   1040 <SET_DEBUG_VALID@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <CLR_DEBUG_VALID@plt>

LLVM IR (-O0):
define void @ddr_debug(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = call i32 @SET_DEBUG_LEVEL(i32 %4)
%6 = call i32 (...) @SET_DEBUG_VALID()
%7 = call i32 (...) @CLR_DEBUG_VALID()
%8 = load i32, i32* %2
%9 = ashr i32 %8, 16
%10 = and i32 %9, 65535
%11 = call i32 @SET_DEBUG_LEVEL(i32 %10)
%12 = call i32 (...) @SET_DEBUG_VALID()
%13 = call i32 (...) @CLR_DEBUG_VALID()
ret void
}

LLVM IR (-O2):
define void @ddr_debug(i32 %0) {
%2 = and i32 %0, 65535
%3 = tail call i32 @SET_DEBUG_LEVEL(i32 %2)
%4 = tail call i32 (...) @SET_DEBUG_VALID()
%5 = tail call i32 (...) @CLR_DEBUG_VALID()
%6 = lshr i32 %0, 16
%7 = tail call i32 @SET_DEBUG_LEVEL(i32 %6)
%8 = tail call i32 (...) @SET_DEBUG_VALID()
%9 = tail call i32 (...) @CLR_DEBUG_VALID()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
unsigned char *generate_command_packet(int, unsigned char, int /*<<< orphan*/,
                                       int /*<<< orphan*/ *,
                                       int /*<<< orphan*/);
unsigned char *op_raw_read(unsigned char zone_config, unsigned char address) {
  return generate_command_packet(0x02, zone_config, (uint16_t)address, NULL, 0);
}


x86 assembly (clang, -O0):
<op_raw_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
movzbl -0x2(%rbp),%edx
mov    $0x2,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
movzbl %al,%esi
call   1030 <generate_command_packet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_raw_read>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x2,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <generate_command_packet@plt>

LLVM IR (-O0):
define i8* @op_raw_read(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = call i8* @generate_command_packet(i32 2, i8 zeroext %5, i32 %7, i32* null, i32 0)
ret i8* %8
}

LLVM IR (-O2):
define i8* @op_raw_read(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = tail call i8* @generate_command_packet(i32 2, i8 zeroext %0, i32 %3, i32* null, i32 0)
ret i8* %4
}
/* Variables and functions */
int strlen(const char *s) {
  int n = 0;
  while (s[n])
    ++n;
  return n;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     112f <strlen+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
unsigned myrandom(void) {
  static unsigned m_w = 11;
  static unsigned m_z = 13;
  m_z = 36969 * (m_z & 65535) + (m_z >> 16);
  m_w = 18000 * (m_w & 65535) + (m_w >> 16);
  return (m_z << 16) + m_w;
}


x86 assembly (clang, -O0):
<myrandom>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
and    $0xffff,%eax
imul   $0x9069,%eax,%eax
mov    0x2f09(%rip),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
mov    %eax,0x2efe(%rip)
mov    0x2ef4(%rip),%eax
and    $0xffff,%eax
imul   $0x4650,%eax,%eax
mov    0x2ee3(%rip),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
mov    %eax,0x2ed8(%rip)
mov    0x2ed6(%rip),%eax
shl    $0x10,%eax
add    0x2ec9(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myrandom>:
mov    0x2f1e(%rip),%eax
movzwl %ax,%ecx
imul   $0x9069,%ecx,%ecx
shr    $0x10,%eax
add    %ecx,%eax
mov    %eax,0x2f0a(%rip)
mov    0x2f00(%rip),%ecx
movzwl %cx,%edx
imul   $0x4650,%edx,%edx
shr    $0x10,%ecx
add    %edx,%ecx
mov    %ecx,0x2eec(%rip)
shl    $0x10,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
@myrandom.m_w = internal global i32 11
@myrandom.m_z = internal global i32 13
define i32 @myrandom() {
%1 = load i32, i32* @myrandom.m_z
%2 = and i32 %1, 65535
%3 = mul i32 36969, %2
%4 = load i32, i32* @myrandom.m_z
%5 = lshr i32 %4, 16
%6 = add i32 %3, %5
store i32 %6, i32* @myrandom.m_z
%7 = load i32, i32* @myrandom.m_w
%8 = and i32 %7, 65535
%9 = mul i32 18000, %8
%10 = load i32, i32* @myrandom.m_w
%11 = lshr i32 %10, 16
%12 = add i32 %9, %11
store i32 %12, i32* @myrandom.m_w
%13 = load i32, i32* @myrandom.m_z
%14 = shl i32 %13, 16
%15 = load i32, i32* @myrandom.m_w
%16 = add i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
@myrandom.m_w = internal unnamed_addr global i32 11
@myrandom.m_z = internal unnamed_addr global i32 13
define i32 @myrandom() {
%1 = load i32, i32* @myrandom.m_z
%2 = and i32 %1, 65535
%3 = mul nuw i32 %2, 36969
%4 = lshr i32 %1, 16
%5 = add nuw i32 %3, %4
store i32 %5, i32* @myrandom.m_z
%6 = load i32, i32* @myrandom.m_w
%7 = and i32 %6, 65535
%8 = mul nuw nsw i32 %7, 18000
%9 = lshr i32 %6, 16
%10 = add nuw nsw i32 %8, %9
store i32 %10, i32* @myrandom.m_w
%11 = shl i32 %5, 16
%12 = add i32 %10, %11
ret i32 %12
}
int sys$delete(struct _fab *fab, void *err, void *suc) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(suc);
    register long int _a2 asm("rsi") = (long)(err);
    register long int _a1 asm("rdi") = (long)(fab);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x82\n\t"
                 : "=a"(resultvar)
                 : "i"(4), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$delete>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x4,%rax
int    $0x82
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$delete>:
mov    $0x4,%rax
int    $0x82
ret

LLVM IR (-O0):
%struct._fab = type opaque
define i32 @"sys$delete"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca %struct._fab*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._fab* %0, %struct._fab** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i8*, i8** %6
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._fab*, %struct._fab** %4
%17 = ptrtoint %struct._fab* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 4, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._fab = type opaque
define i32 @"sys$delete"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint %struct._fab* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 4, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
void acpi_lpat_free_conversion_table(
    struct acpi_lpat_conversion_table *lpat_table) {}


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

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

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

LLVM IR (-O2):
%struct.acpi_lpat_conversion_table = type opaque
define void @acpi_lpat_free_conversion_table(%struct.acpi_lpat_conversion_table* nocapture %0) {
ret void
}
int ptr_to_int(void *item) { return (int)(long int)item; }


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

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

LLVM IR (-O0):
define i32 @ptr_to_int(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ptr_to_int(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int ENOSYS;
int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *attr,
                                     int prioceiling) {
  return (ENOSYS);
}


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

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

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @pthread_mutexattr_setprioceiling(i32* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ watch_log(char *);
FILE *_IO_fopen(const char *path, const char *mode) {
  watch_log("io_open\n");
  return NULL;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"io_open\0A\00"
define i32* @_IO_fopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @watch_log(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32* null
}

LLVM IR (-O2):
@.str = [9 x i8] c"io_open\0A\00"
define noalias i32* @_IO_fopen(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @watch_log(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32* null
}
/* Variables and functions */
int /*<<< orphan*/ unlinkat(int, char *, int /*<<< orphan*/);
int main(void) { unlinkat(42, "foo", 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
lea    0xee0(%rip),%rsi
xor    %edx,%edx
call   1030 <unlinkat@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x2a,%edi
xor    %edx,%edx
call   1030 <unlinkat@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define i32 @main() {
%1 = call i32 @unlinkat(i32 42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i32 @main() {
%1 = tail call i32 @unlinkat(i32 42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
void ppr() {}


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

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

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

LLVM IR (-O2):
define void @ppr() {
ret void
}
void glPopName(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glPopName() {
ret void
}
/* Variables and functions */
int lockScheduler();
int /*<<< orphan*/ releaseMutexFromPos(int);
int /*<<< orphan*/ unlockScheduler();
int whereIs(char *);
int releaseMutex(char *name) {
  int notPreviouslyLocked = lockScheduler();
  int pos = whereIs(name);
  releaseMutexFromPos(pos);
  if (notPreviouslyLocked)
    unlockScheduler();
  return 0;
}


x86 assembly (clang, -O0):
<releaseMutex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <lockScheduler@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <whereIs@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <releaseMutexFromPos@plt>
cmpl   $0x0,-0xc(%rbp)
je     117b <releaseMutex+0x3b>
mov    $0x0,%al
call   1060 <unlockScheduler@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<releaseMutex>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <lockScheduler@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <whereIs@plt>
mov    %eax,%edi
call   1030 <releaseMutexFromPos@plt>
test   %ebp,%ebp
je     1169 <releaseMutex+0x29>
xor    %eax,%eax
call   1060 <unlockScheduler@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @releaseMutex(i8* %0) {
%2 = tail call i32 (...) @lockScheduler()
%3 = tail call i32 @whereIs(i8* %0)
%4 = tail call i32 @releaseMutexFromPos(i32 %3)
%5 = icmp eq i32 %2, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 (...) @unlockScheduler()
br label %8
8: ; preds = %6, %1
ret i32 0
}
char *xaAlignSuffix() { return ".st"; }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c".st\00"
define i8* @xaAlignSuffix() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c".st\00"
define i8* @xaAlignSuffix() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
OP(dd, f7) {
  illegal_1();
  op_f7();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_f7@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_f7@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_f7()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fseeko(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
__attribute__((__weak__, __always___)) int
softboundmpx_fseeko(FILE *stream, off_t offset, int whence) {
  return fseeko(stream, offset, whence);
}


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

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

LLVM IR (-O0):
define weak i32 @softboundmpx_fseeko(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @fseeko(i32* %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define weak i32 @softboundmpx_fseeko(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @fseeko(i32* %0, i32 %1, i32 %2)
ret i32 %4
}
void glDeleteVertexArrays(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glDeleteVertexArrays() {
ret void
}
int getnameinfo(const void *sa, unsigned int salen, char *host,
                unsigned int hostlen, char *serv, unsigned int servlen,
                int flags) {
  return -4;
}


x86 assembly (clang, -O0):
<getnameinfo>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    $0xfffffffc,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @getnameinfo(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, i32 %5, i32 %6) {
ret i32 -4
}
/* Type definitions */
struct msg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ msg_put(struct msg *);
void rsp_put(struct msg *msg) {
  ;
  ;
  msg_put(msg);
}


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

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

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

LLVM IR (-O2):
%struct.msg = type { i32 }
define void @rsp_put(%struct.msg* %0) {
%2 = tail call i32 @msg_put(%struct.msg* %0)
ret void
}
/* Variables and functions */
scalar_t__ my_isblank(char);
char *sskip(char *s) {
  while (my_isblank(*s))
    s++;
  return s;
}


x86 assembly (clang, -O0):
<sskip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <my_isblank@plt>
cmp    $0x0,%rax
je     1143 <sskip+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <sskip+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sskip>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <my_isblank@plt>
test   %rax,%rax
jne    1120 <sskip+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @sskip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @my_isblank(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @sskip(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @my_isblank(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}