xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ pad_set(int, int);
int(cmd_right)(int c, char **v) {
  pad_set((0x01), v[0][0] == '+');
  return 0;
}


x86 assembly (clang, -O0):
<cmd_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
mov    $0x1,%edi
call   1030 <pad_set@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_right>:
push   %rax
mov    (%rsi),%rax
xor    %esi,%esi
cmpb   $0x2b,(%rax)
sete   %sil
mov    $0x1,%edi
call   1030 <pad_set@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cmd_right(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 43
%12 = zext i1 %11 to i32
%13 = call i32 @pad_set(i32 1, i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @cmd_right(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 43
%6 = zext i1 %5 to i32
%7 = tail call i32 @pad_set(i32 1, i32 %6)
ret i32 0
}
void signed_char_and_signed_char_unsigned_int(signed char *LHS,
                                              unsigned int RHS) {
  (*LHS) &= RHS;
}


x86 assembly (clang, -O0):
<signed_char_and_signed_char_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
and    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char_and_signed_char_unsigned_int>:
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @signed_char_and_signed_char_unsigned_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = and i32 %8, %5
%10 = trunc i32 %9 to i8
store i8 %10, i8* %6
ret void
}

LLVM IR (-O2):
define void @signed_char_and_signed_char_unsigned_int(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = trunc i32 %1 to i8
%5 = and i8 %3, %4
store i8 %5, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int int_input(void) {
  int temp_number = 0;
  scanf("%d", &temp_number);
  return temp_number;
}


x86 assembly (clang, -O0):
<int_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_input>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @int_input() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
int errno;
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
void mygettimeofday(struct timeval *tv) {
  if (gettimeofday(tv, NULL)) {
    printf("gettimeofday: errno: %d\n", errno);
    abort();
  }
}


x86 assembly (clang, -O0):
<mygettimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
cmp    $0x0,%rax
je     116f <mygettimeofday+0x3f>
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mygettimeofday>:
push   %rax
xor    %esi,%esi
call   1050 <gettimeofday@plt>
test   %rax,%rax
jne    113f <mygettimeofday+0xf>
pop    %rax
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
@.str = [25 x i8] c"gettimeofday: errno: %d\0A\00"
@errno = global i32 0
define void @mygettimeofday(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i64 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @errno
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@.str = [25 x i8] c"gettimeofday: errno: %d\0A\00"
@errno = global i32 0
define void @mygettimeofday(%struct.timeval* nocapture %0) {
%2 = tail call i64 @gettimeofday(%struct.timeval* %0, i32* null)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}
int high_ones(int c) {
  int n;
  for (n = 0; (c & 0x80) == 0x80; c <<= 1)
    ++n;
  return n;
}


x86 assembly (clang, -O0):
<high_ones>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x80,%eax
jne    1138 <high_ones+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <high_ones+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<high_ones>:
xor    %eax,%eax
test   $0x80,%dil
je     111e <high_ones+0x1e>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
lea    (%rdi,%rdi,1),%ecx
test   $0x40,%dil
mov    %ecx,%edi
jne    1110 <high_ones+0x10>
ret

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

LLVM IR (-O2):
define i32 @high_ones(i32 %0) {
%2 = and i32 %0, 128
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i32 [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = shl i32 %6, 1
%9 = and i32 %6, 64
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ note(char const *, char const *);
void error(const char *s, const char *t) {
  note(s, t);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <note@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
call   1030 <note@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @error(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @note(i8* %5, i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @error(i8* %0, i8* %1) {
%3 = tail call i32 @note(i8* %0, i8* %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void ascii_copy(char *out, char *in) {
  while ((*out++ = *in++))
    ;
}


x86 assembly (clang, -O0):
<ascii_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <ascii_copy+0x3b>
jmp    110c <ascii_copy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_copy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <ascii_copy+0x10>
ret

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

LLVM IR (-O2):
define void @ascii_copy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
GET_PROMPT_NBR(r, s, d) int *r, d;
char *s;
{
  puts((char *)s);
  GET_NBR(r, d);
}


x86 assembly (clang, -O0):
<GET_PROMPT_NBR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1040 <GET_NBR@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GET_PROMPT_NBR>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
mov    %rsi,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <GET_NBR@plt>

LLVM IR (-O0):
define i32 @GET_PROMPT_NBR(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i8*, i8** %6
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %8)
%10 = load i32*, i32** %5
%11 = load i32, i32* %7
%12 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @GET_NBR to i32 (i32*, i32, ...)*)(i32* %10, i32 %11)
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
define i32 @GET_PROMPT_NBR(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %1)
%5 = tail call i32 (i32*, i32, ...) bitcast (i32 (...)* @GET_NBR to i32 (i32*, i32, ...)*)(i32* %0, i32 %2)
ret i32 undef
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t __ROUND_UP(int64_t num, int64_t align) {
  if (align == 0) {
    return num;
  }
  return (((num % align) == 0) ? (num) : (num + align - (num % align)));
}


x86 assembly (clang, -O0):
<__ROUND_UP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    111f <__ROUND_UP+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <__ROUND_UP+0x58>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    113a <__ROUND_UP+0x3a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <__ROUND_UP+0x52>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    -0x14(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ROUND_UP>:
test   %esi,%esi
je     1112 <__ROUND_UP+0x12>
mov    %edi,%eax
cltd
idiv   %esi
add    %edi,%esi
sub    %edx,%esi
test   %edx,%edx
cmovne %esi,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @__ROUND_UP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %27
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = srem i32 %11, %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = load i32, i32* %4
br label %25
17: ; preds = %10
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = add nsw i32 %18, %19
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = srem i32 %21, %22
%24 = sub nsw i32 %20, %23
br label %25
25: ; preds = %17, %15
%26 = phi i32 [ %16, %15 ], [ %24, %17 ]
store i32 %26, i32* %3
br label %27
27: ; preds = %25, %8
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @__ROUND_UP(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = srem i32 %0, %1
%6 = icmp eq i32 %5, 0
%7 = add nsw i32 %1, %0
%8 = sub i32 %7, %5
%9 = select i1 %6, i32 %0, i32 %8
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ %9, %4 ], [ %0, %2 ]
ret i32 %11
}
int end_or_comment(char ch) { return (ch == 0 || ch == '#' || ch == ';'); }


x86 assembly (clang, -O0):
<end_or_comment>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
je     113b <end_or_comment+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x23,%ecx
mov    %al,-0x2(%rbp)
je     113b <end_or_comment+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x3b,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_or_comment>:
mov    $0x1,%eax
test   %dil,%dil
je     1110 <end_or_comment+0x10>
cmp    $0x23,%dil
jne    1111 <end_or_comment+0x11>
ret
xor    %eax,%eax
cmp    $0x3b,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @end_or_comment(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 35
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 59
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @end_or_comment(i8 signext %0) {
switch i8 %0, label %2 [
i8 35, label %5
i8 0, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 59
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void foo() {
  static int x = 3;
  x++;
  printf("%d\n", x);
  x++;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0e(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f05(%rip)
mov    0x2eff(%rip),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eed(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ee4(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    0x2f11(%rip),%esi
add    $0x1,%esi
mov    %esi,0x2f08(%rip)
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
addl   $0x1,0x2ef5(%rip)
pop    %rax
ret

LLVM IR (-O0):
@foo.x = internal global i32 3
@.str = [4 x i8] c"%d\0A\00"
define void @foo() {
%1 = load i32, i32* @foo.x
%2 = add nsw i32 %1, 1
store i32 %2, i32* @foo.x
%3 = load i32, i32* @foo.x
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @foo.x
%6 = add nsw i32 %5, 1
store i32 %6, i32* @foo.x
ret void
}

LLVM IR (-O2):
@foo.x = internal unnamed_addr global i32 3
@.str = [4 x i8] c"%d\0A\00"
define void @foo() {
%1 = load i32, i32* @foo.x
%2 = add nsw i32 %1, 1
store i32 %2, i32* @foo.x
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @foo.x
%5 = add nsw i32 %4, 1
store i32 %5, i32* @foo.x
ret void
}
int fail_test() { return 1; }


x86 assembly (clang, -O0):
<fail_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fail_test() {
ret i32 1
}

LLVM IR (-O2):
define i32 @fail_test() {
ret i32 1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t mp2vseqx_get_frameraten(const uint8_t *p_mp2vseqx) {
  return (p_mp2vseqx[9] & 0x60) >> 5;
}


x86 assembly (clang, -O0):
<mp2vseqx_get_frameraten>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%eax
and    $0x60,%eax
sar    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseqx_get_frameraten>:
mov    0x24(%rdi),%eax
shr    $0x5,%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @mp2vseqx_get_frameraten(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 9
%5 = load i32, i32* %4
%6 = and i32 %5, 96
%7 = ashr i32 %6, 5
ret i32 %7
}

LLVM IR (-O2):
define i32 @mp2vseqx_get_frameraten(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 9
%3 = load i32, i32* %2
%4 = lshr i32 %3, 5
%5 = and i32 %4, 3
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int maxProfit(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x[] = {
      1,
      2,
  };
  printf("%d\n", maxProfit(x, sizeof(x) / sizeof(int)));
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 8589934593, i64* %1
%3 = bitcast i64* %1 to i32*
%4 = call i32 @maxProfit(i32* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_char(char);
void print_line(int n) {
  int i;
  for (i = 0; i < n; i++) {
    print_char('_');
  }
  print_char('\n');
}


x86 assembly (clang, -O0):
<print_line>:
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    1146 <print_line+0x36>
mov    $0x5f,%edi
call   1030 <print_char@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <print_line+0x12>
mov    $0xa,%edi
call   1030 <print_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @print_line(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 @print_char(i8 signext 95)
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
%14 = call i32 @print_char(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @print_line(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 @print_char(i8 signext 95)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
%9 = tail call i32 @print_char(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DbugExit(char *);
scalar_t__ malloc(unsigned int);
char *DbugMalloc(int size) {
  register char *new_malloc;
  if (!(new_malloc = (char *)malloc((unsigned int)size)))
    DbugExit("out of memory");
  return (new_malloc);
}


x86 assembly (clang, -O0):
<DbugMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114d <DbugMalloc+0x2d>
lea    0xeb8(%rip),%rdi
call   1040 <DbugExit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DbugMalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <DbugMalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <DbugExit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @DbugMalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @DbugExit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define i8* @DbugMalloc(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @DbugExit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i8*
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) { printf("usage: shell [nom_de_volume]\n"); }


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

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

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

LLVM IR (-O2):
@str = [29 x i8] c"usage: shell [nom_de_volume]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OPENSSL_strlcpy(char *, char *, size_t);
char *strerror(int);
int openssl_strerror_r(int errnum, char *buf, size_t buflen) {
  char *err;
  if (buflen < 2)
    return 0;
  err = strerror(errnum);
  if (err == NULL)
    return 0;
  OPENSSL_strlcpy(buf, err, buflen);
  return 1;
}


x86 assembly (clang, -O0):
<openssl_strerror_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x2,-0x18(%rbp)
jae    114a <openssl_strerror_r+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1185 <openssl_strerror_r+0x65>
mov    -0x8(%rbp),%edi
call   1040 <strerror@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116d <openssl_strerror_r+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1185 <openssl_strerror_r+0x65>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <OPENSSL_strlcpy@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openssl_strerror_r>:
push   %rbp
push   %r14
push   %rbx
xor    %ebp,%ebp
cmp    $0x2,%rdx
jb     114f <openssl_strerror_r+0x2f>
mov    %rdx,%rbx
mov    %rsi,%r14
call   1040 <strerror@plt>
test   %rax,%rax
je     114f <openssl_strerror_r+0x2f>
mov    %r14,%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1030 <OPENSSL_strlcpy@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @openssl_strerror_r(i32 %0, i8* %1, i64 %2) {
%4 = icmp ult i64 %2, 2
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call i8* @strerror(i32 %0)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @OPENSSL_strlcpy(i8* %1, i8* %6, i64 %2)
br label %10
10: ; preds = %5, %3, %8
%11 = phi i32 [ 1, %8 ], [ 0, %3 ], [ 0, %5 ]
ret i32 %11
}
int max2(int x, int y) {
  if (x > y) {
    return x;
  }
  return y;
}


x86 assembly (clang, -O0):
<max2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <max2+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max2+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max2>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max2(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ uint16_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
uint8_t __hsail_sat_sub_u8(uint8_t a, uint8_t b) {
  int16_t c = (uint16_t)a - (uint16_t)b;
  if (c < 0)
    return 0;
  else
    return c;
}


x86 assembly (clang, -O0):
<__hsail_sat_sub_u8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jge    1130 <__hsail_sat_sub_u8+0x30>
movq   $0x0,-0x8(%rbp)
jmp    1138 <__hsail_sat_sub_u8+0x38>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hsail_sat_sub_u8>:
xor    %eax,%eax
sub    %rsi,%rdi
cmovns %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @__hsail_sat_sub_u8(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
%4 = icmp sgt i64 %3, 0
%5 = select i1 %4, i64 %3, i64 0
ret i64 %5
}
/* Variables and functions */
double pop();
int /*<<< orphan*/ push(double);
void divide(void) {
  double divisor = pop();
  push(pop() / divisor);
}


x86 assembly (clang, -O0):
<divide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <pop@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <pop@plt>
divsd  -0x8(%rbp),%xmm0
call   1040 <push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide>:
push   %rax
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <pop@plt>
divsd  (%rsp),%xmm0
pop    %rax
jmp    1040 <push@plt>

LLVM IR (-O0):
define void @divide() {
%1 = alloca double
%2 = call double (...) @pop()
store double %2, double* %1
%3 = call double (...) @pop()
%4 = load double, double* %1
%5 = fdiv double %3, %4
%6 = call i32 @push(double %5)
ret void
}

LLVM IR (-O2):
define void @divide() {
%1 = tail call double (...) @pop()
%2 = tail call double (...) @pop()
%3 = fdiv double %2, %1
%4 = tail call i32 @push(double %3)
ret void
}
/* Variables and functions */
scalar_t__ realloc(unsigned int *, size_t);
int Libre_agregar(size_t *len, unsigned int **arr, unsigned int l) {
  (*len)++;
  *arr = (unsigned int *)realloc(*arr, (*len) * sizeof(unsigned int));
  (*arr)[(*len) - 1] = l;
  return 0;
}


x86 assembly (clang, -O0):
<Libre_agregar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
shl    $0x2,%rsi
call   1030 <realloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
sub    $0x1,%rcx
mov    %edx,(%rax,%rcx,4)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Libre_agregar>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
mov    (%rsi),%rdi
lea    0x4(,%rax,4),%rsi
call   1030 <realloc@plt>
mov    %rax,(%rbx)
mov    0x0(%rbp),%rcx
mov    %r14d,-0x4(%rax,%rcx,4)
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Libre_agregar(i64* %0, i32** %1, i32 %2) {
%4 = alloca i64*
%5 = alloca i32**
%6 = alloca i32
store i64* %0, i64** %4
store i32** %1, i32*** %5
store i32 %2, i32* %6
%7 = load i64*, i64** %4
%8 = load i64, i64* %7
%9 = add i64 %8, 1
store i64 %9, i64* %7
%10 = load i32**, i32*** %5
%11 = load i32*, i32** %10
%12 = load i64*, i64** %4
%13 = load i64, i64* %12
%14 = mul i64 %13, 4
%15 = call i64 @realloc(i32* %11, i64 %14)
%16 = inttoptr i64 %15 to i32*
%17 = load i32**, i32*** %5
store i32* %16, i32** %17
%18 = load i32, i32* %6
%19 = load i32**, i32*** %5
%20 = load i32*, i32** %19
%21 = load i64*, i64** %4
%22 = load i64, i64* %21
%23 = sub i64 %22, 1
%24 = getelementptr inbounds i32, i32* %20, i64 %23
store i32 %18, i32* %24
ret i32 0
}

LLVM IR (-O2):
define i32 @Libre_agregar(i64* nocapture %0, i32** nocapture %1, i32 %2) {
%4 = load i64, i64* %0
%5 = add i64 %4, 1
store i64 %5, i64* %0
%6 = load i32*, i32** %1
%7 = shl i64 %5, 2
%8 = tail call i64 @realloc(i32* %6, i64 %7)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %1
%10 = load i64, i64* %0
%11 = add i64 %10, -1
%12 = getelementptr inbounds i32, i32* %9, i64 %11
store i32 %2, i32* %12
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gen_Xgraph(int, int);
void IF_xytXgraph(void) { gen_Xgraph(1, 1); }


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

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

LLVM IR (-O0):
define void @IF_xytXgraph() {
%1 = call i32 @gen_Xgraph(i32 1, i32 1)
ret void
}

LLVM IR (-O2):
define void @IF_xytXgraph() {
%1 = tail call i32 @gen_Xgraph(i32 1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
void lz_int_2_leading_zero_str(char *buf, int len, int ival) {
  char fb[20], wb[20];
  sprintf(fb, "%%0%dd", len);
  sprintf(wb, fb, ival);
  memcpy(buf, wb, len);
}


x86 assembly (clang, -O0):
<lz_int_2_leading_zero_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xec0(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x10(%rbp),%edx
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lz_int_2_leading_zero_str>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x40,%rsp
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
lea    0xec6(%rip),%rsi
lea    0x20(%rsp),%r15
mov    %r15,%rdi
mov    %ebp,%edx
call   1040 <sprintf@plt>
mov    %rsp,%r12
mov    %r12,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
call   1040 <sprintf@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
call   1030 <memcpy@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%%0%dd\00"
define void @lz_int_2_leading_zero_str(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca [20 x i8]
%8 = alloca [20 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%10 = load i32, i32* %5
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%14 = load i32, i32* %6
%15 = call i32 @sprintf(i8* %12, i8* %13, i32 %14)
%16 = load i8*, i8** %4
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%18 = load i32, i32* %5
%19 = call i32 @memcpy(i8* %16, i8* %17, i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%%0%dd\00"
define void @lz_int_2_leading_zero_str(i8* %0, i32 %1, i32 %2) {
%4 = alloca [20 x i8]
%5 = alloca [20 x i8]
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%8 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1)
%9 = call i32 @sprintf(i8* %7, i8* %6, i32 %2)
%10 = call i32 @memcpy(i8* %0, i8* %7, i32 %1)
ret void
}
__attribute__((__always___)) int tlsf_fls(unsigned int word) {
  const int bit = word ? 32 - __builtin_clz(word) : 0;
  return bit - 1;
}


x86 assembly (clang, -O0):
<tlsf_fls>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1129 <tlsf_fls+0x29>
mov    -0x4(%rbp),%eax
bsr    %eax,%ecx
xor    $0x1f,%ecx
mov    $0x20,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <tlsf_fls+0x33>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <tlsf_fls+0x33>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlsf_fls>:
test   %edi,%edi
je     1108 <tlsf_fls+0x8>
bsr    %edi,%eax
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @tlsf_fls(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @llvm.ctlz.i32(i32 %7, i1 true)
%9 = sub nsw i32 32, %8
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %6
%12 = phi i32 [ %9, %6 ], [ 0, %10 ]
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
ret i32 %14
}

LLVM IR (-O2):
define i32 @tlsf_fls(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%5 = xor i32 %4, 31
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ -1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void syntax(const char *av0) {
  fprintf(stderr,
          "Syntax: %s {options} dskfile file file ...\n\n"
          "Options are:\n"
          "  -720: Write a 720k image (default)\n"
          "  -180: Write a 180k image\n"
          "  -cpmonly: Write a disc only usable by +3DOS\n"
          "  -dosonly: Write a disc only usable by PCDOS\n"
          "  -type type: Output file type (default=dsk)\n"
          "  -compress cmp: Output compression (default=none)\n"
          "  -label lbl: Set disk label (default=none)\n"
          "  -nostamps: Do not include file date stamps\n",
          av0);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [399 x i8] c"Syntax: %s {options} dskfile file file ...\0A\0AOptions are:\0A -720: Write a 720k image (default)\0A -180: Write a 180k image\0A -cpmonly: Write a disc only usable by +3DOS\0A -dosonly: Write a disc only usable by PCDOS\0A -type type: Output file type (default=dsk)\0A -compress cmp: Output compression (default=none)\0A -label lbl: Set disk label (default=none)\0A -nostamps: Do not include file date stamps\0A\00"
define void @syntax(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([399 x i8], [399 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [399 x i8] c"Syntax: %s {options} dskfile file file ...\0A\0AOptions are:\0A -720: Write a 720k image (default)\0A -180: Write a 180k image\0A -cpmonly: Write a disc only usable by +3DOS\0A -dosonly: Write a disc only usable by PCDOS\0A -type type: Output file type (default=dsk)\0A -compress cmp: Output compression (default=none)\0A -label lbl: Set disk label (default=none)\0A -nostamps: Do not include file date stamps\0A\00"
define void @syntax(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([399 x i8], [399 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
unsigned int rgb_to_pixel16(unsigned int r, unsigned int g, unsigned int b) {
  return ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);
}


x86 assembly (clang, -O0):
<rgb_to_pixel16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x3,%eax
shl    $0xb,%eax
mov    -0x8(%rbp),%ecx
shr    $0x2,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shr    $0x3,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_to_pixel16>:
and    $0xfffffff8,%edi
shl    $0x8,%edi
lea    0x0(,%rsi,8),%eax
and    $0xffffffe0,%eax
or     %edi,%eax
shr    $0x3,%edx
or     %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @rgb_to_pixel16(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 8
%5 = and i32 %4, -2048
%6 = shl i32 %1, 3
%7 = and i32 %6, -32
%8 = or i32 %7, %5
%9 = lshr i32 %2, 3
%10 = or i32 %8, %9
ret i32 %10
}
char *lindex(s, limit, c)
register char *s, *limit;
int c;
{
  while (s < limit)
    if (*s++ == c)
      return s - 1;
  return 0;
}


x86 assembly (clang, -O0):
<lindex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    114e <lindex+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    -0x1c(%rbp),%eax
jne    1149 <lindex+0x49>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <lindex+0x56>
jmp    110f <lindex+0xf>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lindex>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %rsi,%rdi
jae    1127 <lindex+0x27>
movsbl (%rdi),%ecx
add    $0x1,%rdi
cmp    %edx,%ecx
jne    1110 <lindex+0x10>
add    $0xffffffffffffffff,%rdi
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @lindex(i8* %0, i8* readnone %1, i32 %2) {
br label %4
4: ; preds = %7, %3
%5 = phi i8* [ %0, %3 ], [ %8, %7 ]
%6 = icmp ult i8* %5, %1
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, %2
br i1 %11, label %12, label %4
12: ; preds = %4, %7
%13 = phi i8* [ %5, %7 ], [ null, %4 ]
ret i8* %13
}
unsigned int assemble_12(x, y)
unsigned int x, y;
{
  return (
      (((((y & (~((-1) << 1))) << 1) |
         (((x) >> (31 - (10)) & ((1 << ((10) - (10) + 1)) - 1)) &
          (~((-1) << 1)))) &
        (~((-1) << 2)))
       << 9) |
      (((x) >> (31 - (9)) & ((1 << ((9) - (0) + 1)) - 1)) & (~((-1) << 9))));
}


x86 assembly (clang, -O0):
<assemble_12>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
shr    $0x15,%ecx
and    $0x1,%ecx
and    $0x1,%ecx
or     %ecx,%eax
and    $0x3,%eax
shl    $0x9,%eax
mov    -0x4(%rbp),%ecx
shr    $0x16,%ecx
and    $0x3ff,%ecx
and    $0x1ff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<assemble_12>:
and    $0x1,%esi
mov    %edi,%eax
shr    $0x15,%eax
and    $0x1,%eax
lea    (%rax,%rsi,2),%eax
shl    $0x9,%eax
shr    $0x16,%edi
and    $0x1ff,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @assemble_12(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 1
%7 = shl i32 %6, 1
%8 = load i32, i32* %3
%9 = lshr i32 %8, 21
%10 = and i32 %9, 1
%11 = and i32 %10, 1
%12 = or i32 %7, %11
%13 = and i32 %12, 3
%14 = shl i32 %13, 9
%15 = load i32, i32* %3
%16 = lshr i32 %15, 22
%17 = and i32 %16, 1023
%18 = and i32 %17, 511
%19 = or i32 %14, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @assemble_12(i32 %0, i32 %1) {
%3 = shl i32 %1, 1
%4 = and i32 %3, 2
%5 = lshr i32 %0, 21
%6 = and i32 %5, 1
%7 = or i32 %4, %6
%8 = shl nuw nsw i32 %7, 9
%9 = lshr i32 %0, 22
%10 = and i32 %9, 511
%11 = or i32 %8, %10
ret i32 %11
}
double compute_BMI(double weight, int height) {
  double value = 0.0;
  value = (weight / (height * height)) * 703;
  return value;
}


x86 assembly (clang, -O0):
<compute_BMI>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  0xed0(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_BMI>:
imul   %edi,%edi
cvtsi2sd %edi,%xmm1
divsd  %xmm1,%xmm0
mulsd  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
define double @compute_BMI(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
store double 0.000000e+00, double* %5
%6 = load double, double* %3
%7 = load i32, i32* %4
%8 = load i32, i32* %4
%9 = mul nsw i32 %7, %8
%10 = sitofp i32 %9 to double
%11 = fdiv double %6, %10
%12 = fmul double %11, 7.030000e+02
store double %12, double* %5
%13 = load double, double* %5
ret double %13
}

LLVM IR (-O2):
define double @compute_BMI(double %0, i32 %1) {
%3 = mul nsw i32 %1, %1
%4 = sitofp i32 %3 to double
%5 = fdiv double %0, %4
%6 = fmul double %5, 7.030000e+02
ret double %6
}
int com_nrating(int p0, struct parameter *param) {
  (void)(p0);
  (void)(param);
  return 0;
}


x86 assembly (clang, -O0):
<com_nrating>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.parameter = type opaque
define i32 @com_nrating(i32 %0, %struct.parameter* %1) {
%3 = alloca i32
%4 = alloca %struct.parameter*
store i32 %0, i32* %3
store %struct.parameter* %1, %struct.parameter** %4
%5 = load i32, i32* %3
%6 = load %struct.parameter*, %struct.parameter** %4
ret i32 0
}

LLVM IR (-O2):
%struct.parameter = type opaque
define i32 @com_nrating(i32 %0, %struct.parameter* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *, char const *);
void panic(const char *s) {
  printk("Kernel panic: %s\n", s);
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printk@plt>
jmp    112c <panic+0x1c>

x86 assembly (clang, -O2):
<panic>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printk@plt>
jmp    1120 <panic+0x10>

LLVM IR (-O0):
@.str = [18 x i8] c"Kernel panic: %s\0A\00"
define void @panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printk(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %5
5: ; preds = %5, %1
br label %5
}

LLVM IR (-O2):
@.str = [18 x i8] c"Kernel panic: %s\0A\00"
define void @panic(i8* %0) {
%2 = tail call i32 @printk(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %3
3: ; preds = %3, %1
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void waste_time(int seconds) { sleep(seconds); }


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

x86 assembly (clang, -O2):
<waste_time>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define void @waste_time(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}