xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int do_char(int cur_first_index, char *readbuf) {
  printf("%c,", readbuf[cur_first_index + 1]);
  return (cur_first_index + 3);
}


x86 assembly (clang, -O0):
<do_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
lea    0xecd(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x3,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_char>:
push   %rbx
movslq %edi,%rbx
movsbl 0x1(%rbx,%rsi,1),%esi
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
add    $0x3,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%c,\00"
define i32 @do_char(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 = load i32, i32* %3
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %10)
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 3
ret i32 %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c,\00"
define i32 @do_char(i32 %0, i8* nocapture %1) {
%3 = add nsw i32 %0, 1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %6)
%8 = add nsw i32 %0, 3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *m_strdup(char const *, int (*)(char));
int set_val(char **p, const char *val, int (*match)(char)) {
  char *t = m_strdup(val, match);
  if (!t)
    return -1;
  if (*p)
    free(*p);
  *p = t;
  return 0;
}


x86 assembly (clang, -O0):
<set_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <m_strdup@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    115c <set_val+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1188 <set_val+0x68>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1176 <set_val+0x56>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_val>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <m_strdup@plt>
test   %rax,%rax
je     114e <set_val+0x2e>
mov    %rax,%rbx
mov    (%r14),%rdi
test   %rdi,%rdi
je     1147 <set_val+0x27>
call   1030 <free@plt>
mov    %rbx,(%r14)
xor    %eax,%eax
jmp    1153 <set_val+0x33>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @set_val(i8** nocapture %0, i8* %1, i32 (i8)* %2) {
%4 = tail call i8* @m_strdup(i8* %1, i32 (i8)* %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = load i8*, i8** %0
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @free(i8* %7)
br label %11
11: ; preds = %9, %6
store i8* %4, i8** %0
br label %12
12: ; preds = %3, %11
%13 = phi i32 [ 0, %11 ], [ -1, %3 ]
ret i32 %13
}
/* Type definitions */
typedef int uint16_t;
typedef int int16_t;

/* Variables and functions */
void get_i16(const unsigned char *buf, int16_t *ip) {
  uint16_t b, u = 0;
  int i;
  for (i = 0; i < 2; i++) {
    b = buf[i];
    u <<= 8;
    u |= b;
  }
  *ip = u;
}


x86 assembly (clang, -O0):
<get_i16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2,-0x1c(%rbp)
jge    1153 <get_i16+0x53>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111a <get_i16+0x1a>
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_i16>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @get_i16(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %4, 8
%9 = or i32 %8, %7
store i32 %9, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t get_seq_num(char *buffer) {
  uint16_t *seq = (uint16_t *)(buffer + 1);
  return ntohs(*seq);
}


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

x86 assembly (clang, -O2):
<get_seq_num>:
mov    0x1(%rdi),%edi
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
define i32 @get_seq_num(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = call i32 @ntohs(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_seq_num(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @ntohs(i32 %4)
ret i32 %5
}
void tok_fin(int c, char **pv) {
  int i;
  for (i = 0; i < c; i++)
    free(pv[i]);
  free(pv);
}


x86 assembly (clang, -O0):
<tok_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <tok_fin+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <tok_fin+0x16>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tok_fin>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
test   %edi,%edi
jle    1142 <tok_fin+0x32>
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <tok_fin+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @tok_fin(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %1 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _unsupported();
void pthread_testcancel() { _unsupported(); }


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

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

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

LLVM IR (-O2):
define void @pthread_testcancel() {
%1 = tail call i32 (...) @_unsupported()
ret void
}
/* Variables and functions */
int sv_play_from_beginning(int);
int vox_play_from_beginning(int slot) { return sv_play_from_beginning(slot); }


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

x86 assembly (clang, -O2):
<vox_play_from_beginning>:
jmp    1030 <sv_play_from_beginning@plt>

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

LLVM IR (-O2):
define i32 @vox_play_from_beginning(i32 %0) {
%2 = tail call i32 @sv_play_from_beginning(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int little_endian_read_16(int /*<<< orphan*/ const *, int);
int sdp_event_query_attribute_value_get_attribute_length(const uint8_t *event) {
  return little_endian_read_16(event, 6);
}


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

x86 assembly (clang, -O2):
<sdp_event_query_attribute_value_get_attribute_length>:
mov    $0x6,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @sdp_event_query_attribute_value_get_attribute_length(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 6)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int /*<<< orphan*/ stub1(int);
int /*<<< orphan*/ stub2(int);
int /*<<< orphan*/ stub3(int);
int /*<<< orphan*/ stub4(int);
int /*<<< orphan*/ stub5(int);
int /*<<< orphan*/ stub6(int);
int /*<<< orphan*/ stub7(int);
int /*<<< orphan*/ stub8(int);
int main(void) {
  foo(1);
  (*foo)(2);
  (**foo)(3);
  (***foo)(4);
  (****foo)(5);
  (***&foo)(6);
  (**&foo)(7);
  (*&foo)(8);
  (&foo)(9);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <foo@plt>
mov    $0x2,%edi
call   1030 <foo@plt>
mov    $0x3,%edi
call   1030 <foo@plt>
mov    $0x4,%edi
call   1030 <foo@plt>
mov    $0x5,%edi
call   1030 <foo@plt>
mov    $0x6,%edi
call   1030 <foo@plt>
mov    $0x7,%edi
call   1030 <foo@plt>
mov    $0x8,%edi
call   1030 <foo@plt>
mov    $0x9,%edi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <foo@plt>
mov    $0x2,%edi
call   1030 <foo@plt>
mov    $0x3,%edi
call   1030 <foo@plt>
mov    $0x4,%edi
call   1030 <foo@plt>
mov    $0x5,%edi
call   1030 <foo@plt>
mov    $0x6,%edi
call   1030 <foo@plt>
mov    $0x7,%edi
call   1030 <foo@plt>
mov    $0x8,%edi
call   1030 <foo@plt>
mov    $0x9,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1)
%2 = tail call i32 @foo(i32 2)
%3 = tail call i32 @foo(i32 3)
%4 = tail call i32 @foo(i32 4)
%5 = tail call i32 @foo(i32 5)
%6 = tail call i32 @foo(i32 6)
%7 = tail call i32 @foo(i32 7)
%8 = tail call i32 @foo(i32 8)
%9 = tail call i32 @foo(i32 9)
ret i32 0
}
__attribute__((always_)) int __check_is_bitmap(const unsigned long *bitmap) {
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @__check_is_bitmap(i64* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Calc_Time(int *, int *, int *, int);
int ceil(float);
int Calc_T3(int Size, int *Days, int *Hrs, int *Mins) {
  int Total_Time = 0;
  Total_Time = ceil(((float)Size * 8) / (45 * 60));
  Calc_Time(Days, Hrs, Mins, Total_Time);
  return Total_Time;
}


x86 assembly (clang, -O0):
<Calc_T3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  0xeb9(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xea9(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <ceil@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1040 <Calc_Time@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Calc_T3>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
cvtsi2ss %edi,%xmm0
mulss  0xec4(%rip),%xmm0
divss  0xec0(%rip),%xmm0
call   1030 <ceil@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
call   1040 <Calc_Time@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Calc_T3(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
store i32 0, i32* %9
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to float
%12 = fmul float %11, 8.000000e+00
%13 = fdiv float %12, 2.700000e+03
%14 = call i32 @ceil(float %13)
store i32 %14, i32* %9
%15 = load i32*, i32** %6
%16 = load i32*, i32** %7
%17 = load i32*, i32** %8
%18 = load i32, i32* %9
%19 = call i32 @Calc_Time(i32* %15, i32* %16, i32* %17, i32 %18)
%20 = load i32, i32* %9
ret i32 %20
}

LLVM IR (-O2):
define i32 @Calc_T3(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = sitofp i32 %0 to float
%6 = fmul float %5, 8.000000e+00
%7 = fdiv float %6, 2.700000e+03
%8 = tail call i32 @ceil(float %7)
%9 = tail call i32 @Calc_Time(i32* %1, i32* %2, i32* %3, i32 %8)
ret i32 %8
}
int main() {
  int a;
  int *pa;
  int b;
  int *pb;
  pa = &a;
  pb = &b;
  a = 2;
  b = 3;
  int c;
  int *pc;
  pc = &c;
  *pc = *pa + *pb;
  return c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0x14(%rbp)
lea    -0x24(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
add    (%rax),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
void dtree_printd(int level, const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @dtree_printd(i32 %0, i8* nocapture %1, ...) {
ret void
}
void foo184(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo184(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ callee(int, int, int, int, int, int, int);
main() {
  callee(1, 2, 3, 4, 5, 6, 7);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
movl   $0x7,(%rsp)
call   1030 <callee@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x7,(%rsp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
call   1030 <callee@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @callee(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7)
ret i32 0
}
int get_wkyr(int wday_start, int tm_wday, int tm_yday) {
  tm_wday = (tm_wday + 7 - wday_start) % 7;
  return (tm_yday - tm_wday + 12) / 7 - 1;
}


x86 assembly (clang, -O0):
<get_wkyr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x7,%eax
sub    -0x4(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
add    $0xc,%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_wkyr>:
sub    %edi,%esi
mov    %esi,%eax
add    $0x7,%eax
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %esi,%ecx
add    $0x7,%ecx
mov    %ecx,%esi
shr    $0x1f,%esi
sar    $0x2,%ecx
add    %esi,%ecx
lea    0x0(,%rcx,8),%esi
sub    %ecx,%esi
sub    %eax,%esi
lea    (%rdx,%rsi,1),%eax
add    $0xc,%eax
add    %edx,%esi
cltq
imul   $0xffffffff92492493,%rax,%rax
shr    $0x20,%rax
add    %esi,%eax
add    $0xc,%eax
mov    %eax,%ecx
sar    $0x2,%ecx
shr    $0x1f,%eax
add    %ecx,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @get_wkyr(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* %5
%8 = add nsw i32 %7, 7
%9 = load i32, i32* %4
%10 = sub nsw i32 %8, %9
%11 = srem i32 %10, 7
store i32 %11, i32* %5
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = sub nsw i32 %12, %13
%15 = add nsw i32 %14, 12
%16 = sdiv i32 %15, 7
%17 = sub nsw i32 %16, 1
ret i32 %17
}

LLVM IR (-O2):
define i32 @get_wkyr(i32 %0, i32 %1, i32 %2) {
%4 = sub i32 7, %0
%5 = add i32 %4, %1
%6 = srem i32 %5, 7
%7 = add i32 %2, 12
%8 = sub i32 %7, %6
%9 = sdiv i32 %8, 7
%10 = add nsw i32 %9, -1
ret i32 %10
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn86() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn86");
  return result;
}


x86 assembly (clang, -O0):
<fn86>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn86>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn86\00"
define i8* @fn86() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn86\00"
define i8* @fn86() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
void maximize(double *dest, double src) {
  if (src > *dest)
    *dest = src;
}


x86 assembly (clang, -O0):
<maximize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    112d <maximize+0x2d>
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<maximize>:
ucomisd (%rdi),%xmm0
jbe    110a <maximize+0xa>
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @maximize(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double*, double** %3
%7 = load double, double* %6
%8 = fcmp ogt double %5, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load double, double* %4
%11 = load double*, double** %3
store double %10, double* %11
br label %12
12: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @maximize(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp olt double %3, %1
br i1 %4, label %5, label %6
5: ; preds = %2
store double %1, double* %0
br label %6
6: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(float *);
scalar_t__ malloc(int);
float *fvector(int minx, int maxx) {
  float *m;
  m = (float *)malloc((maxx - minx + 1) * sizeof(float));
  assert(m);
  m -= minx;
  return m;
}


x86 assembly (clang, -O0):
<fvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fvector>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
sub    %edi,%esi
lea    0x4(,%rsi,4),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
movslq %ebp,%rax
shl    $0x2,%rax
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define float* @fvector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to float*
store float* %14, float** %5
%15 = load float*, float** %5
%16 = call i32 @assert(float* %15)
%17 = load i32, i32* %3
%18 = load float*, float** %5
%19 = sext i32 %17 to i64
%20 = sub i64 0, %19
%21 = getelementptr inbounds float, float* %18, i64 %20
store float* %21, float** %5
%22 = load float*, float** %5
ret float* %22
}

LLVM IR (-O2):
define float* @fvector(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = shl i32 %3, 2
%5 = add i32 %4, 4
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to float*
%8 = tail call i32 @assert(float* %7)
%9 = sext i32 %0 to i64
%10 = sub nsw i64 0, %9
%11 = getelementptr inbounds float, float* %7, i64 %10
ret float* %11
}
/* Variables and functions */
int rand();
int para_at() {
  int atis_sonucu;
  atis_sonucu = rand() % 2;
  return atis_sonucu;
}


x86 assembly (clang, -O0):
<para_at>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<para_at>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @para_at() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 2
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @para_at() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 2
ret i32 %2
}
void INT_Excep_PERIB_INTB133(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB133() {
ret void
}
/* Variables and functions */
int cosh(double);
double sech(double n) {
  if (cosh(n) == 0) {
    return 0. / 0.;
  }
  return 1 / cosh(n);
}


x86 assembly (clang, -O0):
<sech>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <cosh@plt>
cmp    $0x0,%eax
jne    1142 <sech+0x32>
movsd  0xec8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <sech+0x4f>
movsd  -0x10(%rbp),%xmm0
call   1030 <cosh@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sech>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <cosh@plt>
test   %eax,%eax
je     113d <sech+0x2d>
movsd  (%rsp),%xmm0
call   1030 <cosh@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret
movsd  0xebb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sech(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call i32 @cosh(double %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store double 0x7FF8000000000000, double* %2
br label %13
8: ; preds = %1
%9 = load double, double* %3
%10 = call i32 @cosh(double %9)
%11 = sdiv i32 1, %10
%12 = sitofp i32 %11 to double
store double %12, double* %2
br label %13
13: ; preds = %8, %7
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @sech(double %0) {
%2 = tail call i32 @cosh(double %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = tail call i32 @cosh(double %0)
%6 = add i32 %5, 1
%7 = icmp ult i32 %6, 3
%8 = select i1 %7, i32 %5, i32 0
%9 = sitofp i32 %8 to double
br label %10
10: ; preds = %1, %4
%11 = phi double [ %9, %4 ], [ 0x7FF8000000000000, %1 ]
ret double %11
}
void abcdefghijklmnopqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @abcdefghijklmnopqrstuvwxzy() {
ret void
}
unsigned int GPMCErrSysCmdGet(unsigned int baseAddr) {
  unsigned int cmd;
  cmd = (((*((volatile unsigned int *)(baseAddr + (0x48)))) & (0x00000700u)) >>
         (0x00000008u));
  return (cmd);
}


x86 assembly (clang, -O0):
<GPMCErrSysCmdGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x48,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x700,%eax
shr    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCErrSysCmdGet>:
add    $0x48,%edi
mov    (%rdi),%eax
shr    $0x8,%eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @GPMCErrSysCmdGet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 72
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 1792
%10 = lshr i32 %9, 8
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @GPMCErrSysCmdGet(i32 %0) {
%2 = add i32 %0, 72
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = lshr i32 %5, 8
%7 = and i32 %6, 7
ret i32 %7
}
unsigned int makeOperand(char c, unsigned int operand) {
  return (operand * 10) + (c - '0');
}


x86 assembly (clang, -O0):
<makeOperand>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0xa,-0x8(%rbp),%eax
movsbl -0x1(%rbp),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeOperand>:
lea    (%rsi,%rsi,4),%eax
lea    (%rdi,%rax,2),%eax
add    $0xffffffd0,%eax
ret

LLVM IR (-O0):
define i32 @makeOperand(i8 signext %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 = mul i32 %5, 10
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 48
%10 = add i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @makeOperand(i8 signext %0, i32 %1) {
%3 = mul i32 %1, 10
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -48
%6 = add i32 %5, %3
ret i32 %6
}
int main(void) {
  void concat(char result[], const char str1[], const char str2[]);
  const char s1[] = {"Test "};
  const char s2[] = {"works."};
  char s3[20];
  concat(s3, s1, s2);
  printf("%s\n", s3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xebd(%rip),%eax
mov    %eax,-0x11(%rbp)
mov    0xeb7(%rip),%ax
mov    %ax,-0xd(%rbp)
mov    0xeaf(%rip),%al
mov    %al,-0xb(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0xa(%rbp),%rsi
lea    -0x11(%rbp),%rdx
call   1040 <concat@plt>
lea    -0x30(%rbp),%rsi
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movw   $0x20,0x4(%rsp)
movl   $0x74736554,(%rsp)
movl   $0x2e736b,0xb(%rsp)
movl   $0x6b726f77,0x8(%rsp)
6b
lea    0x10(%rsp),%rbx
mov    %rsp,%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <concat@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s1 = [6 x i8] c"Test \00"
@__const.main.s2 = [7 x i8] c"works.\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca [7 x i8]
%4 = alloca [20 x i8]
store i32 0, i32* %1
%5 = bitcast [6 x i8]* %2 to i8*
%6 = bitcast [7 x i8]* %3 to i8*
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [6 x i8] c"Test \00"
@__const.main.s2 = [7 x i8] c"works.\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [7 x i8]
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%7 = call i32 @puts(i8* %6)
ret i32 0
}
/* Variables and functions */
int write(unsigned long, void const *, unsigned long);
int OS_file_write(unsigned long file_handle, const void *p_data,
                  unsigned long length) {
  if (-1 == write(file_handle, p_data, length))
    return 0x1004;
  return 0;
}


x86 assembly (clang, -O0):
<OS_file_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <write@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1150 <OS_file_write+0x40>
movl   $0x1004,-0x4(%rbp)
jmp    1157 <OS_file_write+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OS_file_write>:
push   %rax
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
mov    $0x1004,%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @OS_file_write(i64 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i64
store i64 %0, i64* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load i64, i64* %5
%9 = load i8*, i8** %6
%10 = load i64, i64* %7
%11 = call i32 @write(i64 %8, i8* %9, i64 %10)
%12 = icmp eq i32 -1, %11
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 4100, i32* %4
br label %15
14: ; preds = %3
store i32 0, i32* %4
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
define i32 @OS_file_write(i64 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i64 %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, -1
%6 = select i1 %5, i32 4100, i32 0
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(int /*<<< orphan*/ const *, int, int,
                          int /*<<< orphan*/ *);
void serialize_uint32(FILE *out, const uint32_t x) {
  assert(fwrite(&x, sizeof(uint32_t), 1, out));
}


x86 assembly (clang, -O0):
<serialize_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    %eax,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialize_uint32>:
push   %rax
mov    %rdi,%rcx
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @serialize_uint32(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 = call i32 @fwrite(i32* %4, i32 4, i32 1, i32* %5)
%7 = call i32 @assert(i32 %6)
ret void
}

LLVM IR (-O2):
define void @serialize_uint32(i32* nocapture %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %0)
%5 = tail call i32 @assert(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doTest(char **, int, char *);
void tests() {
  char *d1[7] = {"NORTH", "SOUTH", "SOUTH", "EAST", "WEST", "NORTH", "WEST"};
  doTest(d1, 7, "{WEST}");
}


x86 assembly (clang, -O0):
<tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0x2cad(%rip),%rsi
mov    $0x38,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0x7,%esi
lea    0xec9(%rip),%rdx
call   1030 <doTest@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tests>:
sub    $0x38,%rsp
mov    0x2cf5(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0x2cd9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0x2cbd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2ca1(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xecc(%rip),%rdx
mov    %rsp,%rdi
mov    $0x7,%esi
call   1030 <doTest@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"NORTH\00"
@.str.1 = [6 x i8] c"SOUTH\00"
@.str.2 = [5 x i8] c"EAST\00"
@.str.3 = [5 x i8] c"WEST\00"
@__const.tests.d1 = [7 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0)]
@.str.4 = [7 x i8] c"{WEST}\00"
define void @tests() {
%1 = alloca [7 x i8*]
%2 = bitcast [7 x i8*]* %1 to i8*
%3 = getelementptr inbounds [7 x i8*], [7 x i8*]* %1, i64 0, i64 0
%4 = call i32 @doTest(i8** %3, i32 7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"NORTH\00"
@.str.1 = [6 x i8] c"SOUTH\00"
@.str.2 = [5 x i8] c"EAST\00"
@.str.3 = [5 x i8] c"WEST\00"
@__const.tests.d1 = [7 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0)]
@.str.4 = [7 x i8] c"{WEST}\00"
define void @tests() {
%1 = alloca [7 x i8*]
%2 = bitcast [7 x i8*]* %1 to i8*
%3 = getelementptr inbounds [7 x i8*], [7 x i8*]* %1, i64 0, i64 0
%4 = call i32 @doTest(i8** %3, i32 7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ execlp(char *, char *, char *);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ setns(int, int /*<<< orphan*/);
int child(void *arg) {
  int fd;
  fd = open((char *)arg, O_RDONLY);
  setns(fd, 0);
  execlp("bash", "bash", (char *)NULL);
  return 0;
}


x86 assembly (clang, -O0):
<child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   1030 <setns@plt>
lea    0xe9e(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    %rsi,%rdi
call   1050 <execlp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <setns@plt>
lea    0xeb1(%rip),%rdi
mov    %rdi,%rsi
xor    %edx,%edx
call   1050 <execlp@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
@.str = [5 x i8] c"bash\00"
define i32 @child(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDONLY
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @setns(i32 %7, i32 0)
%9 = call i32 @execlp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* null)
ret i32 0
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@.str = [5 x i8] c"bash\00"
define i32 @child(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = tail call i32 @setns(i32 %3, i32 0)
%5 = tail call i32 @execlp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* null)
ret i32 0
}
void gtk_scale_get_digits() {}


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

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

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

LLVM IR (-O2):
define void @gtk_scale_get_digits() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
void unlink(char *f) {
  remove(f);
  return;
}


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

x86 assembly (clang, -O2):
<unlink>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define void @unlink(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret void
}
void free_2darray_l(long int **array, int x) {
  int i;
  for (i = 0; i < x; i++)
    free(array[i]);
  free(array);
}


x86 assembly (clang, -O0):
<free_2darray_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_2darray_l+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_2darray_l+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_2darray_l>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_2darray_l+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_2darray_l+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_2darray_l(i64** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i64*, i64** %0, i64 %7
%9 = bitcast i64** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i64** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
__attribute__((__const__)) bool utf8_is_surrogate(int c) {
  return c >= 0xD800 && c <= 0xDFFF;
}


x86 assembly (clang, -O0):
<utf8_is_surrogate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xd800,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <utf8_is_surrogate+0x26>
cmpl   $0xdfff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_is_surrogate>:
and    $0xfffff800,%edi
xor    %eax,%eax
cmp    $0xd800,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @utf8_is_surrogate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 55296
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57343
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 @utf8_is_surrogate(i32 %0) {
%2 = and i32 %0, -2048
%3 = icmp eq i32 %2, 55296
%4 = zext i1 %3 to i32
ret i32 %4
}