xunge/DecIR huggingface dataset:
OP(dd, d6) {
  illegal_1();
  op_d6();
}


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_d6@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_d6@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_d6()
%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_d6()
ret i32 undef
}
int paxos_quorum(int acceptors) { return (acceptors / 2) + 1; }


x86 assembly (clang, -O0):
<paxos_quorum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @paxos_quorum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 2
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @paxos_quorum(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(void) {
  extern char *program_invocation_short_name;
  printf("USAGE:\n");
  printf(" sudo %s on|off\n", program_invocation_short_name);
  printf("\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2ec7(%rip),%rax
mov    (%rax),%rsi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed9(%rip),%rdi
call   1040 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"USAGE:\0A\00"
@.str.1 = [17 x i8] c" sudo %s on|off\0A\00"
@program_invocation_short_name = external global i8*
@.str.2 = [2 x i8] c"\0A\00"
define void @usage() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = load i8*, i8** @program_invocation_short_name
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c" sudo %s on|off\0A\00"
@program_invocation_short_name = external global i8*
@str = [7 x i8] c"USAGE:\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = load i8*, i8** @program_invocation_short_name
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void stest(int x) {
  if (x >> 0 != x)
    link_error();
  if (x << 0 != x)
    link_error();
  if (0 << x != 0)
    link_error();
  if (0 >> x != 0)
    link_error();
}


x86 assembly (clang, -O0):
<stest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
cmp    -0x4(%rbp),%eax
je     1131 <stest+0x21>
mov    $0x0,%al
call   1030 <link_error@plt>
mov    -0x4(%rbp),%eax
shl    $0x0,%eax
cmp    -0x4(%rbp),%eax
je     1147 <stest+0x37>
mov    $0x0,%al
call   1030 <link_error@plt>
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
shl    %cl,%eax
cmp    $0x0,%eax
je     115e <stest+0x4e>
mov    $0x0,%al
call   1030 <link_error@plt>
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
sar    %cl,%eax
cmp    $0x0,%eax
je     1175 <stest+0x65>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @stest(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 0
%5 = load i32, i32* %2
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @link_error()
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
%11 = shl i32 %10, 0
%12 = load i32, i32* %2
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 (...) @link_error()
br label %16
16: ; preds = %14, %9
%17 = load i32, i32* %2
%18 = shl i32 0, %17
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 (...) @link_error()
br label %22
22: ; preds = %20, %16
%23 = load i32, i32* %2
%24 = ashr i32 0, %23
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 (...) @link_error()
br label %28
28: ; preds = %26, %22
ret void
}

LLVM IR (-O2):
define void @stest(i32 %0) {
ret void
}
__attribute__((always_)) int complement3bit(int x) {
  if (x & 4)
    return ((x & 3) - 4);
  return x;
}


x86 assembly (clang, -O0):
<complement3bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1127 <complement3bit+0x27>
mov    -0x8(%rbp),%eax
and    $0x3,%eax
sub    $0x4,%eax
mov    %eax,-0x4(%rbp)
jmp    112d <complement3bit+0x2d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<complement3bit>:
mov    %edi,%eax
or     $0xfffffffc,%eax
test   $0x4,%dil
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @complement3bit(i32 %0) {
%2 = and i32 %0, 4
%3 = icmp eq i32 %2, 0
%4 = or i32 %0, -4
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Type definitions */
struct statfs {
  int f_type;
};

/* Variables and functions */
int /*<<< orphan*/ statfs(char *, struct statfs *);
int tst_is_cwd_tmpfs(void) {
  struct statfs sf;
  statfs(".", &sf);
  return (sf.f_type == 0x01021994);
}


x86 assembly (clang, -O0):
<tst_is_cwd_tmpfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <statfs@plt>
cmpl   $0x1021994,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_is_cwd_tmpfs>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rsp,%rsi
call   1030 <statfs@plt>
xor    %eax,%eax
cmpl   $0x1021994,(%rsp)
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.statfs = type { i32 }
@.str = [2 x i8] c".\00"
define i32 @tst_is_cwd_tmpfs() {
%1 = alloca %struct.statfs
%2 = call i32 @statfs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %struct.statfs* %1)
%3 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 16914836
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.statfs = type { i32 }
@.str = [2 x i8] c".\00"
define i32 @tst_is_cwd_tmpfs() {
%1 = alloca %struct.statfs
%2 = bitcast %struct.statfs* %1 to i8*
%3 = call i32 @statfs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %struct.statfs* %1)
%4 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 16914836
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int swapon(const char *path, int flags) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<swapon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapon>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @swapon(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
int build_client_side(int nb_sched_elts) {}


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

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

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

LLVM IR (-O2):
define i32 @build_client_side(i32 %0) {
ret i32 undef
}
unsigned xstrlen(const char *s) {
  const char *i;
  for (i = s; *i; i++) {
  }
  return (unsigned)(i - s);
}


x86 assembly (clang, -O0):
<xstrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <xstrlen+0x33>
jmp    1122 <xstrlen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <xstrlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @xstrlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int int32_t;
typedef int clock_t;

/* Variables and functions */
int clock();
clock_t clock_t_avg_err() {
  clock_t error_arr;
  clock_t avg;
  for (int32_t i = 0; i < 3; i++) {
    clock_t t_start = clock();
    clock_t t_end = clock() - t_start;
    error_arr += t_end;
  }
  clock_t std_err = error_arr / 3;
  return std_err;
}


x86 assembly (clang, -O0):
<clock_t_avg_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1157 <clock_t_avg_err+0x47>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <clock_t_avg_err+0xf>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @clock_t_avg_err() {
%1 = tail call i32 (...) @clock()
%2 = tail call i32 (...) @clock()
%3 = tail call i32 (...) @clock()
%4 = tail call i32 (...) @clock()
%5 = tail call i32 (...) @clock()
%6 = tail call i32 (...) @clock()
ret i32 0
}
unsigned int IsDigit(char ch) {
  return (ch >= '0') && (ch <= '9');
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<IsDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <IsDigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsDigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @IsDigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int strlen(char *src) {
  int i = 0;
  while (*src++) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen+0x35>
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>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
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 = %9, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
OP(fd, da) { op_da(); }


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 <op_da@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
xor    %eax,%eax
jmp    1030 <op_da@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 (...) @op_da()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_da()
ret i32 undef
}
/* Variables and functions */
int snprintf(char *, int, char *, int);
int senFunc1(char *s, int n, int a) { return snprintf(s, n, "None: %d", a); }


x86 assembly (clang, -O0):
<senFunc1>:
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),%ecx
lea    0xecd(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<senFunc1>:
mov    %edx,%ecx
lea    0xee7(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"None: %d\00"
define i32 @senFunc1(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @snprintf(i8* %7, i32 %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [9 x i8] c"None: %d\00"
define i32 @senFunc1(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ arch_func_leave();
void emit_func_leave() { arch_func_leave(); }


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

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

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

LLVM IR (-O2):
define void @emit_func_leave() {
%1 = tail call i32 (...) @arch_func_leave()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f(int signal) { printf("oohps\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"oohps\00"
define void @f(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
char *str(int);
int /*<<< orphan*/ strerror_r(int /*<<< orphan*/, char *, int);
const char *perr() {
  char *st = str(100);
  strerror_r(errno, st, 100);
  return st;
}


x86 assembly (clang, -O0):
<perr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1040 <str@plt>
mov    %rax,-0x8(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    $0x64,%edx
call   1030 <strerror_r@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perr>:
push   %rbx
mov    $0x64,%edi
call   1040 <str@plt>
mov    %rax,%rbx
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
mov    $0x64,%edx
call   1030 <strerror_r@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
define i8* @perr() {
%1 = alloca i8*
%2 = call i8* @str(i32 100)
store i8* %2, i8** %1
%3 = load i32, i32* @errno
%4 = load i8*, i8** %1
%5 = call i32 @strerror_r(i32 %3, i8* %4, i32 100)
%6 = load i8*, i8** %1
ret i8* %6
}

LLVM IR (-O2):
@errno = global i32 0
define i8* @perr() {
%1 = tail call i8* @str(i32 100)
%2 = load i32, i32* @errno
%3 = tail call i32 @strerror_r(i32 %2, i8* %1, i32 100)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
void i(int c[]) { f(c); }


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

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

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

LLVM IR (-O2):
define void @i(i32* %0) {
%2 = tail call i32 @f(i32* %0)
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *malloc(int);
int /*<<< orphan*/ out_of_memory();
void *xcalloc(size_t count, size_t size) {
  void *p = count && size ? calloc(count, size) : malloc(1);
  if (p == NULL) {
    out_of_memory();
  }
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116c <xcalloc+0x3c>
cmpq   $0x0,-0x10(%rbp)
je     116c <xcalloc+0x3c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x20(%rbp)
jmp    117a <xcalloc+0x4a>
mov    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1194 <xcalloc+0x64>
mov    $0x0,%al
call   1040 <out_of_memory@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
test   %rdi,%rdi
je     1142 <xcalloc+0x12>
test   %rsi,%rsi
je     1142 <xcalloc+0x12>
call   1030 <calloc@plt>
jmp    114c <xcalloc+0x1c>
mov    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115b <xcalloc+0x2b>
xor    %eax,%eax
call   1040 <out_of_memory@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i64, i64* %4
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i64, i64* %3
%13 = load i64, i64* %4
%14 = call i8* @calloc(i64 %12, i64 %13)
br label %17
15: ; preds = %8, %2
%16 = call i8* @malloc(i32 1)
br label %17
17: ; preds = %15, %11
%18 = phi i8* [ %14, %11 ], [ %16, %15 ]
store i8* %18, i8** %5
%19 = load i8*, i8** %5
%20 = icmp eq i8* %19, null
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = call i32 (...) @out_of_memory()
br label %23
23: ; preds = %21, %17
%24 = load i8*, i8** %5
ret i8* %24
}

LLVM IR (-O2):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = icmp ne i64 %0, 0
%4 = icmp ne i64 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i8* @calloc(i64 %0, i64 %1)
br label %10
8: ; preds = %2
%9 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
br label %10
10: ; preds = %8, %6
%11 = phi i8* [ %7, %6 ], [ %9, %8 ]
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 (...) @out_of_memory()
br label %15
15: ; preds = %13, %10
ret i8* %11
}
/* Type definitions */
struct list_elem {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
struct list_elem *list_front(struct list *);
struct list_elem *list_head(struct list *list) {
  return list_front(list);
}


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

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

LLVM IR (-O0):
%struct.list_elem = type { i32 }
%struct.list = type { i32 }
define %struct.list_elem* @list_head(%struct.list* %0) {
%2 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
%3 = load %struct.list*, %struct.list** %2
%4 = call %struct.list_elem* @list_front(%struct.list* %3)
ret %struct.list_elem* %4
}

LLVM IR (-O2):
%struct.list_elem = type { i32 }
%struct.list = type { i32 }
define %struct.list_elem* @list_head(%struct.list* %0) {
%2 = tail call %struct.list_elem* @list_front(%struct.list* %0)
ret %struct.list_elem* %2
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int initialize_dobldobl_sampler(int dim) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(632, &dim, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<initialize_dobldobl_sampler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x278,%edi
lea    -0x4(%rbp),%rsi
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):
<initialize_dobldobl_sampler>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x278,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @initialize_dobldobl_sampler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 632, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
void scalar_butterfly_and_negate_b(float a[restrict 1], float b[restrict 1]) {
  const float new_a = *a + *b;
  const float new_b = *b - *a;
  *a = new_a;
  *b = new_b;
}


x86 assembly (clang, -O0):
<scalar_butterfly_and_negate_b>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalar_butterfly_and_negate_b>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
movaps %xmm0,%xmm2
addss  %xmm1,%xmm2
subss  %xmm0,%xmm1
movss  %xmm2,(%rdi)
movss  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @scalar_butterfly_and_negate_b(float* noalias %0, float* noalias %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
%6 = alloca float
store float* %0, float** %3
store float* %1, float** %4
%7 = load float*, float** %3
%8 = load float, float* %7
%9 = load float*, float** %4
%10 = load float, float* %9
%11 = fadd float %8, %10
store float %11, float* %5
%12 = load float*, float** %4
%13 = load float, float* %12
%14 = load float*, float** %3
%15 = load float, float* %14
%16 = fsub float %13, %15
store float %16, float* %6
%17 = load float, float* %5
%18 = load float*, float** %3
store float %17, float* %18
%19 = load float, float* %6
%20 = load float*, float** %4
store float %19, float* %20
ret void
}

LLVM IR (-O2):
define void @scalar_butterfly_and_negate_b(float* noalias nocapture %0, float* noalias nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fadd float %3, %4
%6 = fsub float %4, %3
store float %5, float* %0
store float %6, float* %1
ret void
}
void buf_free(void) {}


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

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

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

LLVM IR (-O2):
define void @buf_free() {
ret void
}
int uppercase_position(char ch) {
  if ((ch >= 'A') && (ch <= 'Z')) {
    return (ch - 'A' + 1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<uppercase_position>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1136 <uppercase_position+0x36>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1136 <uppercase_position+0x36>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113d <uppercase_position+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uppercase_position>:
lea    -0x41(%rdi),%ecx
lea    -0x40(%rdi),%edx
xor    %eax,%eax
cmp    $0x1a,%cl
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @uppercase_position(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 65
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %17
16: ; preds = %7, %1
store i32 0, i32* %2
br label %17
17: ; preds = %16, %11
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @uppercase_position(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -64
%6 = select i1 %3, i32 %5, i32 0
ret i32 %6
}
int func(int x) {
  int countx = 0;
  while (x) {
    countx++;
    x = x & (x - 1);
  }
  return countx;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <func+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <func+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = add nsw i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fild_preg64_qword(int reg64) {
  put8(0xDF);
  put8(0x28 + reg64);
}


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

x86 assembly (clang, -O2):
<fild_preg64_qword>:
push   %rbx
mov    %edi,%ebx
mov    $0xdf,%edi
call   1030 <put8@plt>
add    $0x28,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @fild_preg64_qword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 223)
%4 = load i32, i32* %2
%5 = add nsw i32 40, %4
%6 = call i32 @put8(i32 %5)
ret void
}

LLVM IR (-O2):
define void @fild_preg64_qword(i32 %0) {
%2 = tail call i32 @put8(i32 223)
%3 = add nsw i32 %0, 40
%4 = tail call i32 @put8(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int bar(int do_sleep) {
  if (do_sleep)
    usleep(100);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <bar+0x1f>
mov    $0x64,%edi
call   1030 <usleep@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
test   %edi,%edi
je     1123 <bar+0x13>
push   %rax
mov    $0x64,%edi
call   1030 <usleep@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @usleep(i32 100)
br label %5
5: ; preds = %3, %1
ret i32 undef
}
void foo773() {}


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

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

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

LLVM IR (-O2):
define void @foo773() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ closeFd(int);
void closeMySocket(int sockfd) {
  int fd;
  for (fd = 0; fd < 128; fd++)
    closeFd(fd);
  close(sockfd);
}


x86 assembly (clang, -O0):
<closeMySocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jge    1155 <closeMySocket+0x35>
mov    -0x8(%rbp),%edi
call   1040 <closeFd@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <closeMySocket+0x12>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeMySocket>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1040 <closeFd@plt>
add    $0x1,%ebp
cmp    $0x80,%ebp
jne    1130 <closeMySocket+0x10>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @closeMySocket(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 128
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %3
%9 = call i32 @closeFd(i32 %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i32, i32* %2
%15 = call i32 @close(i32 %14)
ret void
}

LLVM IR (-O2):
define void @closeMySocket(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %5, %2 ]
%4 = tail call i32 @closeFd(i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 128
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OPENSSL_assert(char *);
void CRYPTO_dbg_free(void *addr, int before_p) {
  OPENSSL_assert("CRYPTO_dbg_free is no longer permitted");
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"CRYPTO_dbg_free is no longer permitted\00"
define void @CRYPTO_dbg_free(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @OPENSSL_assert(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"CRYPTO_dbg_free is no longer permitted\00"
define void @CRYPTO_dbg_free(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @OPENSSL_assert(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printIncSeq(int, int, int /*<<< orphan*/, int *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int n, m;
  scanf("%d %d\n", &n, &m);
  int arr[m];
  printIncSeq(n, m, 0, arr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1040 <printIncSeq@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
lea    0xed3(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <scanf@plt>
mov    %rsp,%rbx
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,%rsp
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1040 <printIncSeq@plt>
mov    %rbx,%rsp
xor    %eax,%eax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %4
%10 = alloca i32, i64 %8
store i64 %8, i64* %5
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @printIncSeq(i32 %11, i32 %12, i32 0, i32* %10)
store i32 0, i32* %1
%14 = load i8*, i8** %4
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
%9 = alloca i32, i64 %7
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 @printIncSeq(i32 %10, i32 %11, i32 0, i32* %9)
ret i32 0
}
/* Variables and functions */
int update_crc(int, unsigned char *, int);
unsigned long mpc_crc32(unsigned char *buf, int len) {
  return update_crc(0xffffffffL, buf, len) ^ 0xffffffffL;
}


x86 assembly (clang, -O0):
<mpc_crc32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0xffffffff,%edi
call   1030 <update_crc@plt>
cltq
movabs $0xffffffff,%rcx
xor    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpc_crc32>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0xffffffff,%edi
call   1030 <update_crc@plt>
movslq %eax,%rcx
mov    $0xffffffff,%eax
xor    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @mpc_crc32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @update_crc(i32 -1, i8* %5, i32 %6)
%8 = sext i32 %7 to i64
%9 = xor i64 %8, 4294967295
ret i64 %9
}

LLVM IR (-O2):
define i64 @mpc_crc32(i8* %0, i32 %1) {
%3 = tail call i32 @update_crc(i32 -1, i8* %0, i32 %1)
%4 = sext i32 %3 to i64
%5 = xor i64 %4, 4294967295
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ DrawHouse(double, double);
int GetWindowHeight();
int GetWindowWidth();
int /*<<< orphan*/ InitGraphics();
main() {
  double cx, cy;
  InitGraphics();
  cx = GetWindowWidth() / 2;
  cy = GetWindowHeight() / 2;
  DrawHouse(cx - 3.0 / 2, cy - (2.0 + 0.7) / 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <InitGraphics@plt>
mov    $0x0,%al
call   1030 <GetWindowWidth@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1050 <GetWindowHeight@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe7c(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe63(%rip),%xmm2
subsd  %xmm2,%xmm1
call   1060 <DrawHouse@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <InitGraphics@plt>
xor    %eax,%eax
call   1030 <GetWindowWidth@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
cvtsi2sd %ecx,%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1050 <GetWindowHeight@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
cvtsi2sd %ecx,%xmm1
movsd  (%rsp),%xmm0
addsd  0xe7e(%rip),%xmm0
addsd  0xe7e(%rip),%xmm1
call   1060 <DrawHouse@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = call i32 (...) @InitGraphics()
%4 = call i32 (...) @GetWindowWidth()
%5 = sdiv i32 %4, 2
%6 = sitofp i32 %5 to double
store double %6, double* %1
%7 = call i32 (...) @GetWindowHeight()
%8 = sdiv i32 %7, 2
%9 = sitofp i32 %8 to double
store double %9, double* %2
%10 = load double, double* %1
%11 = fsub double %10, 1.500000e+00
%12 = load double, double* %2
%13 = fsub double %12, 1.350000e+00
%14 = call i32 @DrawHouse(double %11, double %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @InitGraphics()
%2 = tail call i32 (...) @GetWindowWidth()
%3 = sdiv i32 %2, 2
%4 = sitofp i32 %3 to double
%5 = tail call i32 (...) @GetWindowHeight()
%6 = sdiv i32 %5, 2
%7 = sitofp i32 %6 to double
%8 = fadd double %4, -1.500000e+00
%9 = fadd double %7, -1.350000e+00
%10 = tail call i32 @DrawHouse(double %8, double %9)
ret i32 0
}
long _stp_perf_read(int ncpu, unsigned i) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @_stp_perf_read(i32 %0, i32 %1) {
ret i64 0
}
/* Variables and functions */
unsigned int get_hex8(char *);
unsigned int get_hex16_le(char *txt) {
  unsigned int val = 0;
  int i;
  for (i = 1; i >= 0; i--)
    val = (val << 8) | get_hex8(&txt[i * 2]);
  return val;
}


x86 assembly (clang, -O0):
<get_hex16_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1169 <get_hex16_le+0x59>
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
cltq
add    %rax,%rdi
call   1030 <get_hex8@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <get_hex16_le+0x1a>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hex16_le>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x2,%rdi
call   1030 <get_hex8@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
mov    %rbx,%rdi
call   1030 <get_hex8@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_hex16_le(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 1, i32* %4
br label %5
5: ; preds = %18, %1
%6 = load i32, i32* %4
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = load i32, i32* %3
%10 = shl i32 %9, 8
%11 = load i8*, i8** %2
%12 = load i32, i32* %4
%13 = mul nsw i32 %12, 2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
%16 = call i32 @get_hex8(i8* %15)
%17 = or i32 %10, %16
store i32 %17, i32* %3
br label %18
18: ; preds = %8
%19 = load i32, i32* %4
%20 = add nsw i32 %19, -1
store i32 %20, i32* %4
br label %5
21: ; preds = %5
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @get_hex16_le(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = tail call i32 @get_hex8(i8* %2)
%4 = shl i32 %3, 8
%5 = tail call i32 @get_hex8(i8* %0)
%6 = or i32 %5, %4
ret i32 %6
}
/* Type definitions */
struct fpga_model {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ is_in_row(struct fpga_model *, int, int *,
                             int /*<<< orphan*/);
int which_row(int y, struct fpga_model *model) {
  int result;
  is_in_row(model, y, &result, 0);
  return result;
}


x86 assembly (clang, -O0):
<which_row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
lea    -0x14(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <is_in_row@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<which_row>:
push   %rax
mov    %edi,%eax
lea    0x4(%rsp),%rdx
mov    %rsi,%rdi
mov    %eax,%esi
xor    %ecx,%ecx
call   1030 <is_in_row@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.fpga_model = type { i32 }
define i32 @which_row(i32 %0, %struct.fpga_model* %1) {
%3 = alloca i32
%4 = alloca %struct.fpga_model*
%5 = alloca i32
store i32 %0, i32* %3
store %struct.fpga_model* %1, %struct.fpga_model** %4
%6 = load %struct.fpga_model*, %struct.fpga_model** %4
%7 = load i32, i32* %3
%8 = call i32 @is_in_row(%struct.fpga_model* %6, i32 %7, i32* %5, i32 0)
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
%struct.fpga_model = type { i32 }
define i32 @which_row(i32 %0, %struct.fpga_model* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @is_in_row(%struct.fpga_model* %1, i32 %0, i32* %3, i32 0)
%6 = load i32, i32* %3
ret i32 %6
}
void ifx_ppa_pwm_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @ifx_ppa_pwm_exit() {
ret void
}
void *pampd_mark_intransit(void *pampd) {
  unsigned long fake_pampd = (unsigned long)pampd;
  fake_pampd |= 1UL << (0 + 1);
  fake_pampd |= 1UL << 0;
  return (void *)fake_pampd;
}


x86 assembly (clang, -O0):
<pampd_mark_intransit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
or     $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
or     $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pampd_mark_intransit>:
mov    %rdi,%rax
or     $0x3,%rax
ret

LLVM IR (-O0):
define i8* @pampd_mark_intransit(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = or i64 %6, 2
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = or i64 %8, 1
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
define i8* @pampd_mark_intransit(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = or i64 %2, 3
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}