xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  int x = 10;
  assert(x < 2);
  assert(x == 1 && "This is a clever way to print an informative message "
                   "whenever an assert fails.");
  exit(0);
  assert(0 && "We hit an unreachable location.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jne    1160 <main+0x40>
mov    $0x1,%al
mov    %al,-0x9(%rbp)
jmp    1160 <main+0x40>
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [79 x i8] c"This is a clever way to print an informative message whenever an assert fails.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 2
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %0
br label %10
10: ; preds = %9, %0
%11 = phi i1 [ false, %0 ], [ true, %9 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
%2 = tail call i32 @assert(i32 0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef size_t uint64_t;
typedef scalar_t__ int64_t;

/* Variables and functions */
void zero_array(int64_t *arr, uint64_t len) {
  for (uint64_t i = 0; i < len; ++i) {
    arr[i] = 0;
  }
}


x86 assembly (clang, -O0):
<zero_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1143 <zero_array+0x43>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <zero_array+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_array>:
test   %rsi,%rsi
je     1128 <zero_array+0x18>
push   %rax
mov    %rsi,%rdx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @zero_array(i64* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = bitcast i64* %0 to i8*
%6 = shl nuw i64 %1, 3
br label %7
7: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int *malloc(int);
uint32_t *generateSquares(uint32_t limit) {
  uint32_t *squares = malloc(100000 * sizeof(uint32_t));
  for (uint32_t i = 1;; i++) {
    squares[i - 1] = i * i;
    if (squares[i] > limit)
      return squares;
  }
  return squares;
}


x86 assembly (clang, -O0):
<generateSquares>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x61a80,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%edx
imul   -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x4(%rbp),%eax
jle    1165 <generateSquares+0x55>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret
jmp    116a <generateSquares+0x5a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1130 <generateSquares+0x20>

x86 assembly (clang, -O2):
<generateSquares>:
push   %rbx
mov    %edi,%ebx
mov    $0x61a80,%edi
call   1030 <malloc@plt>
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ecx,%edx
imul   %ecx,%edx
mov    %edx,-0x4(%rax,%rcx,4)
lea    0x1(%rcx),%rdx
cmp    %ebx,(%rax,%rcx,4)
mov    %rdx,%rcx
jle    1130 <generateSquares+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define i32* @generateSquares(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32* @malloc(i32 400000)
store i32* %5, i32** %3
store i32 1, i32* %4
br label %6
6: ; preds = %25, %1
%7 = load i32, i32* %4
%8 = load i32, i32* %4
%9 = mul nsw i32 %7, %8
%10 = load i32*, i32** %3
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %10, i64 %13
store i32 %9, i32* %14
%15 = load i32*, i32** %3
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %2
%21 = icmp sgt i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %6
%23 = load i32*, i32** %3
ret i32* %23
24: ; preds = %6
br label %25
25: ; preds = %24
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %6
}

LLVM IR (-O2):
define noalias i32* @generateSquares(i32 %0) {
%2 = tail call i32* @malloc(i32 400000)
br label %3
3: ; preds = %3, %1
%4 = phi i64 [ %12, %3 ], [ 1, %1 ]
%5 = mul nsw i64 %4, %4
%6 = add nsw i64 %4, -1
%7 = getelementptr inbounds i32, i32* %2, i64 %6
%8 = trunc i64 %5 to i32
store i32 %8, i32* %7
%9 = getelementptr inbounds i32, i32* %2, i64 %4
%10 = load i32, i32* %9
%11 = icmp sgt i32 %10, %0
%12 = add nuw i64 %4, 1
br i1 %11, label %13, label %3
13: ; preds = %3
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void doubleFree() {
  char *p = malloc(10);
  free(p);
  free(p);
}


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

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

LLVM IR (-O0):
define void @doubleFree() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 10)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @free(i8* %3)
%5 = load i8*, i8** %1
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @doubleFree() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @free(i8* %1)
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Type definitions */
struct vnode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ make_bad_inode(int /*<<< orphan*/);
int /*<<< orphan*/ vn_to_inode(struct vnode *);
void vn_mark_bad(struct vnode *vp) { make_bad_inode(vn_to_inode(vp)); }


x86 assembly (clang, -O0):
<vn_mark_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <vn_to_inode@plt>
mov    %eax,%edi
call   1030 <make_bad_inode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vn_mark_bad>:
push   %rax
call   1040 <vn_to_inode@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <make_bad_inode@plt>

LLVM IR (-O0):
%struct.vnode = type { i32 }
define void @vn_mark_bad(%struct.vnode* %0) {
%2 = alloca %struct.vnode*
store %struct.vnode* %0, %struct.vnode** %2
%3 = load %struct.vnode*, %struct.vnode** %2
%4 = call i32 @vn_to_inode(%struct.vnode* %3)
%5 = call i32 @make_bad_inode(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.vnode = type { i32 }
define void @vn_mark_bad(%struct.vnode* %0) {
%2 = tail call i32 @vn_to_inode(%struct.vnode* %0)
%3 = tail call i32 @make_bad_inode(i32 %2)
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ assert(int);
int clock_gettime(int /*<<< orphan*/, struct timespec *);
void get_monotonic_time(struct timespec *res) {
  struct timespec ts;
  int rv = clock_gettime(CLOCK_MONOTONIC, &ts);
  assert(rv == 0);
  *res = ts;
}


x86 assembly (clang, -O0):
<get_monotonic_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_monotonic_time>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    0x8(%rsp),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define void @get_monotonic_time(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
%3 = alloca %struct.timespec
%4 = alloca i32
store %struct.timespec* %0, %struct.timespec** %2
%5 = load i32, i32* @CLOCK_MONOTONIC
%6 = call i32 @clock_gettime(i32 %5, %struct.timespec* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load %struct.timespec*, %struct.timespec** %2
%12 = bitcast %struct.timespec* %11 to i8*
%13 = bitcast %struct.timespec* %3 to i8*
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define void @get_monotonic_time(%struct.timespec* nocapture writeonly %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = load i32, i32* @CLOCK_MONOTONIC
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %2)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%10 = getelementptr %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%11 = load i32, i32* %9
store i32 %11, i32* %10
ret void
}
int test_012(int a, int c, int b, int d) { return a + b + d + (b & 1); }


x86 assembly (clang, -O0):
<test_012>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
and    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_012>:
lea    (%rdi,%rdx,1),%eax
add    %ecx,%eax
and    $0x1,%edx
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @test_012(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %8
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %7
%15 = and i32 %14, 1
%16 = add nsw i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @test_012(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %2, %0
%6 = add nsw i32 %5, %3
%7 = and i32 %2, 1
%8 = add nsw i32 %6, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ make_all_visible(int);
void tui_make_all_visible(void) { make_all_visible(1); }


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

x86 assembly (clang, -O2):
<tui_make_all_visible>:
mov    $0x1,%edi
jmp    1030 <make_all_visible@plt>

LLVM IR (-O0):
define void @tui_make_all_visible() {
%1 = call i32 @make_all_visible(i32 1)
ret void
}

LLVM IR (-O2):
define void @tui_make_all_visible() {
%1 = tail call i32 @make_all_visible(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int x;
  x = 0;
  if (x)
    printf("x is 1\n");
  else
    printf("x is 2\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1148 <main+0x38>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
jmp    1154 <main+0x44>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [7 x i8] c"x is 2\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test() { printf("it worked!\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"it worked!\00"
define void @test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int read(int, char *, int);
void read_routine(int sock, char *buf) {
  while (1) {
    int str_len = read(sock, buf, 30);
    if (str_len == 0)
      return;
    buf[str_len] = 0;
    printf("Message from Server: %s", buf);
  }
}


x86 assembly (clang, -O0):
<read_routine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1e,%edx
call   1040 <read@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1153 <read_routine+0x33>
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <read_routine+0xf>

x86 assembly (clang, -O2):
<read_routine>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x1e,%edx
call   1040 <read@plt>
test   %eax,%eax
je     1164 <read_routine+0x44>
lea    0xec2(%rip),%r14
xchg   %ax,%ax
cltq
movb   $0x0,(%rbx,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1e,%edx
call   1040 <read@plt>
test   %eax,%eax
jne    1140 <read_routine+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Message from Server: %s\00"
define void @read_routine(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
br label %6
6: ; preds = %2, %13
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @read(i32 %7, i8* %8, i32 30)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %6
ret void
13: ; preds = %6
%14 = load i8*, i8** %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 0, i8* %17
%18 = load i8*, i8** %4
%19 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %18)
br label %6
}

LLVM IR (-O2):
@.str = [24 x i8] c"Message from Server: %s\00"
define void @read_routine(i32 %0, i8* %1) {
%3 = tail call i32 @read(i32 %0, i8* %1, i32 30)
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %10, %5 ], [ %3, %2 ]
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %1, i64 %7
store i8 0, i8* %8
%9 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %1)
%10 = tail call i32 @read(i32 %0, i8* %1, i32 30)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void swap(int a, int b) {
  a = a + b;
  b = a - b;
  a = a - b;
  printf("after swap x=%d y=%d", a, b);
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"after swap x=%d y=%d\00"
define void @swap(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 %8, %9
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"after swap x=%d y=%d\00"
define void @swap(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
int HsPrintk(char *format, ...) {
  int a;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @HsPrintk(i8* nocapture readnone %0, ...) {
ret i32 undef
}
/* Variables and functions */
double dsfmt_gv_genrand_open_open();
double s_genrand_open_open(void) { return dsfmt_gv_genrand_open_open(); }


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

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

LLVM IR (-O0):
define double @s_genrand_open_open() {
%1 = call double (...) @dsfmt_gv_genrand_open_open()
ret double %1
}

LLVM IR (-O2):
define double @s_genrand_open_open() {
%1 = tail call double (...) @dsfmt_gv_genrand_open_open()
ret double %1
}
unsigned xrop3_76_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  return (stk1 & (~S)) | (D & S);
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_76_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ write_test(char *, char *);
void end_group() { write_test("shell", "let INDENT-=4;"); }


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

x86 assembly (clang, -O2):
<end_group>:
lea    0xee9(%rip),%rdi
lea    0xee8(%rip),%rsi
jmp    1030 <write_test@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"shell\00"
@.str.1 = [15 x i8] c"let INDENT-=4;\00"
define void @end_group() {
%1 = call i32 @write_test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"shell\00"
@.str.1 = [15 x i8] c"let INDENT-=4;\00"
define void @end_group() {
%1 = tail call i32 @write_test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void hpgDeleteEmitter(void *emitter) { free(emitter); }


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

x86 assembly (clang, -O2):
<hpgDeleteEmitter>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @hpgDeleteEmitter(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ psync_destroy();
int /*<<< orphan*/ psync_fs_start();
int /*<<< orphan*/ psync_fs_stop();
int /*<<< orphan*/ psync_init();
int /*<<< orphan*/ psync_start_sync(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdin;
int main() {
  psync_init();
  psync_start_sync(NULL, NULL);
  psync_fs_start();
  printf("Press enter to exit/umount\n");
  getc(stdin);
  psync_fs_stop();
  psync_destroy();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <psync_init@plt>
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1090 <psync_start_sync@plt>
mov    $0x0,%al
call   1060 <psync_fs_start@plt>
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
call   1070 <getc@plt>
mov    $0x0,%al
call   1050 <psync_fs_stop@plt>
mov    $0x0,%al
call   1040 <psync_destroy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <psync_init@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1090 <psync_start_sync@plt>
xor    %eax,%eax
call   1060 <psync_fs_start@plt>
lea    0xe71(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
call   1070 <getc@plt>
xor    %eax,%eax
call   1050 <psync_fs_stop@plt>
xor    %eax,%eax
call   1040 <psync_destroy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Press enter to exit/umount\0A\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @psync_init()
%3 = call i32 @psync_start_sync(i32* null, i32* null)
%4 = call i32 (...) @psync_fs_start()
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = call i32 @getc(i32 %6)
%8 = call i32 (...) @psync_fs_stop()
%9 = call i32 (...) @psync_destroy()
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@str = [27 x i8] c"Press enter to exit/umount\00"
define i32 @main() {
%1 = tail call i32 (...) @psync_init()
%2 = tail call i32 @psync_start_sync(i32* null, i32* null)
%3 = tail call i32 (...) @psync_fs_start()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%5 = load i32, i32* @stdin
%6 = tail call i32 @getc(i32 %5)
%7 = tail call i32 (...) @psync_fs_stop()
%8 = tail call i32 (...) @psync_destroy()
ret i32 0
}
__attribute__((no, noclone)) signed __int128 t152_5add(unsigned __int128 x) {
  signed __int128 r;
  if (__builtin_add_overflow(
          x,
          (unsigned __int128)((unsigned __int128)((
                                  signed __int128)(((unsigned __int128)1
                                                    << (16 * 8 - 1)) -
                                                   1)) +
                              1),
          &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t152_5add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
movabs $0x8000000000000000,%rax
add    %rax,%rcx
setb   %al
movzbl %al,%eax
mov    %eax,%esi
mov    %rsi,%rdi
neg    %rdi
mov    %rdi,%rax
xor    %rsi,%rax
or     %rdi,%rax
mov    %rcx,%rdi
shr    $0x3f,%rdi
xor    %rdi,%rsi
or     %rsi,%rax
setne  %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1181 <t152_5add+0x71>
jmp    1188 <t152_5add+0x78>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t152_5add>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movabs $0x8000000000000000,%rbx
add    %rsi,%rbx
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t152_5add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = zext i128 %11 to i129
%13 = call { i129, i1 } @llvm.sadd.with.overflow.i129(i129 %12, i129 170141183460469231731687303715884105728)
%14 = extractvalue { i129, i1 } %13, 1
%15 = extractvalue { i129, i1 } %13, 0
%16 = trunc i129 %15 to i128
%17 = sext i128 %16 to i129
%18 = icmp ne i129 %15, %17
%19 = or i1 %14, %18
store i128 %16, i128* %6
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 (...) @bar()
br label %22
22: ; preds = %20, %2
%23 = load i128, i128* %6
store i128 %23, i128* %3
%24 = bitcast i128* %3 to { i64, i64 }*
%25 = load { i64, i64 }, { i64, i64 }* %24
ret { i64, i64 } %25
}

LLVM IR (-O2):
define { i64, i64 } @t152_5add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = zext i128 %6 to i129
%8 = add nuw i129 %7, 170141183460469231731687303715884105728
%9 = tail call i32 (...) @bar()
%10 = trunc i129 %8 to i64
%11 = lshr i129 %8, 64
%12 = trunc i129 %11 to i64
%13 = insertvalue { i64, i64 } poison, i64 %10, 0
%14 = insertvalue { i64, i64 } %13, i64 %12, 1
ret { i64, i64 } %14
}
int test_imm_E3int16_reg(short val) {
  return ((val) & (0xE3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E3int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xe3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E3int16_reg>:
test   $0xe3,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E3int16_reg(i16 signext %0) {
%2 = and i16 %0, 227
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char helloworld[] = "Hello World";
  char *ptr;
  for (ptr = helloworld; *ptr != '\0'; ptr++) {
    printf("%c", *ptr);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116f <main+0x5f>
mov    -0x18(%rbp),%rax
lea    0xeb6(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113b <main+0x2b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x6f57206f6c6c6548,%rax
20 57 6f
mov    %rax,0x8(%rsp)
movl   $0x646c72,0x10(%rsp)
lea    0x9(%rsp),%rbx
mov    $0x48,%al
lea    0xed0(%rip),%r14
nopl   0x0(%rax)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <main+0x30>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.helloworld = [12 x i8] c"Hello World\00"
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [12 x i8]* %2 to i8*
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
store i8* %5, i8** %3
br label %6
6: ; preds = %15, %0
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %13)
br label %15
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
br label %6
18: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@__const.main.helloworld = [12 x i8] c"Hello World\00"
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %3
%4 = phi i8 [ %8, %3 ], [ 72, %0 ]
%5 = phi i8* [ %7, %3 ], [ %2, %0 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32 0
}
main() {
  f();
  g();
  g(2);
  f(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x0,%al
call   1040 <g@plt>
mov    $0x2,%edi
mov    $0x0,%al
call   1040 <g@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @f()
%2 = call i32 (...) @g()
%3 = call i32 (i32, ...) bitcast (i32 (...)* @g to i32 (i32, ...)*)(i32 2)
%4 = call i32 (i32, ...) bitcast (i32 (...)* @f to i32 (i32, ...)*)(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 (...) @g()
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @g to i32 (i32, ...)*)(i32 2)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @f to i32 (i32, ...)*)(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void eErro(char plvra[]) { printf("\n%s não ;", plvra); }


x86 assembly (clang, -O0):
<eErro>:
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):
<eErro>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"\0A%s n\C3\A3o ;\00"
define void @eErro(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int isascii(int c) { return c >= 0 && c < 0x80; }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1123 <isascii+0x23>
cmpl   $0x80,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 128
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int queue_delete(int /*<<< orphan*/);
int queue_delete_first() { return queue_delete(0); }


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

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

LLVM IR (-O0):
define i32 @queue_delete_first() {
%1 = call i32 @queue_delete(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @queue_delete_first() {
%1 = tail call i32 @queue_delete(i32 0)
ret i32 %1
}
void LLI2C_cleanup(void) {
  {}
}


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

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

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

LLVM IR (-O2):
define void @LLI2C_cleanup() {
ret void
}
void glGetTexEnviv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetTexEnviv() {
ret void
}
/* Variables and functions */
int getpid();
int my_process_id(void) { return getpid(); }


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

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

LLVM IR (-O0):
define i32 @my_process_id() {
%1 = call i32 (...) @getpid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @my_process_id() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void fatal_version_error() {
  fprintf(stderr, ".slb assembled with incompatible version\n");
  fprintf(stderr, "Version must be at least %d.%d\n", 1, 0);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal_version_error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal_version_error>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee9(%rip),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c".slb assembled with incompatible version\0A\00"
@.str.1 = [32 x i8] c"Version must be at least %d.%d\0A\00"
define void @fatal_version_error() {
%1 = load i32, i32* @stderr
%2 = call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 0)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c".slb assembled with incompatible version\0A\00"
@.str.1 = [32 x i8] c"Version must be at least %d.%d\0A\00"
define void @fatal_version_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 0)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void do_indent(int l) {
  int i;
  for (i = 0; i < l; i++)
    printf(" ");
}


x86 assembly (clang, -O0):
<do_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <do_indent+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <do_indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_indent>:
push   %rbx
test   %edi,%edi
jle    112f <do_indent+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <do_indent+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @do_indent(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 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @do_indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  fprintf(stdout, "hello world\n");
  fprintf(stderr, "error\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [13 x i8] c"hello world\0A\00"
@stderr = global i32 0
@.str.1 = [7 x i8] c"error\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @stdout
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [13 x i8] c"hello world\0A\00"
@stderr = global i32 0
@.str.1 = [7 x i8] c"error\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
RX0RX1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((p0[x0]) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<RX0RX1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x30(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     114c <RX0RX1+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <RX0RX1+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0RX1>:
movslq %edi,%rdi
movslq %esi,%rax
movsd  (%rcx,%rax,8),%xmm0
xor    %eax,%eax
ucomisd (%rdx,%rdi,8),%xmm0
setae  %al
ret

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

LLVM IR (-O2):
define i32 @RX0RX1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* %4, i64 %7
%9 = load double, double* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds double, double* %5, i64 %10
%12 = load double, double* %11
%13 = fcmp ole double %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
long kernel___Int_lsh___impl(long, long);
long core___core__Int___lsh(long self, long p0) {
  long var;
  long var1;
  var1 = kernel___Int_lsh___impl(self, p0);
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


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

x86 assembly (clang, -O2):
<core___core__Int___lsh>:
jmp    1030 <kernel___Int_lsh___impl@plt>

LLVM IR (-O0):
define i64 @core___core__Int___lsh(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = call i64 @kernel___Int_lsh___impl(i64 %7, i64 %8)
store i64 %9, i64* %6
%10 = load i64, i64* %6
store i64 %10, i64* %5
br label %11
11: ; preds = %2
%12 = load i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
define i64 @core___core__Int___lsh(i64 %0, i64 %1) {
%3 = tail call i64 @kernel___Int_lsh___impl(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int tuner_select(void *, unsigned short, unsigned int, unsigned int);
int bbm_com_tuner_select(void *handle, unsigned short devid,
                         unsigned int product, unsigned int brodcast) {
  int res;
  res = tuner_select(handle, devid, product, brodcast);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_tuner_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
movzwl %ax,%esi
call   1030 <tuner_select@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_tuner_select>:
jmp    1030 <tuner_select@plt>

LLVM IR (-O0):
define i32 @bbm_com_tuner_select(i8* %0, i16 zeroext %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i16 %1, i16* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = load i16, i16* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @tuner_select(i8* %10, i16 zeroext %11, i32 %12, i32 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
define i32 @bbm_com_tuner_select(i8* %0, i16 zeroext %1, i32 %2, i32 %3) {
%5 = tail call i32 @tuner_select(i8* %0, i16 zeroext %1, i32 %2, i32 %3)
ret i32 %5
}