xunge/DecIR huggingface dataset:
void DeleteMatrixD(double **T) {
  free(T[0]);
  free(T);
}


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

x86 assembly (clang, -O2):
<DeleteMatrixD>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @DeleteMatrixD(double** %0) {
%2 = alloca double**
store double** %0, double*** %2
%3 = load double**, double*** %2
%4 = getelementptr inbounds double*, double** %3, i64 0
%5 = load double*, double** %4
%6 = bitcast double* %5 to i8*
%7 = load double**, double*** %2
%8 = bitcast double** %7 to i8*
ret void
}

LLVM IR (-O2):
define void @DeleteMatrixD(double** nocapture %0) {
%2 = bitcast double** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast double** %0 to i8*
tail call void @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int main() {
  exit(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int ok(int i) { exit(i); }


x86 assembly (clang, -O0):
<ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<ok>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @ok(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
long double strtod(char const *, char **);
long double strtold(const char *nptr, char **endptr) {
  return strtod(nptr, endptr);
}


x86 assembly (clang, -O0):
<strtold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strtod@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtold>:
jmp    1030 <strtod@plt>

LLVM IR (-O0):
define x86_fp80 @strtold(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = load i8**, i8*** %4
%7 = call x86_fp80 @strtod(i8* %5, i8** %6)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @strtold(i8* %0, i8** nocapture %1) {
%3 = tail call x86_fp80 @strtod(i8* %0, i8** %1)
ret x86_fp80 %3
}
int jac_chain_nm10_init(int *n_in, int *n_out, int *n_int, int *n_real) {
  if (n_in)
    *n_in = 2;
  if (n_out)
    *n_out = 2;
  if (n_int)
    *n_int = 0;
  if (n_real)
    *n_real = 0;
  return 0;
}


x86 assembly (clang, -O0):
<jac_chain_nm10_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <jac_chain_nm10_init+0x29>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <jac_chain_nm10_init+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <jac_chain_nm10_init+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <jac_chain_nm10_init+0x68>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm10_init>:
test   %rdi,%rdi
je     110b <jac_chain_nm10_init+0xb>
movl   $0x2,(%rdi)
test   %rsi,%rsi
je     1116 <jac_chain_nm10_init+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <jac_chain_nm10_init+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <jac_chain_nm10_init+0x2c>
movl   $0x0,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @jac_chain_nm10_init(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 2, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
scalar_t__ bind(int, struct sockaddr const *, int /*<<< orphan*/);
int /*<<< orphan*/ err_sys(char *);
void Bind(int sockfd, const struct sockaddr *addr, socklen_t len) {
  if (bind(sockfd, addr, len) < 0)
    err_sys("bind error");
}


x86 assembly (clang, -O0):
<Bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <bind@plt>
cmp    $0x0,%rax
jge    1157 <Bind+0x37>
lea    0xeae(%rip),%rdi
call   1030 <err_sys@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bind>:
push   %rax
call   1040 <bind@plt>
test   %rax,%rax
js     112d <Bind+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <err_sys@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@.str = [11 x i8] c"bind error\00"
define void @Bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load %struct.sockaddr*, %struct.sockaddr** %5
%9 = load i32, i32* %6
%10 = call i64 @bind(i32 %7, %struct.sockaddr* %8, i32 %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 @err_sys(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [11 x i8] c"bind error\00"
define void @Bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = tail call i64 @bind(i32 %0, %struct.sockaddr* %1, i32 %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @err_sys(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
__attribute__((always_)) uint64_t min_uint64_t(uint64_t a, uint64_t b) {
  return a < b ? a : b;
}


x86 assembly (clang, -O0):
<min_uint64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <min_uint64_t+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min_uint64_t+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_uint64_t>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @min_uint64_t(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int max_keypermod;
};
typedef TYPE_1__ XModifierKeymap;

/* Variables and functions */
void set_XModifierKeymap_max_keypermod(void *_p, int _v) {
  ((XModifierKeymap *)_p)->max_keypermod = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XModifierKeymap_max_keypermod>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XModifierKeymap_max_keypermod(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XModifierKeymap_max_keypermod(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
long double strtod(char const *, char **);
long double string_to_ld(const char *nptr, char **endptr) {
  return strtod(nptr, endptr);
}


x86 assembly (clang, -O0):
<string_to_ld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strtod@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_to_ld>:
jmp    1030 <strtod@plt>

LLVM IR (-O0):
define x86_fp80 @string_to_ld(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = load i8**, i8*** %4
%7 = call x86_fp80 @strtod(i8* %5, i8** %6)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @string_to_ld(i8* %0, i8** nocapture %1) {
%3 = tail call x86_fp80 @strtod(i8* %0, i8** %1)
ret x86_fp80 %3
}
/* Variables and functions */
char *wFileLineInput(int);
int wPopNumber();
int /*<<< orphan*/ wPushString(char *);
void wBasFGets() {
  int handle;
  char *buffer;
  handle = wPopNumber();
  buffer = wFileLineInput(handle);
  wPushString(buffer);
}


x86 assembly (clang, -O0):
<wBasFGets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <wPopNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <wFileLineInput@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <wPushString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasFGets>:
push   %rax
xor    %eax,%eax
call   1030 <wPopNumber@plt>
mov    %eax,%edi
call   1040 <wFileLineInput@plt>
mov    %rax,%rdi
pop    %rax
jmp    1050 <wPushString@plt>

LLVM IR (-O0):
define void @wBasFGets() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i32 (...) @wPopNumber()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i8* @wFileLineInput(i32 %4)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @wPushString(i8* %6)
ret void
}

LLVM IR (-O2):
define void @wBasFGets() {
%1 = tail call i32 (...) @wPopNumber()
%2 = tail call i8* @wFileLineInput(i32 %1)
%3 = tail call i32 @wPushString(i8* %2)
ret void
}
/* Variables and functions */
scalar_t__ mnt_init();
int mount_init(void) {
  if (mnt_init() < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<mount_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <mnt_init@plt>
cmp    $0x0,%rax
jge    1135 <mount_init+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    113c <mount_init+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mount_init>:
push   %rax
xor    %eax,%eax
call   1030 <mnt_init@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mount_init() {
%1 = alloca i32
%2 = call i64 (...) @mnt_init()
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @mount_init() {
%1 = tail call i64 (...) @mnt_init()
%2 = ashr i64 %1, 63
%3 = trunc i64 %2 to i32
ret i32 %3
}
void genbc1tl() {}


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

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

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

LLVM IR (-O2):
define void @genbc1tl() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ f1();
int /*<<< orphan*/ f2();
int main(void) {
  f1();
  f2();
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <f1@plt>
mov    $0x0,%al
call   1030 <f2@plt>
xor    %edi,%edi
call   1040 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <f1@plt>
xor    %eax,%eax
call   1030 <f2@plt>
xor    %edi,%edi
call   1040 <_exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f1()
%3 = call i32 (...) @f2()
%4 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f1()
%2 = tail call i32 (...) @f2()
%3 = tail call i32 @_exit(i32 0)
unreachable
}
void striprs(char *s) {
  char *p = s;
  do {
    if (*s == '\\') {
      s++;
    }
    *p++ = *s;
  } while (*s++ != '\0');
}


x86 assembly (clang, -O0):
<striprs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    112c <striprs+0x2c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1110 <striprs+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<striprs>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %ecx,%ecx
cmpb   $0x5c,(%rdi)
sete   %cl
movzbl (%rdi,%rcx,1),%edx
mov    %dl,(%rax)
add    $0x1,%rax
cmpb   $0x0,(%rdi,%rcx,1)
lea    0x1(%rdi,%rcx,1),%rdi
jne    1110 <striprs+0x10>
ret

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

LLVM IR (-O2):
define void @striprs(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %11, %2 ]
%4 = phi i8* [ %0, %1 ], [ %10, %2 ]
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 92
%7 = zext i1 %6 to i64
%8 = getelementptr i8, i8* %3, i64 %7
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %9, i8* %4
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %2
14: ; preds = %2
ret void
}
int udp_event_loop() {}


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

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

LLVM IR (-O0):
define i32 @udp_event_loop() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @udp_event_loop() {
ret i32 undef
}
/* Variables and functions */
double fma(double, double, double);
double fma64(double x, double y, double z) { return fma(x, y, z); }


x86 assembly (clang, -O0):
<fma64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <fma@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fma64>:
jmp    1030 <fma@plt>

LLVM IR (-O0):
define double @fma64(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @llvm.fma.f64(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @fma64(double %0, double %1, double %2) {
%4 = tail call double @llvm.fma.f64(double %0, double %1, double %2)
ret double %4
}
unsigned long SysCtlFlagStatusGet(void) {
  return ((*((volatile unsigned long *)(0x40007004))) &
          (0x00000001 | 0x00000002 | 0x00000004));
}


x86 assembly (clang, -O0):
<SysCtlFlagStatusGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40007004,%eax
mov    (%rax),%rax
and    $0x7,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlFlagStatusGet>:
mov    0x40007004,%rax
40
and    $0x7,%eax
ret

LLVM IR (-O0):
define i64 @SysCtlFlagStatusGet() {
%1 = load volatile i64, i64* inttoptr (i64 1073770500 to i64*)
%2 = and i64 %1, 7
ret i64 %2
}

LLVM IR (-O2):
define i64 @SysCtlFlagStatusGet() {
%1 = load volatile i64, i64* inttoptr (i64 1073770500 to i64*)
%2 = and i64 %1, 7
ret i64 %2
}
double iw_filter_box(struct iw_rr_ctx *rrctx, double x) {
  if (x <= 0.5)
    return 1.0;
  return 0.0;
}


x86 assembly (clang, -O0):
<iw_filter_box>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  0xeeb(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1132 <iw_filter_box+0x32>
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113a <iw_filter_box+0x3a>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<iw_filter_box>:
cmpnlesd 0xef7(%rip),%xmm0
movsd  0xef7(%rip),%xmm1
andnpd %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.iw_rr_ctx = type opaque
define double @iw_filter_box(%struct.iw_rr_ctx* %0, double %1) {
%3 = alloca double
%4 = alloca %struct.iw_rr_ctx*
%5 = alloca double
store %struct.iw_rr_ctx* %0, %struct.iw_rr_ctx** %4
store double %1, double* %5
%6 = load double, double* %5
%7 = fcmp ole double %6, 5.000000e-01
br i1 %7, label %8, label %9
8: ; preds = %2
store double 1.000000e+00, double* %3
br label %10
9: ; preds = %2
store double 0.000000e+00, double* %3
br label %10
10: ; preds = %9, %8
%11 = load double, double* %3
ret double %11
}

LLVM IR (-O2):
%struct.iw_rr_ctx = type opaque
define double @iw_filter_box(%struct.iw_rr_ctx* nocapture readnone %0, double %1) {
%3 = fcmp ugt double %1, 5.000000e-01
%4 = select i1 %3, double 0.000000e+00, double 1.000000e+00
ret double %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void EMACTxDisable(uint32_t ui32Base) {
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) &= ~0x00000008;
  (*((volatile uint32_t *)(ui32Base + 0x00000C18))) &= ~0x00002000;
}


x86 assembly (clang, -O0):
<EMACTxDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffff7,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0xc18,%eax
cltq
mov    (%rax),%ecx
and    $0xffffdfff,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACTxDisable>:
movslq %edi,%rax
andl   $0xfffffff7,(%rax)
andl   $0xffffdfff,0xc18(%rax)
df ff ff
ret

LLVM IR (-O0):
define void @EMACTxDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 0
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -9
store volatile i32 %8, i32* %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 3096
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = and i32 %13, -8193
store volatile i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @EMACTxDisable(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = and i32 %4, -9
store volatile i32 %5, i32* %3
%6 = add nsw i32 %0, 3096
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -8193
store volatile i32 %10, i32* %8
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ time;
};
typedef TYPE_1__ XCrossingEvent;

/* Variables and functions */
unsigned long get_XCrossingEvent_time(void *_p) {
  return (unsigned long)((XCrossingEvent *)_p)->time;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XCrossingEvent_time(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XCrossingEvent_time(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
int exists(const char *filename) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @exists(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int clone(int, void *);
int ns_clone(int flags, void *child_stack) {
  return clone(flags | 0x00020000 | 0x04000000 | 0x08000000, child_stack);
}


x86 assembly (clang, -O0):
<ns_clone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
or     $0x20000,%edi
or     $0x4000000,%edi
or     $0x8000000,%edi
mov    -0x10(%rbp),%rsi
call   1030 <clone@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns_clone>:
or     $0xc020000,%edi
jmp    1030 <clone@plt>

LLVM IR (-O0):
define i32 @ns_clone(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = or i32 %5, 131072
%7 = or i32 %6, 67108864
%8 = or i32 %7, 134217728
%9 = load i8*, i8** %4
%10 = call i32 @clone(i32 %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @ns_clone(i32 %0, i8* %1) {
%3 = or i32 %0, 201457664
%4 = tail call i32 @clone(i32 %3, i8* %1)
ret i32 %4
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ random();
float rnd_next_float() { return (float)random() / (float)RAND_MAX; }


x86 assembly (clang, -O0):
<rnd_next_float>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd_next_float>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define float @rnd_next_float() {
%1 = call i64 (...) @random()
%2 = sitofp i64 %1 to float
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to float
%5 = fdiv float %2, %4
ret float %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define float @rnd_next_float() {
%1 = tail call i64 (...) @random()
%2 = sitofp i64 %1 to float
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to float
%5 = fdiv float %2, %4
ret float %5
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double rand_num() { return (double)rand() / (double)RAND_MAX; }


x86 assembly (clang, -O0):
<rand_num>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_num>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @rand_num() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @rand_num() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ fb_PrintFixString(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ fb_hFloat2Str(double, char *, int, int);
void fb_PrintDouble(int fnum, double val, int mask) {
  char buffer[16 + 1 + 9 + 1];
  fb_PrintFixString(fnum, fb_hFloat2Str(val, buffer, 16, 0x00000001), mask);
}


x86 assembly (clang, -O0):
<fb_PrintDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x34(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    -0x30(%rbp),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
call   1040 <fb_hFloat2Str@plt>
mov    -0x34(%rbp),%edi
mov    %eax,%esi
mov    -0x14(%rbp),%edx
call   1030 <fb_PrintFixString@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_PrintDouble>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
mov    %rsp,%rdi
mov    $0x10,%esi
mov    $0x1,%edx
call   1040 <fb_hFloat2Str@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %ebx,%edx
call   1030 <fb_PrintFixString@plt>
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @fb_PrintDouble(i32 %0, double %1, i32 %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca i32
%7 = alloca [27 x i8]
store i32 %0, i32* %4
store double %1, double* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load double, double* %5
%10 = getelementptr inbounds [27 x i8], [27 x i8]* %7, i64 0, i64 0
%11 = call i32 @fb_hFloat2Str(double %9, i8* %10, i32 16, i32 1)
%12 = load i32, i32* %6
%13 = call i32 @fb_PrintFixString(i32 %8, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @fb_PrintDouble(i32 %0, double %1, i32 %2) {
%4 = alloca [27 x i8]
%5 = getelementptr inbounds [27 x i8], [27 x i8]* %4, i64 0, i64 0
%6 = call i32 @fb_hFloat2Str(double %1, i8* %5, i32 16, i32 1)
%7 = call i32 @fb_PrintFixString(i32 %0, i32 %6, i32 %2)
ret void
}
/* Type definitions */
struct shl_pty {
  int dummy;
};

/* Variables and functions */
int ENODEV;
int pty_read(struct shl_pty *);
int /*<<< orphan*/ pty_write(struct shl_pty *);
int /*<<< orphan*/ shl_pty_is_open(struct shl_pty *);
int shl_pty_dispatch(struct shl_pty *pty) {
  int r;
  if (!shl_pty_is_open(pty))
    return -ENODEV;
  r = pty_read(pty);
  pty_write(pty);
  return r;
}


x86 assembly (clang, -O0):
<shl_pty_dispatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <shl_pty_is_open@plt>
cmp    $0x0,%eax
jne    1161 <shl_pty_dispatch+0x31>
xor    %eax,%eax
mov    0x2e89(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    117c <shl_pty_dispatch+0x4c>
mov    -0x10(%rbp),%rdi
call   1040 <pty_read@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <pty_write@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shl_pty_dispatch>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <shl_pty_is_open@plt>
test   %eax,%eax
je     1155 <shl_pty_dispatch+0x25>
mov    %rbx,%rdi
call   1040 <pty_read@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <pty_write@plt>
mov    %ebp,%eax
jmp    1160 <shl_pty_dispatch+0x30>
mov    0x2e84(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.shl_pty = type { i32 }
@ENODEV = global i32 0
define i32 @shl_pty_dispatch(%struct.shl_pty* %0) {
%2 = alloca i32
%3 = alloca %struct.shl_pty*
%4 = alloca i32
store %struct.shl_pty* %0, %struct.shl_pty** %3
%5 = load %struct.shl_pty*, %struct.shl_pty** %3
%6 = call i32 @shl_pty_is_open(%struct.shl_pty* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* @ENODEV
%10 = sub nsw i32 0, %9
store i32 %10, i32* %2
br label %17
11: ; preds = %1
%12 = load %struct.shl_pty*, %struct.shl_pty** %3
%13 = call i32 @pty_read(%struct.shl_pty* %12)
store i32 %13, i32* %4
%14 = load %struct.shl_pty*, %struct.shl_pty** %3
%15 = call i32 @pty_write(%struct.shl_pty* %14)
%16 = load i32, i32* %4
store i32 %16, i32* %2
br label %17
17: ; preds = %11, %8
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.shl_pty = type { i32 }
@ENODEV = global i32 0
define i32 @shl_pty_dispatch(%struct.shl_pty* %0) {
%2 = tail call i32 @shl_pty_is_open(%struct.shl_pty* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @ENODEV
%6 = sub nsw i32 0, %5
br label %10
7: ; preds = %1
%8 = tail call i32 @pty_read(%struct.shl_pty* %0)
%9 = tail call i32 @pty_write(%struct.shl_pty* %0)
br label %10
10: ; preds = %7, %4
%11 = phi i32 [ %8, %7 ], [ %6, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *);
float sqrt(int);
int main(int argc, char **argv) {
  float a, b, c;
  float d;
  scanf("%f", &a);
  printf("telesova uhlopricka: %f \n", a * sqrt(3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
mov    $0x3,%edi
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x24(%rbp),%xmm0
mulss  %xmm1,%xmm0
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [26 x i8] c"telesova uhlopricka: %f \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %6)
%11 = load float, float* %6
%12 = call float @sqrt(i32 3)
%13 = fmul float %11, %12
%14 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), float %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [26 x i8] c"telesova uhlopricka: %f \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%6 = load float, float* %3
%7 = call float @sqrt(i32 3)
%8 = fmul float %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), float %8)
ret i32 0
}
/* Variables and functions */
int f(int, int);
int g(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a = f(1, 2);
  printf("res: %d\n", g(a, 1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1050 <g@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"res: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @f(i32 1, i32 2)
%2 = tail call i32 @g(i32 %1, i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
void debug(char *message) {}


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

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

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

LLVM IR (-O2):
define void @debug(i8* nocapture %0) {
ret void
}
int print_info(void *state) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @print_info(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fillStringWithTime(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char timeBuffer[32];
  fillStringWithTime(timeBuffer);
  printf("The time is: %s\n", timeBuffer);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <fillStringWithTime@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"The time is: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [32 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = call i32 @fillStringWithTime(i8* %3)
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"The time is: %s\0A\00"
define i32 @main() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = call i32 @fillStringWithTime(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
double floor(double);
double ceil(double x) { return -floor(-x); }


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

x86 assembly (clang, -O2):
<ceil>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <floor@plt>
xorps  0xedc(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call double @llvm.floor.f64(double %4)
%6 = fneg double %5
ret double %6
}

LLVM IR (-O2):
define double @ceil(double %0) {
%2 = fneg double %0
%3 = tail call double @llvm.floor.f64(double %2)
%4 = fneg double %3
ret double %4
}
/* Variables and functions */
int user1_post_init_specific_init();
int post_init_specific_init(void) {
  int funreturn;
  funreturn = user1_post_init_specific_init();
  if (funreturn != 0)
    return (funreturn);
  return (0);
}


x86 assembly (clang, -O0):
<post_init_specific_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <user1_post_init_specific_init@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1137 <post_init_specific_init+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113e <post_init_specific_init+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @post_init_specific_init() {
%1 = tail call i32 (...) @user1_post_init_specific_init()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ base(int);
int /*<<< orphan*/ dev(int);
int /*<<< orphan*/ hst(int);
void foo() {
  base(-1);
  hst(-2);
#pragma omp target
  {
    base(-3);
    dev(-4);
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <base@plt>
mov    $0xfffffffe,%edi
call   1040 <hst@plt>
mov    $0xfffffffd,%edi
call   1030 <base@plt>
mov    $0xfffffffc,%edi
call   1050 <dev@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <base@plt>
mov    $0xfffffffe,%edi
call   1040 <hst@plt>
mov    $0xfffffffd,%edi
call   1030 <base@plt>
mov    $0xfffffffc,%edi
pop    %rax
jmp    1050 <dev@plt>

LLVM IR (-O0):
define void @foo() {
%1 = call i32 @base(i32 -1)
%2 = call i32 @hst(i32 -2)
%3 = call i32 @base(i32 -3)
%4 = call i32 @dev(i32 -4)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @base(i32 -1)
%2 = tail call i32 @hst(i32 -2)
%3 = tail call i32 @base(i32 -3)
%4 = tail call i32 @dev(i32 -4)
ret void
}
getfstn(uid) { return ("first name"); }


x86 assembly (clang, -O0):
<getfstn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"first name\00"
define i32 @getfstn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 ptrtoint ([11 x i8]* @.str to i32)
}

LLVM IR (-O2):
@.str = [11 x i8] c"first name\00"
define i32 @getfstn(i32 %0) {
ret i32 ptrtoint ([11 x i8]* @.str to i32)
}
/* Variables and functions */
int /*<<< orphan*/ debugf(char *, ...);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void help(char *prog_name) {
  debugf("uso: %s <nome file di calcolo> <nome file per i risultati>\n",
         prog_name);
  debugf("requirements:\n            * there must be no empty lines between "
         "command instructions\n            * every line must contain all "
         "expected information\n");
  exit(0);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <debugf@plt>
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1030 <debugf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <debugf@plt>
lea    0xf03(%rip),%rdi
xor    %eax,%eax
call   1030 <debugf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"uso: %s <nome file di calcolo> <nome file per i risultati>\0A\00"
@.str.1 = [150 x i8] c"requirements:\0A * there must be no empty lines between command instructions\0A * every line must contain all expected information\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @debugf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @debugf(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [60 x i8] c"uso: %s <nome file di calcolo> <nome file per i risultati>\0A\00"
@.str.1 = [150 x i8] c"requirements:\0A * there must be no empty lines between command instructions\0A * every line must contain all expected information\0A\00"
define void @help(i8* %0) {
%2 = tail call i32 (i8*, ...) @debugf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, ...) @debugf(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ foo1();
void bar1() { foo1(); }


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

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

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

LLVM IR (-O2):
define void @bar1() {
%1 = tail call i32 (...) @foo1()
ret void
}
void Descomprimir() {}


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

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

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

LLVM IR (-O2):
define void @Descomprimir() {
ret void
}
void default_idle_hook(void) {}


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

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

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

LLVM IR (-O2):
define void @default_idle_hook() {
ret void
}
/* Type definitions */
typedef int clock_t;

/* Variables and functions */
clock_t clock(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @clock() {
ret i32 -1
}
void read_row() {
  int i, j;
  for (i = 0; i < 20; i++) {
    for (j = 0; j < 1000000; j++) {
      ;
    }
  }
}


x86 assembly (clang, -O0):
<read_row>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
jge    114f <read_row+0x4f>
movl   $0x0,-0x8(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jge    113c <read_row+0x3c>
jmp    112e <read_row+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111c <read_row+0x1c>
jmp    1141 <read_row+0x41>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <read_row+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @read_row() {
ret void
}
void _M2_pgeif_finish(__attribute__((unused)) int argc,
                      __attribute__((unused)) char *argv[]) {}


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

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

LLVM IR (-O0):
define void @_M2_pgeif_finish(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 @_M2_pgeif_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
char *get_sata_log(int, int);
char *get_sata_ssdlog(int fd) { return (get_sata_log(fd, 0x07)); }


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

x86 assembly (clang, -O2):
<get_sata_ssdlog>:
mov    $0x7,%esi
jmp    1030 <get_sata_log@plt>

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

LLVM IR (-O2):
define i8* @get_sata_ssdlog(i32 %0) {
%2 = tail call i8* @get_sata_log(i32 %0, i32 7)
ret i8* %2
}
int test_imm_BFint32_reg(int val) { return ((val) & (0xBF << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_BFint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xbf,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_BFint32_reg(i32 %0) {
%2 = and i32 %0, 191
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int b(int arg) {
  int b_local = 5;
  return 2 * arg + b_local;
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
lea    (%rdi,%rdi,1),%eax
add    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @b(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 5, i32* %3
%4 = load i32, i32* %2
%5 = mul nsw i32 2, %4
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @b(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 5
ret i32 %3
}