xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int usage() {
  printf("./tcp_connect -p [port_range] -a [ipaddr] [-d] [-c] [-6]\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [58 x i8] c"./tcp_connect -p [port_range] -a [ipaddr] [-d] [-c] [-6]\0A\00"
define i32 @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [57 x i8] c"./tcp_connect -p [port_range] -a [ipaddr] [-d] [-c] [-6]\00"
define i32 @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void foo109(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo109(i32 %0) {
ret void
}
void test_assert() {
  (__builtin_expect(!(0 && "unreachable"), 0)
       ? __myassert_rtn(
             __func__,
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/fanfuqiang/iec_old/refs/heads/master/"
             "clang-3.2.src/test/Sema/warn-unreachable.c",
             124, "0 && \"unreachable\"")
       : (void)0);
  return;
}


x86 assembly (clang, -O0):
<test_assert>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeea(%rip),%rsi
mov    $0x7c,%edx
lea    0xf88(%rip),%rcx
mov    $0x0,%al
call   1030 <__myassert_rtn@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assert>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xf91(%rip),%rcx
mov    $0x7c,%edx
xor    %eax,%eax
jmp    1030 <__myassert_rtn@plt>

LLVM IR (-O0):
@__func__.test_assert = [12 x i8] c"test_assert\00"
@.str = [170 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fanfuqiang/iec_old/refs/heads/master/clang-3.2.src/test/Sema/warn-unreachable.c\00"
@.str.1 = [19 x i8] c"0 && \22unreachable\22\00"
define void @test_assert() {
%1 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__myassert_rtn to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.test_assert, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 124, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.test_assert = [12 x i8] c"test_assert\00"
@.str = [170 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fanfuqiang/iec_old/refs/heads/master/clang-3.2.src/test/Sema/warn-unreachable.c\00"
@.str.1 = [19 x i8] c"0 && \22unreachable\22\00"
define void @test_assert() {
%1 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__myassert_rtn to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.test_assert, i64 0, i64 0), i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 124, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arrangeCoins(int, long *);
int main() {
  long int balance[5] = {1000, 2, 3, 17, 50};
  long *p;
  p = balance;
  arrangeCoins(4, p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
movq   $0x3e8,-0x30(%rbp)
movq   $0x2,-0x28(%rbp)
movq   $0x3,-0x20(%rbp)
movq   $0x11,-0x18(%rbp)
movq   $0x32,-0x10(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
mov    $0x4,%edi
call   1040 <arrangeCoins@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xeea(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movq   $0x32,0x20(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
call   1030 <arrangeCoins@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i64]
%3 = alloca i64*
store i32 0, i32* %1
%4 = bitcast [5 x i64]* %2 to i8*
%5 = bitcast i8* %4 to [5 x i64]*
%6 = getelementptr inbounds [5 x i64], [5 x i64]* %5, i32 0, i32 0
store i64 1000, i64* %6
%7 = getelementptr inbounds [5 x i64], [5 x i64]* %5, i32 0, i32 1
store i64 2, i64* %7
%8 = getelementptr inbounds [5 x i64], [5 x i64]* %5, i32 0, i32 2
store i64 3, i64* %8
%9 = getelementptr inbounds [5 x i64], [5 x i64]* %5, i32 0, i32 3
store i64 17, i64* %9
%10 = getelementptr inbounds [5 x i64], [5 x i64]* %5, i32 0, i32 4
store i64 50, i64* %10
%11 = getelementptr inbounds [5 x i64], [5 x i64]* %2, i64 0, i64 0
store i64* %11, i64** %3
%12 = load i64*, i64** %3
%13 = call i32 @arrangeCoins(i32 4, i64* %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [5 x i64]
%2 = bitcast [5 x i64]* %1 to i8*
%3 = getelementptr inbounds [5 x i64], [5 x i64]* %1, i64 0, i64 0
%4 = bitcast [5 x i64]* %1 to <2 x i64>*
store <2 x i64> <i64 1000, i64 2>, <2 x i64>* %4
%5 = getelementptr inbounds [5 x i64], [5 x i64]* %1, i64 0, i64 2
%6 = bitcast i64* %5 to <2 x i64>*
store <2 x i64> <i64 3, i64 17>, <2 x i64>* %6
%7 = getelementptr inbounds [5 x i64], [5 x i64]* %1, i64 0, i64 4
store i64 50, i64* %7
%8 = call i32 @arrangeCoins(i32 4, i64* %3)
ret i32 0
}
void INT_Excep_RSCAN_RXFINT(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RSCAN_RXFINT() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void print_usage(const char *name) {
  fprintf(stderr,
          "Usage: %s [-d] [-r] [-v] [-w workers] [-o logfile] <files>\n", name);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [60 x i8] c"Usage: %s [-d] [-r] [-v] [-w workers] [-o logfile] <files>\0A\00"
define void @print_usage(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 ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [60 x i8] c"Usage: %s [-d] [-r] [-v] [-w workers] [-o logfile] <files>\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ cmp(int /*<<< orphan*/);
scalar_t__ rand();
void rand_int_add() {
  int rounds;
  uint64_t vali = 0;
  for (rounds = 0; rounds < 10000; ++rounds) {
    cmp(vali);
    vali += rand();
  }
}


x86 assembly (clang, -O0):
<rand_int_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jge    116d <rand_int_add+0x4d>
mov    -0x8(%rbp),%edi
call   1030 <cmp@plt>
mov    $0x0,%al
call   1040 <rand@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <rand_int_add+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_int_add>:
push   %rbp
push   %rbx
push   %rax
mov    $0x2710,%ebp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <cmp@plt>
xor    %eax,%eax
call   1040 <rand@plt>
add    %ebx,%eax
mov    %eax,%ebx
add    $0xffffffff,%ebp
jne    1130 <rand_int_add+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @rand_int_add() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %1
br label %3
3: ; preds = %14, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 10000
br i1 %5, label %6, label %17
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @cmp(i32 %7)
%9 = call i64 (...) @rand()
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = add nsw i64 %11, %9
%13 = trunc i64 %12 to i32
store i32 %13, i32* %2
br label %14
14: ; preds = %6
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %3
17: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @rand_int_add() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = phi i32 [ 0, %0 ], [ %8, %1 ]
%4 = tail call i32 @cmp(i32 %2)
%5 = tail call i64 (...) @rand()
%6 = trunc i64 %5 to i32
%7 = add i32 %2, %6
%8 = add nuw nsw i32 %3, 1
%9 = icmp eq i32 %8, 10000
br i1 %9, label %10, label %1
10: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpge_ss(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_cmpge_ss(__m128 __a, __m128 __b) {
  return _mm_cmpge_ss(__a, __b);
}


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

x86 assembly (clang, -O2):
<test_mm_cmpge_ss>:
jmp    1030 <_mm_cmpge_ss@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpge_ss(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpge_ss(i32 %0, i32 %1)
ret i32 %3
}
double null_area(double x) {
  (void)x;
  return 0.0;
}


x86 assembly (clang, -O0):
<null_area>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<null_area>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @null_area(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @null_area(double %0) {
ret double 0.000000e+00
}
/* Variables and functions */
bool isempty(const char *s) { return !s || !s[0]; }


x86 assembly (clang, -O0):
<isempty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1127 <isempty+0x27>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isempty>:
test   %rdi,%rdi
je     110e <isempty+0xe>
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isempty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %5, %1
%12 = phi i1 [ true, %1 ], [ %10, %5 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @isempty(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
int ft_isalpha(char c) {
  return (('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z'));
}


x86 assembly (clang, -O0):
<ft_isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     112d <ft_isalpha+0x2d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    1156 <ft_isalpha+0x56>
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x61,%ecx
cmp    %edx,%ecx
mov    %al,-0x3(%rbp)
jg     1150 <ft_isalpha+0x50>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalpha>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isalpha(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 65, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 97, %12
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 122
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @ft_isalpha(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int ack(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d", ack(3, 10));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @ack(i32 3, i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void ap_list_deinit(struct hostapd_iface *iface) {}


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

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

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

LLVM IR (-O2):
%struct.hostapd_iface = type opaque
define void @ap_list_deinit(%struct.hostapd_iface* nocapture %0) {
ret void
}
unsigned char *forward_tcompressed_word(begin, end, delim, len, outtail, flags)
unsigned char *begin, *end, *delim;
int len, outtail, flags;
{ return begin; }


x86 assembly (clang, -O0):
<forward_tcompressed_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @forward_tcompressed_word(i8* readnone returned %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3, i32 %4, i32 %5) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
int main() {
  void *one = malloc(20);
  void *two = malloc(20);
  free(two);
  free(one);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
%2 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
%3 = tail call i32 @free(i8* %2)
%4 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void ErrorMsg(char *function, char *message) {
  printf("\nError in function %s\n", function);
  printf("\t %s\n", message);
  printf("The program will terminate.\n\n");
}


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

x86 assembly (clang, -O2):
<ErrorMsg>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedb(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"\0AError in function %s\0A\00"
@.str.1 = [6 x i8] c"\09 %s\0A\00"
@.str.2 = [30 x i8] c"The program will terminate.\0A\0A\00"
define void @ErrorMsg(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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0AError in function %s\0A\00"
@.str.1 = [6 x i8] c"\09 %s\0A\00"
@str = [29 x i8] c"The program will terminate.\0A\00"
define void @ErrorMsg(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
int toupper(int c) { return c & ~(((unsigned)c - 'a' < 26) << 5); }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x61,%ecx
cmp    $0x1a,%ecx
setb   %cl
and    $0x1,%cl
movzbl %cl,%ecx
shl    $0x5,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%ecx
xor    %eax,%eax
cmp    $0x1a,%ecx
setae  %al
shl    $0x5,%eax
or     $0xffffffdf,%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub i32 %4, 97
%6 = icmp ult i32 %5, 26
%7 = zext i1 %6 to i32
%8 = shl i32 %7, 5
%9 = xor i32 %8, -1
%10 = and i32 %3, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = select i1 %3, i32 -33, i32 -1
%5 = and i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int tolower(unsigned char const);
int lowercase(const char *s) { return tolower(*(const unsigned char *)s); }


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

x86 assembly (clang, -O2):
<lowercase>:
movzbl (%rdi),%edi
jmp    1030 <tolower@plt>

LLVM IR (-O0):
define i32 @lowercase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = call i32 @tolower(i8 zeroext %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @lowercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @tolower(i8 zeroext %2)
ret i32 %3
}
int isnickstartchar(char c) {
  return ((c >= 65 && c <= 90) || (c >= 97 && c <= 122) ||
          (c >= 91 && c <= 96) || (c >= 123 && c <= 125));
}


x86 assembly (clang, -O0):
<isnickstartchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1129 <isnickstartchar+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    118c <isnickstartchar+0x8c>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1148 <isnickstartchar+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    118c <isnickstartchar+0x8c>
movsbl -0x1(%rbp),%eax
cmp    $0x5b,%eax
jl     1167 <isnickstartchar+0x67>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x60,%ecx
mov    %al,-0x2(%rbp)
jle    118c <isnickstartchar+0x8c>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x7b,%ecx
mov    %al,-0x3(%rbp)
jl     1186 <isnickstartchar+0x86>
movsbl -0x1(%rbp),%eax
cmp    $0x7d,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnickstartchar>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
lea    -0x5b(%rdi),%ecx
cmp    $0x6,%cl
setb   %cl
add    $0x85,%dil
cmp    $0x3,%dil
setb   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @isnickstartchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %36, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 122
br i1 %17, label %36, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 91
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 96
br i1 %25, label %36, label %26
26: ; preds = %22, %18
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp sge i32 %28, 123
br i1 %29, label %30, label %34
30: ; preds = %26
%31 = load i8, i8* %2
%32 = sext i8 %31 to i32
%33 = icmp sle i32 %32, 125
br label %34
34: ; preds = %30, %26
%35 = phi i1 [ false, %26 ], [ %33, %30 ]
br label %36
36: ; preds = %34, %22, %14, %6
%37 = phi i1 [ true, %22 ], [ true, %14 ], [ true, %6 ], [ %35, %34 ]
%38 = zext i1 %37 to i32
ret i32 %38
}

LLVM IR (-O2):
define i32 @isnickstartchar(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = add i8 %0, -91
%6 = icmp ult i8 %5, 6
%7 = or i1 %6, %4
%8 = add i8 %0, -123
%9 = icmp ult i8 %8, 3
%10 = or i1 %9, %7
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t sigma0(uint64_t x) {
  return (x >> 1 | x << 63) ^ (x >> 8 | x << 56) ^ (x >> 7);
}


x86 assembly (clang, -O0):
<sigma0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    -0x4(%rbp),%edx
mov    $0x3f,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x38,%ecx
shl    %cl,%edx
mov    -0x8(%rbp),%ecx
or     %edx,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x7,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sigma0(i32 %0) {
ret i32 poison
}
/* Type definitions */
typedef int const uint16_t;

/* Variables and functions */
scalar_t__ is_little();
uint16_t to_little(const uint16_t w) {
  if (is_little())
    return w;
  else
    return ((w & 0x00FF) << 8) | ((w & 0xFF00) >> 8);
}


x86 assembly (clang, -O0):
<to_little>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <is_little@plt>
cmp    $0x0,%rax
je     1137 <to_little+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <to_little+0x43>
mov    -0x8(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_little>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <is_little@plt>
mov    %ebx,%ecx
rol    $0x8,%cx
test   %rax,%rax
movzwl %cx,%eax
cmovne %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @to_little(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @is_little()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %16
8: ; preds = %1
%9 = load i32, i32* %3
%10 = and i32 %9, 255
%11 = shl i32 %10, 8
%12 = load i32, i32* %3
%13 = and i32 %12, 65280
%14 = ashr i32 %13, 8
%15 = or i32 %11, %14
store i32 %15, i32* %2
br label %16
16: ; preds = %8, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @to_little(i32 %0) {
%2 = tail call i64 (...) @is_little()
%3 = icmp eq i64 %2, 0
%4 = trunc i32 %0 to i16
%5 = tail call i16 @llvm.bswap.i16(i16 %4)
%6 = zext i16 %5 to i32
%7 = select i1 %3, i32 %6, i32 %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ print_pascal_triangle(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Dimension n = ");
  scanf("%d", &n);
  print_pascal_triangle(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <print_pascal_triangle@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <print_pascal_triangle@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Dimension n = \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @print_pascal_triangle(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void print1DArray(int size, int array[size]) {
  for (int i = 0; i < size; ++i) {
    printf("array[%d] = %d\n", i, array[i]);
  }
}


x86 assembly (clang, -O0):
<print1DArray>:
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    115a <print1DArray+0x4a>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <print1DArray+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print1DArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <print1DArray+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print1DArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [16 x i8] c"array[%d] = %d\0A\00"
define void @print1DArray(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
store i32 0, i32* %5
br label %8
8: ; preds = %20, %2
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i32, i32* %5
%14 = load i32*, i32** %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %18)
br label %20
20: ; preds = %12
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %8
23: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"array[%d] = %d\0A\00"
define void @print1DArray(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
/* Variables and functions */
double tanh(double);
double EDtanh(double x) {
  double y = tanh(x);
  return (1. - y * y);
}


x86 assembly (clang, -O0):
<EDtanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <tanh@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xea7(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EDtanh>:
push   %rax
call   1030 <tanh@plt>
mulsd  %xmm0,%xmm0
movsd  0xede(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @EDtanh(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @tanh(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fneg double %6
%9 = call double @llvm.fmuladd.f64(double %8, double %7, double 1.000000e+00)
ret double %9
}

LLVM IR (-O2):
define double @EDtanh(double %0) {
%2 = tail call double @tanh(double %0)
%3 = fneg double %2
%4 = tail call double @llvm.fmuladd.f64(double %3, double %2, double 1.000000e+00)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int *first = (int *)malloc(sizeof(int));
  *first = 5;
  int *second = first;
  printf("First's value is: %d \n Second's value is %d \n", *first, *second);
  free(first);
  printf("First's value is: %d \n Second's value is %d \n", *first, *second);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movl   $0x5,(%rax)
lea    0xeb2(%rip),%r14
mov    %r14,%rdi
mov    $0x5,%esi
mov    $0x5,%edx
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    (%rbx),%edx
mov    %r14,%rdi
mov    %edx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [46 x i8] c"First's value is: %d \0A Second's value is %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %2
%6 = load i32*, i32** %2
store i32 5, i32* %6
%7 = load i32*, i32** %2
store i32* %7, i32** %3
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %11)
%13 = load i32*, i32** %2
%14 = call i32 @free(i32* %13)
%15 = load i32*, i32** %2
%16 = load i32, i32* %15
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"First's value is: %d \0A Second's value is %d \0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
store i32 5, i32* %2
%3 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 5, i32 5)
%4 = tail call i32 @free(i32* %2)
%5 = load i32, i32* %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %5)
ret i32 0
}
char *rep_dlerror(void) {
  return "dynamic loading of objects not supported on this platform";
}


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

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

LLVM IR (-O0):
@.str = [58 x i8] c"dynamic loading of objects not supported on this platform\00"
define i8* @rep_dlerror() {
ret i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [58 x i8] c"dynamic loading of objects not supported on this platform\00"
define i8* @rep_dlerror() {
ret i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0)
}
void test45_Test3_pollen__run__E() {}


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

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

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

LLVM IR (-O2):
define void @test45_Test3_pollen__run__E() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *strdup(const char *s) {
  int len = strlen(s);
  char *newstr = (char *)malloc(len + 1);
  memcpy(newstr, s, len + 1);
  return newstr;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
%15 = call i32 @memcpy(i8* %11, i8* %12, i32 %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %3)
ret i8* %5
}
/* Type definitions */
struct grecs_value {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ grecs_value_free(struct grecs_value *);
void free_value_entry(void *ptr) {
  struct grecs_value *v = ptr;
  grecs_value_free(v);
}


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

x86 assembly (clang, -O2):
<free_value_entry>:
jmp    1030 <grecs_value_free@plt>

LLVM IR (-O0):
%struct.grecs_value = type { i32 }
define void @free_value_entry(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.grecs_value*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.grecs_value*
store %struct.grecs_value* %5, %struct.grecs_value** %3
%6 = load %struct.grecs_value*, %struct.grecs_value** %3
%7 = call i32 @grecs_value_free(%struct.grecs_value* %6)
ret void
}

LLVM IR (-O2):
%struct.grecs_value = type { i32 }
define void @free_value_entry(i8* %0) {
%2 = bitcast i8* %0 to %struct.grecs_value*
%3 = tail call i32 @grecs_value_free(%struct.grecs_value* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void bannerDeBienvenida() {
  printf("Bienvenido a unoDb Server\n");
  printf("Server version: %s\n\n", "2.0.0");
}


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

x86 assembly (clang, -O2):
<bannerDeBienvenida>:
push   %rax
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0xeda(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Bienvenido a unoDb Server\0A\00"
@.str.1 = [21 x i8] c"Server version: %s\0A\0A\00"
@.str.2 = [6 x i8] c"2.0.0\00"
define void @bannerDeBienvenida() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"Server version: %s\0A\0A\00"
@.str.2 = [6 x i8] c"2.0.0\00"
@str = [26 x i8] c"Bienvenido a unoDb Server\00"
define void @bannerDeBienvenida() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}
unsigned char cps() { return 0; }


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

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

LLVM IR (-O0):
define zeroext i8 @cps() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @cps() {
ret i8 0
}
/* Variables and functions */
int pow(int, int);
int func(int val) { return pow(val, 2) + 5; }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
add    $0x5,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
mov    $0x2,%esi
call   1030 <pow@plt>
add    $0x5,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @func(i32 %0) {
%2 = tail call i32 @pow(i32 %0, i32 2)
%3 = add nsw i32 %2, 5
ret i32 %3
}
/* Variables and functions */
char *getField(char *, int);
char *getRoomText(char *line) { return getField(line, 2); }


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

x86 assembly (clang, -O2):
<getRoomText>:
mov    $0x2,%esi
jmp    1030 <getField@plt>

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

LLVM IR (-O2):
define i8* @getRoomText(i8* %0) {
%2 = tail call i8* @getField(i8* %0, i32 2)
ret i8* %2
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=20 REPO_URL= REVISION= CHANGED_REVISION= "
         "CHANGE_DATE= BUILD_DATE=2015年 10月 08日 星期四 10:06:31 CST "
         "BUILD=release TARGET_PLATFORM=mali400-pmu MALI_PLATFORM= KDIR= "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y USING_PROFILING=y "
         "USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 "
         "MALI_UPPER_HALF_SCHEDULING=1";
}


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

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

LLVM IR (-O0):
@.str = [340 x i8] c"malidrv: API_VERSION=20 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=2015\E5\B9\B4 10\E6\9C\88 08\E6\97\A5 \E6\98\9F\E6\9C\9F\E5\9B\9B 10:06:31 CST BUILD=release TARGET_PLATFORM=mali400-pmu MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y USING_PROFILING=y USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([340 x i8], [340 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [340 x i8] c"malidrv: API_VERSION=20 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=2015\E5\B9\B4 10\E6\9C\88 08\E6\97\A5 \E6\98\9F\E6\9C\9F\E5\9B\9B 10:06:31 CST BUILD=release TARGET_PLATFORM=mali400-pmu MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y USING_PROFILING=y USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([340 x i8], [340 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ algr_cc_0();
int /*<<< orphan*/ algr_cc_1();
int /*<<< orphan*/ algr_cc_2();
int /*<<< orphan*/ algr_cc_3();
int main() {
  algr_cc_0();
  algr_cc_1();
  algr_cc_2();
  algr_cc_3();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <algr_cc_0@plt>
mov    $0x0,%al
call   1060 <algr_cc_1@plt>
mov    $0x0,%al
call   1040 <algr_cc_2@plt>
mov    $0x0,%al
call   1050 <algr_cc_3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <algr_cc_0@plt>
xor    %eax,%eax
call   1060 <algr_cc_1@plt>
xor    %eax,%eax
call   1040 <algr_cc_2@plt>
xor    %eax,%eax
call   1050 <algr_cc_3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @algr_cc_0()
%3 = call i32 (...) @algr_cc_1()
%4 = call i32 (...) @algr_cc_2()
%5 = call i32 (...) @algr_cc_3()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @algr_cc_0()
%2 = tail call i32 (...) @algr_cc_1()
%3 = tail call i32 (...) @algr_cc_2()
%4 = tail call i32 (...) @algr_cc_3()
ret i32 0
}
int d_ne_rr1(double a1, double a2) { return (((a1) != (a2))); }


x86 assembly (clang, -O0):
<d_ne_rr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ne_rr1>:
cmpneqsd %xmm1,%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @d_ne_rr1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp une double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @d_ne_rr1(double %0, double %1) {
%3 = fcmp une double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}