xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int const);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
sigset_t _sigset(const int *signals) {
  sigset_t set;
  sigemptyset(&set);
  for (const int *sig = signals; *sig; sig++)
    sigaddset(&set, *sig);
  return set;
}


x86 assembly (clang, -O0):
<_sigset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <sigemptyset@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
je     116a <_sigset+0x4a>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1040 <sigaddset@plt>
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
jmp    113d <_sigset+0x1d>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sigset>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x4(%rsp),%rdi
call   1030 <sigemptyset@plt>
mov    (%rbx),%esi
test   %esi,%esi
je     1152 <_sigset+0x32>
add    $0x4,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <sigaddset@plt>
mov    (%rbx),%esi
add    $0x4,%rbx
test   %esi,%esi
jne    1140 <_sigset+0x20>
mov    0x4(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @_sigset(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
store i32* %0, i32** %2
%5 = call i32 @sigemptyset(i32* %3)
%6 = load i32*, i32** %2
store i32* %6, i32** %4
br label %7
7: ; preds = %15, %1
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = call i32 @sigaddset(i32* %3, i32 %13)
br label %15
15: ; preds = %11
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i32 1
store i32* %17, i32** %4
br label %7
18: ; preds = %7
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @_sigset(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sigemptyset(i32* %2)
%5 = load i32, i32* %0
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %9, %1
%8 = load i32, i32* %2
ret i32 %8
9: ; preds = %1, %9
%10 = phi i32 [ %14, %9 ], [ %5, %1 ]
%11 = phi i32* [ %13, %9 ], [ %0, %1 ]
%12 = call i32 @sigaddset(i32* %2, i32 %10)
%13 = getelementptr inbounds i32, i32* %11, i64 1
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %7, label %9
}
/* Variables and functions */
int /*<<< orphan*/ d();
int /*<<< orphan*/ e();
void c() {
  d();
  e();
}


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

x86 assembly (clang, -O2):
<c>:
push   %rax
xor    %eax,%eax
call   1030 <d@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e@plt>

LLVM IR (-O0):
define void @c() {
%1 = call i32 (...) @d()
%2 = call i32 (...) @e()
ret void
}

LLVM IR (-O2):
define void @c() {
%1 = tail call i32 (...) @d()
%2 = tail call i32 (...) @e()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int pdwait(int pfd) {
  fd_set fdset;
  FD_ZERO(&fdset);
  FD_SET(pfd, &fdset);
  return (select(pfd + 1, NULL, &fdset, NULL, NULL) == -1 ? -1 : 0);
}


x86 assembly (clang, -O0):
<pdwait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <FD_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1050 <FD_SET@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
xor    %eax,%eax
mov    %eax,%r8d
lea    -0x8(%rbp),%rdx
mov    %r8,%rsi
mov    %r8,%rcx
call   1040 <select@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0xffffffff,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdwait>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1030 <FD_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <FD_SET@plt>
add    $0x1,%ebx
mov    %ebx,%edi
xor    %esi,%esi
mov    %r14,%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <select@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @pdwait(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @FD_ZERO(i32* %3)
%5 = load i32, i32* %2
%6 = call i32 @FD_SET(i32 %5, i32* %3)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
%9 = call i32 @select(i32 %8, i32* null, i32* %3, i32* null, i32* null)
%10 = icmp eq i32 %9, -1
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 -1, i32 0
ret i32 %12
}

LLVM IR (-O2):
define i32 @pdwait(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @FD_ZERO(i32* %2)
%5 = call i32 @FD_SET(i32 %0, i32* %2)
%6 = add nsw i32 %0, 1
%7 = call i32 @select(i32 %6, i32* null, i32* %2, i32* null, i32* null)
%8 = icmp eq i32 %7, -1
%9 = sext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
void *xbp_dlsym(void *, char const *);
void *__wrap_dlsym(void *handle, const char *symbol) {
  return xbp_dlsym(handle, symbol);
}


x86 assembly (clang, -O0):
<__wrap_dlsym>:
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 <xbp_dlsym@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_dlsym>:
jmp    1030 <xbp_dlsym@plt>

LLVM IR (-O0):
define i8* @__wrap_dlsym(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 i8* @xbp_dlsym(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @__wrap_dlsym(i8* %0, i8* %1) {
%3 = tail call i8* @xbp_dlsym(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int check_usage(int arg, char *argv[]) {
  if (arg > 2) {
    printf("mxdelsvr [ip]\n\n");
    return -10;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    1141 <check_usage+0x31>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
movl   $0xfffffff6,-0x4(%rbp)
jmp    1148 <check_usage+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_usage>:
xor    %eax,%eax
cmp    $0x3,%edi
jl     112d <check_usage+0x1d>
push   %rax
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfffffff6,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
@str = [15 x i8] c"mxdelsvr [ip]\0A\00"
define i32 @check_usage(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ -10, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ assert(int);
int sub(int, int);
void main() {
  int i = 0;
  i = add(i, 1);
  i = sub(i, 1);
  assert(i == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1050 <sub@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1050 <sub@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @add(i32 %2, i32 1)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @sub(i32 %4, i32 1)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @add(i32 0, i32 1)
%2 = tail call i32 @sub(i32 %1, i32 1)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void cat_usage(FILE *fp) { fputs("usage: unrez cat <file> <type> <id>\n", fp); }


x86 assembly (clang, -O0):
<cat_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cat_usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x24,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"usage: unrez cat <file> <type> <id>\0A\00"
define void @cat_usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"usage: unrez cat <file> <type> <id>\0A\00"
define void @cat_usage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 36, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *try_replace_tilde(char *);
char *replace_tilde(char path[]) {
  char *const expanded_path = try_replace_tilde(path);
  if (expanded_path != path) {
    free(path);
  }
  return expanded_path;
}


x86 assembly (clang, -O0):
<replace_tilde>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <try_replace_tilde@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     1150 <replace_tilde+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_tilde>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <try_replace_tilde@plt>
mov    %rax,%r14
cmp    %rbx,%rax
je     113c <replace_tilde+0x1c>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @replace_tilde(i8* %0) {
%2 = tail call i8* @try_replace_tilde(i8* %0)
%3 = icmp eq i8* %2, %0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void help(char *name) {
  printf("%s - BINARY to Intel HEX file convertor version 1.00\n"
         "(c)BCL Vysoke Myto 2001 (benedikt@lphard.cz)\n\n",
         name);
  printf("Usage: %s [-option] binfile hexfile\n"
         " -l  Bytes to read from binary file\n"
         " -i  Binary file starting offset\n"
         " -o  Output file offset (where HEX data starts)\n"
         " -t  Exclude EOF record\n"
         " -a  Append to end of existing HEX file\n"
         " -q  Quiet mode (no statistics are printed)\n",
         name);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf2d(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xf3a(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [100 x i8] c"%s - BINARY to Intel HEX file convertor version 1.00\0A(c)BCL Vysoke Myto 2001 (benedikt@lphard.cz)\0A\0A\00"
@.str.1 = [262 x i8] c"Usage: %s [-option] binfile hexfile\0A -l Bytes to read from binary file\0A -i Binary file starting offset\0A -o Output file offset (where HEX data starts)\0A -t Exclude EOF record\0A -a Append to end of existing HEX file\0A -q Quiet mode (no statistics are printed)\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([262 x i8], [262 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [100 x i8] c"%s - BINARY to Intel HEX file convertor version 1.00\0A(c)BCL Vysoke Myto 2001 (benedikt@lphard.cz)\0A\0A\00"
@.str.1 = [262 x i8] c"Usage: %s [-option] binfile hexfile\0A -l Bytes to read from binary file\0A -i Binary file starting offset\0A -o Output file offset (where HEX data starts)\0A -t Exclude EOF record\0A -a Append to end of existing HEX file\0A -q Quiet mode (no statistics are printed)\0A\00"
define void @help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([262 x i8], [262 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
void *page_address(struct page *);
void *kmap_local_page(struct page *page) { return page_address(page); }


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

x86 assembly (clang, -O2):
<kmap_local_page>:
jmp    1030 <page_address@plt>

LLVM IR (-O0):
%struct.page = type { i32 }
define i8* @kmap_local_page(%struct.page* %0) {
%2 = alloca %struct.page*
store %struct.page* %0, %struct.page** %2
%3 = load %struct.page*, %struct.page** %2
%4 = call i8* @page_address(%struct.page* %3)
ret i8* %4
}

LLVM IR (-O2):
%struct.page = type { i32 }
define i8* @kmap_local_page(%struct.page* %0) {
%2 = tail call i8* @page_address(%struct.page* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ yp_ml_remove_event(int, int);
void yldisp_stop_counter() { yp_ml_remove_event(-1, 21); }


x86 assembly (clang, -O0):
<yldisp_stop_counter>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
mov    $0x15,%esi
call   1030 <yp_ml_remove_event@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<yldisp_stop_counter>:
mov    $0xffffffff,%edi
mov    $0x15,%esi
jmp    1030 <yp_ml_remove_event@plt>

LLVM IR (-O0):
define void @yldisp_stop_counter() {
%1 = call i32 @yp_ml_remove_event(i32 -1, i32 21)
ret void
}

LLVM IR (-O2):
define void @yldisp_stop_counter() {
%1 = tail call i32 @yp_ml_remove_event(i32 -1, i32 21)
ret void
}
int min(int n, int *v) {
  if (n == 1)
    return v[n - 1];
  int a = v[n - 1], b = min(n - 1, v);
  return (a < b) ? a : b;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1141 <min+0x31>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1189 <min+0x79>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1030 <min@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    117d <min+0x6d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1183 <min+0x73>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
push   %rbx
cmp    $0x1,%edi
jne    111a <min+0xa>
mov    (%rsi),%eax
pop    %rbx
ret
movslq %edi,%rax
add    $0xffffffff,%edi
mov    -0x4(%rsi,%rax,4),%ebx
call   1030 <min@plt>
cmp    %eax,%ebx
cmovl  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @min(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load i32*, i32** %5
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %11, i64 %14
%16 = load i32, i32* %15
store i32 %16, i32* %3
br label %37
17: ; preds = %2
%18 = load i32*, i32** %5
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %18, i64 %21
%23 = load i32, i32* %22
store i32 %23, i32* %6
%24 = load i32, i32* %4
%25 = sub nsw i32 %24, 1
%26 = load i32*, i32** %5
%27 = call i32 @min(i32 %25, i32* %26)
store i32 %27, i32* %7
%28 = load i32, i32* %6
%29 = load i32, i32* %7
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %33
31: ; preds = %17
%32 = load i32, i32* %6
br label %35
33: ; preds = %17
%34 = load i32, i32* %7
br label %35
35: ; preds = %33, %31
%36 = phi i32 [ %32, %31 ], [ %34, %33 ]
store i32 %36, i32* %3
br label %37
37: ; preds = %35, %10
%38 = load i32, i32* %3
ret i32 %38
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32* nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* %1
br label %6
6: ; preds = %4, %8
%7 = phi i32 [ %15, %8 ], [ %5, %4 ]
ret i32 %7
8: ; preds = %2
%9 = add nsw i32 %0, -1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = tail call i32 @min(i32 %9, i32* %1)
%14 = icmp slt i32 %12, %13
%15 = select i1 %14, i32 %12, i32 %13
br label %6
}
void print_cache_stats() {}


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

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

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

LLVM IR (-O2):
define void @print_cache_stats() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ value;

/* Variables and functions */
int /*<<< orphan*/ _assert_true(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ _cast_to_largest_integral_type(int, void const *);
int /*<<< orphan*/ free(void *);
void free_value(const void *value, void *cleanup_value_data) {
  _assert_true(_cast_to_largest_integral_type(sizeof(value), value), "value",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/ph1l/cfengine3-debian/refs/"
               "heads/master/tests/unit/cmockery.c",
               480);
  free((void *)value);
}


x86 assembly (clang, -O0):
<free_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x8,%edi
call   1040 <_cast_to_largest_integral_type@plt>
mov    %eax,%edi
lea    0xea9(%rip),%rsi
lea    0xea8(%rip),%rdx
mov    $0x1e0,%ecx
call   1050 <_assert_true@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_value>:
push   %rbx
mov    %rdi,%rbx
mov    $0x8,%edi
mov    %rbx,%rsi
call   1040 <_cast_to_largest_integral_type@plt>
lea    0xeb8(%rip),%rsi
lea    0xeb7(%rip),%rdx
mov    %eax,%edi
mov    $0x1e0,%ecx
call   1050 <_assert_true@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"value\00"
@.str.1 = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ph1l/cfengine3-debian/refs/heads/master/tests/unit/cmockery.c\00"
define void @free_value(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 @_cast_to_largest_integral_type(i32 8, i8* %5)
%7 = call i32 @_assert_true(i32 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str.1, i64 0, i64 0), i32 480)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"value\00"
@.str.1 = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ph1l/cfengine3-debian/refs/heads/master/tests/unit/cmockery.c\00"
define void @free_value(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @_cast_to_largest_integral_type(i32 8, i8* %0)
%4 = tail call i32 @_assert_true(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str.1, i64 0, i64 0), i32 480)
%5 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
unsigned int ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
unsigned get_cart_size(FILE *cart) {
  unsigned filesize;
  fseek(cart, 0, SEEK_END);
  filesize = ftell(cart);
  rewind(cart);
  return filesize;
}


x86 assembly (clang, -O0):
<get_cart_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cart_size>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <rewind@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
define i32 @get_cart_size(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i32 @ftell(i32* %7)
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = call i32 @rewind(i32* %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i32 @get_cart_size(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i32 @ftell(i32* %0)
%5 = tail call i32 @rewind(i32* %0)
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
float sht11_temp_convert_sensirion(int16_t raw_temperature) {
  const float d1 = -39.65f;
  const float d2 = 0.01f;
  return (d1 + d2 * (float)raw_temperature);
}


x86 assembly (clang, -O0):
<sht11_temp_convert_sensirion>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  0xef4(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xee3(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
movss  0xed0(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xec8(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sht11_temp_convert_sensirion>:
cvtsi2ss %rdi,%xmm0
mulss  0xef3(%rip),%xmm0
addss  0xeef(%rip),%xmm0
ret

LLVM IR (-O0):
define float @sht11_temp_convert_sensirion(i64 %0) {
%2 = alloca i64
%3 = alloca float
%4 = alloca float
store i64 %0, i64* %2
store float 0xC043D33340000000, float* %3
store float 0x3F847AE140000000, float* %4
%5 = load i64, i64* %2
%6 = sitofp i64 %5 to float
%7 = call float @llvm.fmuladd.f32(float 0x3F847AE140000000, float %6, float 0xC043D33340000000)
ret float %7
}

LLVM IR (-O2):
define float @sht11_temp_convert_sensirion(i64 %0) {
%2 = sitofp i64 %0 to float
%3 = tail call float @llvm.fmuladd.f32(float %2, float 0x3F847AE140000000, float 0xC043D33340000000)
ret float %3
}
int test_imm_59uint32_mem(unsigned int *val) {
  return ((*val) & (0x59 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_59uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x59,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_59uint32_mem>:
testb  $0x59,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_59uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 89
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void *malloc(size_t);
int main(int argc, char **argv) {
  size_t size = 15;
  void *p = malloc(size + 1);
  ((char *)p)[size] = 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0xf,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i64
%6 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i64 15, i64* %5
%7 = load i64, i64* %5
%8 = add i64 %7, 1
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = load i64, i64* %5
%12 = getelementptr inbounds i8, i8* %10, i64 %11
store i8 0, i8* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int FDC_GetSectorSize(int N) {
  if (N == 0)
    return 0x0050;
  if (N >= 8)
    return 0x8000;
  return (1 << N) << 7;
}


x86 assembly (clang, -O0):
<FDC_GetSectorSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <FDC_GetSectorSize+0x1d>
movl   $0x50,-0x4(%rbp)
jmp    1143 <FDC_GetSectorSize+0x43>
cmpl   $0x8,-0x8(%rbp)
jl     1133 <FDC_GetSectorSize+0x33>
movl   $0x8000,-0x4(%rbp)
jmp    1143 <FDC_GetSectorSize+0x43>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
shl    $0x7,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FDC_GetSectorSize>:
mov    %edi,%ecx
mov    $0x80,%eax
shl    %cl,%eax
cmp    $0x8,%edi
mov    $0x8000,%edx
cmovl  %eax,%edx
test   %edi,%edi
mov    $0x50,%eax
cmovne %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @FDC_GetSectorSize(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = icmp sgt i32 %0, 7
%4 = shl i32 128, %0
%5 = select i1 %3, i32 32768, i32 %4
%6 = select i1 %2, i32 80, i32 %5
ret i32 %6
}
/* Variables and functions */
float pow(float, float);
float srgb_to_linear(float s) {
  if (s <= 0.04045f)
    return s / 12.92f;
  else
    return pow((s + 0.055f) / (1 + 0.055f), 2.4f);
}


x86 assembly (clang, -O0):
<srgb_to_linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  0xedb(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     114a <srgb_to_linear+0x3a>
movss  -0x8(%rbp),%xmm0
movss  0xed4(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1175 <srgb_to_linear+0x65>
movss  0xeba(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  0xea9(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xe99(%rip),%xmm1
call   1030 <pow@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srgb_to_linear>:
movss  0xee8(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    113a <srgb_to_linear+0x2a>
addss  0xee3(%rip),%xmm0
divss  0xedf(%rip),%xmm0
movss  0xedb(%rip),%xmm1
jmp    1030 <pow@plt>
divss  0xec2(%rip),%xmm0
ret

LLVM IR (-O0):
define float @srgb_to_linear(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ole float %4, 0x3FA4B5DCC0000000
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %3
%8 = fdiv float %7, 0x4029D70A40000000
store float %8, float* %2
br label %14
9: ; preds = %1
%10 = load float, float* %3
%11 = fadd float %10, 0x3FAC28F5C0000000
%12 = fdiv float %11, 0x3FF0E147A0000000
%13 = call float @pow(float %12, float 0x4003333340000000)
store float %13, float* %2
br label %14
14: ; preds = %9, %6
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
define float @srgb_to_linear(float %0) {
%2 = fcmp ugt float %0, 0x3FA4B5DCC0000000
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = fdiv float %0, 0x4029D70A40000000
br label %9
5: ; preds = %1
%6 = fadd float %0, 0x3FAC28F5C0000000
%7 = fdiv float %6, 0x3FF0E147A0000000
%8 = tail call float @pow(float %7, float 0x4003333340000000)
br label %9
9: ; preds = %5, %3
%10 = phi float [ %4, %3 ], [ %8, %5 ]
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void endOFile(void) { printf("\r\n\r\n<End of sreplay file>\r\n"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"\0D\0A\0D\0A<End of sreplay file>\0D\0A\00"
define void @endOFile() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"\0D\0A\0D\0A<End of sreplay file>\0D\00"
define void @endOFile() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct ipam_line {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int __fprint_ipam_fmt(int /*<<< orphan*/ *, struct ipam_line const *,
                      char const *, int);
int fprint_ipam_header(FILE *output, const struct ipam_line *r,
                       const char *fmt) {
  return __fprint_ipam_fmt(output, r, fmt, 1);
}


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

x86 assembly (clang, -O2):
<fprint_ipam_header>:
mov    $0x1,%ecx
jmp    1030 <__fprint_ipam_fmt@plt>

LLVM IR (-O0):
%struct.ipam_line = type { i32 }
define i32 @fprint_ipam_header(i32* %0, %struct.ipam_line* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca %struct.ipam_line*
%6 = alloca i8*
store i32* %0, i32** %4
store %struct.ipam_line* %1, %struct.ipam_line** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load %struct.ipam_line*, %struct.ipam_line** %5
%9 = load i8*, i8** %6
%10 = call i32 @__fprint_ipam_fmt(i32* %7, %struct.ipam_line* %8, i8* %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.ipam_line = type { i32 }
define i32 @fprint_ipam_header(i32* %0, %struct.ipam_line* %1, i8* %2) {
%4 = tail call i32 @__fprint_ipam_fmt(i32* %0, %struct.ipam_line* %1, i8* %2, i32 1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
int main(void) {
  FILE *p = NULL;
  p = fopen("test.txt", "r+");
  fseek(p, 2, SEEK_CUR);
  fwrite(" ", 1, 1, p);
  fclose(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xea2(%rip),%rdi
lea    0xea4(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e6f(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%esi
call   1040 <fseek@plt>
mov    -0x10(%rbp),%rcx
lea    0xe7c(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1060 <fwrite@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    0x2e8a(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1050 <fseek@plt>
mov    $0x20,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [3 x i8] c"r+\00"
@SEEK_CUR = global i32 0
@.str.2 = [2 x i8] c" \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
store i32* null, i32** %2
%3 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_CUR
%6 = call i32 @fseek(i32* %4, i32 2, i32 %5)
%7 = load i32*, i32** %2
%8 = call i32 @fwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 1, i32* %7)
%9 = load i32*, i32** %2
%10 = call i32 @fclose(i32* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [3 x i8] c"r+\00"
@SEEK_CUR = global i32 0
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = load i32, i32* @SEEK_CUR
%3 = tail call i32 @fseek(i32* %1, i32 2, i32 %2)
%4 = tail call i32 @fputc(i32 32, i32* %1)
%5 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ stab_delete(void *);
void stab_delete_cb(void *self) { stab_delete(self); }


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

x86 assembly (clang, -O2):
<stab_delete_cb>:
jmp    1030 <stab_delete@plt>

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

LLVM IR (-O2):
define void @stab_delete_cb(i8* %0) {
%2 = tail call i32 @stab_delete(i8* %0)
ret void
}
void fileNotFoundException(char file) {
  printf("ERROR\t\tFILE NOT FOUND EXCEPTION AT FILE %s", file);
}


x86 assembly (clang, -O0):
<fileNotFoundException>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%esi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [43 x i8] c"ERROR\09\09FILE NOT FOUND EXCEPTION AT FILE %s\00"
define void @fileNotFoundException(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"ERROR\09\09FILE NOT FOUND EXCEPTION AT FILE %s\00"
define void @fileNotFoundException(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int test_imm_36int64_highword_reg(long long val) {
  return ((val >> 32) & (0x36 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_36int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x36,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_36int64_highword_reg>:
movabs $0x3600000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_36int64_highword_reg(i64 %0) {
%2 = and i64 %0, 231928233984
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double randomn(double n) { return n * ((double)rand() / (double)RAND_MAX); }


x86 assembly (clang, -O0):
<randomn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
mov    0x2ea9(%rip),%rax
cvtsi2sdq (%rax),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomn>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm2
mov    0x2ebf(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm2
movsd  (%rsp),%xmm0
mulsd  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @randomn(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 (...) @rand()
%5 = sitofp i64 %4 to double
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to double
%8 = fdiv double %5, %7
%9 = fmul double %3, %8
ret double %9
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @randomn(double %0) {
%2 = tail call i64 (...) @rand()
%3 = sitofp i64 %2 to double
%4 = load i64, i64* @RAND_MAX
%5 = sitofp i64 %4 to double
%6 = fdiv double %3, %5
%7 = fmul double %6, %0
ret double %7
}
/* Variables and functions */
double log(int);
double Log2Plus1(double x) { return log(1 + x) / 0.69314718055994531; }


x86 assembly (clang, -O0):
<Log2Plus1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movsd  0xec5(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Log2Plus1>:
push   %rax
addsd  0xee7(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
divsd  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @Log2Plus1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double 1.000000e+00, %3
%5 = fptosi double %4 to i32
%6 = call double @log(i32 %5)
%7 = fdiv double %6, 0x3FE62E42FEFA39EF
ret double %7
}

LLVM IR (-O2):
define double @Log2Plus1(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fptosi double %2 to i32
%4 = tail call double @log(i32 %3)
%5 = fdiv double %4, 0x3FE62E42FEFA39EF
ret double %5
}
double get_centroid(double xp, double xm, int dim) {
  if (dim == 1)
    return 2.0 * (xp * xp + xp * xm + xm * xm) / (3.0 * (xp + xm));
  else
    return 0.5 * (xp + xm);
}


x86 assembly (clang, -O0):
<get_centroid>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jne    1179 <get_centroid+0x79>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xebf(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm2
addsd  -0x18(%rbp),%xmm2
movsd  0xea1(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1194 <get_centroid+0x94>
movsd  -0x10(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  0xe75(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_centroid>:
cmp    $0x1,%edi
jne    113a <get_centroid+0x3a>
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
addsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm3,%xmm1
addsd  %xmm1,%xmm1
mulsd  0xed7(%rip),%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret
addsd  %xmm1,%xmm0
mulsd  0xeba(%rip),%xmm0
ret

LLVM IR (-O0):
define double @get_centroid(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
store double %0, double* %5
store double %1, double* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %26
10: ; preds = %3
%11 = load double, double* %5
%12 = load double, double* %5
%13 = load double, double* %5
%14 = load double, double* %6
%15 = fmul double %13, %14
%16 = call double @llvm.fmuladd.f64(double %11, double %12, double %15)
%17 = load double, double* %6
%18 = load double, double* %6
%19 = call double @llvm.fmuladd.f64(double %17, double %18, double %16)
%20 = fmul double 2.000000e+00, %19
%21 = load double, double* %5
%22 = load double, double* %6
%23 = fadd double %21, %22
%24 = fmul double 3.000000e+00, %23
%25 = fdiv double %20, %24
store double %25, double* %4
br label %31
26: ; preds = %3
%27 = load double, double* %5
%28 = load double, double* %6
%29 = fadd double %27, %28
%30 = fmul double 5.000000e-01, %29
store double %30, double* %4
br label %31
31: ; preds = %26, %10
%32 = load double, double* %4
ret double %32
}

LLVM IR (-O2):
define double @get_centroid(double %0, double %1, i32 %2) {
%4 = icmp eq i32 %2, 1
br i1 %4, label %5, label %13
5: ; preds = %3
%6 = fmul double %0, %1
%7 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %6)
%8 = tail call double @llvm.fmuladd.f64(double %1, double %1, double %7)
%9 = fmul double %8, 2.000000e+00
%10 = fadd double %0, %1
%11 = fmul double %10, 3.000000e+00
%12 = fdiv double %9, %11
br label %16
13: ; preds = %3
%14 = fadd double %0, %1
%15 = fmul double %14, 5.000000e-01
br label %16
16: ; preds = %13, %5
%17 = phi double [ %12, %5 ], [ %15, %13 ]
ret double %17
}
/* Variables and functions */
int get_rn_int_simple();
int fget_rn_int_sim(void) { return get_rn_int_simple(); }


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

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

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

LLVM IR (-O2):
define i32 @fget_rn_int_sim() {
%1 = tail call i32 (...) @get_rn_int_simple()
ret i32 %1
}
/* Type definitions */
struct ipr_ses_config_pg {
  int dummy;
};

/* Variables and functions */
int ipr_elem_offset(struct ipr_ses_config_pg *, int);
int ipr_ses_elem_offset(struct ipr_ses_config_pg *ses_cfg) {
  return ipr_elem_offset(ses_cfg, 0x0E);
}


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

x86 assembly (clang, -O2):
<ipr_ses_elem_offset>:
mov    $0xe,%esi
jmp    1030 <ipr_elem_offset@plt>

LLVM IR (-O0):
%struct.ipr_ses_config_pg = type { i32 }
define i32 @ipr_ses_elem_offset(%struct.ipr_ses_config_pg* %0) {
%2 = alloca %struct.ipr_ses_config_pg*
store %struct.ipr_ses_config_pg* %0, %struct.ipr_ses_config_pg** %2
%3 = load %struct.ipr_ses_config_pg*, %struct.ipr_ses_config_pg** %2
%4 = call i32 @ipr_elem_offset(%struct.ipr_ses_config_pg* %3, i32 14)
ret i32 %4
}

LLVM IR (-O2):
%struct.ipr_ses_config_pg = type { i32 }
define i32 @ipr_ses_elem_offset(%struct.ipr_ses_config_pg* %0) {
%2 = tail call i32 @ipr_elem_offset(%struct.ipr_ses_config_pg* %0, i32 14)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned int myrand();
unsigned myrandmod(unsigned mod) {
  unsigned res;
  assert(mod >= 1);
  if (mod <= 1)
    return 0;
  res = myrand();
  res %= mod;
  return res;
}


x86 assembly (clang, -O0):
<myrandmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x1,-0x8(%rbp)
ja     1152 <myrandmod+0x32>
movl   $0x0,-0x4(%rbp)
jmp    116f <myrandmod+0x4f>
mov    $0x0,%al
call   1030 <myrand@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
xor    %edx,%edx
div    %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myrandmod>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
setne  %dil
call   1040 <assert@plt>
xor    %eax,%eax
cmp    $0x2,%ebx
jb     1144 <myrandmod+0x24>
xor    %eax,%eax
call   1030 <myrand@plt>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @myrandmod(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp uge i32 %5, 1
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %3
%10 = icmp ule i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 0, i32* %2
br label %18
12: ; preds = %1
%13 = call i32 (...) @myrand()
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = urem i32 %15, %14
store i32 %16, i32* %4
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %18
18: ; preds = %12, %11
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @myrandmod(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = icmp ult i32 %0, 2
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = tail call i32 (...) @myrand()
%8 = urem i32 %7, %0
br label %9
9: ; preds = %1, %6
%10 = phi i32 [ %8, %6 ], [ 0, %1 ]
ret i32 %10
}
/* Variables and functions */
int baz();
int bar(void) { return -21 + baz(); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <baz@plt>
add    $0xffffffeb,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
xor    %eax,%eax
call   1030 <baz@plt>
add    $0xffffffeb,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bar() {
%1 = call i32 (...) @baz()
%2 = add nsw i32 -21, %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 (...) @baz()
%2 = add nsw i32 %1, -21
ret i32 %2
}