xunge/DecIR huggingface dataset:
/* Variables and functions */
int shim_enosys(int /*<<< orphan*/, unsigned long, unsigned long);
int shim_pkey_alloc(unsigned long flags, unsigned long access_rights) {
  return shim_enosys(0, flags, access_rights);
}


x86 assembly (clang, -O0):
<shim_pkey_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_pkey_alloc>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i32 @shim_pkey_alloc(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 = call i32 @shim_enosys(i32 0, i64 %5, i64 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @shim_pkey_alloc(i64 %0, i64 %1) {
%3 = tail call i32 @shim_enosys(i32 0, i64 %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
int memcmp(void const *, void const *, int);
int compare_seen(const void *s1, const void *s2) { return memcmp(s1, s2, 20); }


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

x86 assembly (clang, -O2):
<compare_seen>:
mov    $0x14,%edx
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @compare_seen(i8* %0, i8* %1) {
%3 = tail call i32 @memcmp(i8* %0, i8* %1, i32 20)
ret i32 %3
}
void STOP() {}


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

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

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

LLVM IR (-O2):
define void @STOP() {
ret void
}
double v_mu2(double mu) { return mu * mu; }


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

x86 assembly (clang, -O2):
<v_mu2>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @v_mu2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @v_mu2(double %0) {
%2 = fmul double %0, %0
ret double %2
}
add(a, b) {
  before();
  return a + b;
}


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

x86 assembly (clang, -O2):
<add>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <before@plt>
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = tail call i32 (...) @before()
%4 = add nsw i32 %1, %0
ret i32 %4
}
/* Type definitions */
struct game {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ move_left(struct game *);
int /*<<< orphan*/ rotate_clockwise(struct game *);
void move_down(struct game *game) {
  rotate_clockwise(game);
  move_left(game);
  rotate_clockwise(game);
  rotate_clockwise(game);
  rotate_clockwise(game);
}


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

x86 assembly (clang, -O2):
<move_down>:
push   %rbx
mov    %rdi,%rbx
call   1040 <rotate_clockwise@plt>
mov    %rbx,%rdi
call   1030 <move_left@plt>
mov    %rbx,%rdi
call   1040 <rotate_clockwise@plt>
mov    %rbx,%rdi
call   1040 <rotate_clockwise@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <rotate_clockwise@plt>

LLVM IR (-O0):
%struct.game = type { i32 }
define void @move_down(%struct.game* %0) {
%2 = alloca %struct.game*
store %struct.game* %0, %struct.game** %2
%3 = load %struct.game*, %struct.game** %2
%4 = call i32 @rotate_clockwise(%struct.game* %3)
%5 = load %struct.game*, %struct.game** %2
%6 = call i32 @move_left(%struct.game* %5)
%7 = load %struct.game*, %struct.game** %2
%8 = call i32 @rotate_clockwise(%struct.game* %7)
%9 = load %struct.game*, %struct.game** %2
%10 = call i32 @rotate_clockwise(%struct.game* %9)
%11 = load %struct.game*, %struct.game** %2
%12 = call i32 @rotate_clockwise(%struct.game* %11)
ret void
}

LLVM IR (-O2):
%struct.game = type { i32 }
define void @move_down(%struct.game* %0) {
%2 = tail call i32 @rotate_clockwise(%struct.game* %0)
%3 = tail call i32 @move_left(%struct.game* %0)
%4 = tail call i32 @rotate_clockwise(%struct.game* %0)
%5 = tail call i32 @rotate_clockwise(%struct.game* %0)
%6 = tail call i32 @rotate_clockwise(%struct.game* %0)
ret void
}
int delete_ifile(unsigned int inumber) {
  int status;
  status = delete_inode(inumber);
  fatal(status != (0), __func__, "unable to delete inode");
  return (0);
}


x86 assembly (clang, -O0):
<delete_ifile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <delete_inode@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
lea    0xeb5(%rip),%rsi
lea    0xebb(%rip),%rdx
mov    $0x0,%al
call   1040 <fatal@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_ifile>:
push   %rax
xor    %eax,%eax
call   1030 <delete_inode@plt>
xor    %edi,%edi
test   %eax,%eax
setne  %dil
lea    0xec9(%rip),%rsi
lea    0xecf(%rip),%rdx
xor    %eax,%eax
call   1040 <fatal@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__func__.delete_ifile = [13 x i8] c"delete_ifile\00"
@.str = [23 x i8] c"unable to delete inode\00"
define i32 @delete_ifile(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @delete_inode to i32 (i32, ...)*)(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @fatal to i32 (i32, i8*, i8*, ...)*)(i32 %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.delete_ifile, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__func__.delete_ifile = [13 x i8] c"delete_ifile\00"
@.str = [23 x i8] c"unable to delete inode\00"
define i32 @delete_ifile(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @delete_inode to i32 (i32, ...)*)(i32 %0)
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @fatal to i32 (i32, i8*, i8*, ...)*)(i32 %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.delete_ifile, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void gfun(void) {
  struct a3 {
    int e6, e7;
    char e8;
  };
}


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

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

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

LLVM IR (-O2):
define void @gfun() {
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
scalar_t__ bind(int, struct sockaddr *, int /*<<< orphan*/);
int /*<<< orphan*/ err_quit(char *);
void Bind(int sockfd, const struct sockaddr_in *addr, socklen_t len) {
  if (bind(sockfd, (struct sockaddr *)addr, len) < 0)
    err_quit("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_quit@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_quit@plt>

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

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [11 x i8] c"bind error\00"
define void @Bind(i32 %0, %struct.sockaddr_in* %1, i32 %2) {
%4 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%5 = tail call i64 @bind(i32 %0, %struct.sockaddr* %4, i32 %2)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @err_quit(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
ret void
}
char *getName() { return "load"; }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"load\00"
define i8* @getName() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"load\00"
define i8* @getName() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ core4_print(char *, char const *);
void U_EMRSCALEWINDOWEXTEX_print(const char *contents) {
  core4_print("U_EMRSCALEWINDOWEXTEX", contents);
}


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

x86 assembly (clang, -O2):
<U_EMRSCALEWINDOWEXTEX_print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <core4_print@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"U_EMRSCALEWINDOWEXTEX\00"
define void @U_EMRSCALEWINDOWEXTEX_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @core4_print(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"U_EMRSCALEWINDOWEXTEX\00"
define void @U_EMRSCALEWINDOWEXTEX_print(i8* %0) {
%2 = tail call i32 @core4_print(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aroma_touch_memaddr(void *, size_t, long, char *);
int /*<<< orphan*/ aroma_unlink_memaddr(void *);
void *realloc(void *, size_t);
void *aroma_realloc(void *x, size_t size, long line, char *filename) {
  aroma_unlink_memaddr(x);
  void *ret = realloc(x, size);
  aroma_touch_memaddr(ret, size, line, filename);
  return ret;
}


x86 assembly (clang, -O0):
<aroma_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <aroma_unlink_memaddr@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <aroma_touch_memaddr@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aroma_realloc>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
call   1030 <aroma_unlink_memaddr@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <realloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1040 <aroma_touch_memaddr@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @aroma_realloc(i8* %0, i64 %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%10 = load i8*, i8** %5
%11 = call i32 @aroma_unlink_memaddr(i8* %10)
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i8* @realloc(i8* %12, i64 %13)
store i8* %14, i8** %9
%15 = load i8*, i8** %9
%16 = load i64, i64* %6
%17 = load i64, i64* %7
%18 = load i8*, i8** %8
%19 = call i32 @aroma_touch_memaddr(i8* %15, i64 %16, i64 %17, i8* %18)
%20 = load i8*, i8** %9
ret i8* %20
}

LLVM IR (-O2):
define i8* @aroma_realloc(i8* %0, i64 %1, i64 %2, i8* %3) {
%5 = tail call i32 @aroma_unlink_memaddr(i8* %0)
%6 = tail call i8* @realloc(i8* %0, i64 %1)
%7 = tail call i32 @aroma_touch_memaddr(i8* %6, i64 %1, i64 %2, i8* %3)
ret i8* %6
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ bell_pitch;
};
typedef TYPE_1__ XKeyboardControl;

/* Variables and functions */
int get_XKeyboardControl_bell_pitch(void *_p) {
  return (int)((XKeyboardControl *)_p)->bell_pitch;
}


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

x86 assembly (clang, -O2):
<get_XKeyboardControl_bell_pitch>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XKeyboardControl_bell_pitch(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
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XKeyboardControl_bell_pitch(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mem_reverse(void *, int, size_t);
size_t mem_endianness_reverse(void *mem, size_t elem_size, size_t elem_num) {
  if (!mem_reverse(mem, 1, elem_size * elem_num))
    return 0;
  return elem_num;
}


x86 assembly (clang, -O0):
<mem_endianness_reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
imul   -0x20(%rbp),%rdx
mov    $0x1,%esi
call   1030 <mem_reverse@plt>
cmp    $0x0,%eax
jne    1151 <mem_endianness_reverse+0x41>
movq   $0x0,-0x8(%rbp)
jmp    1159 <mem_endianness_reverse+0x49>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_endianness_reverse>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rdx
imul   %rbx,%rdx
mov    $0x1,%esi
call   1030 <mem_reverse@plt>
xor    %ecx,%ecx
test   %eax,%eax
cmovne %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @mem_endianness_reverse(i8* %0, i64 %1, i64 %2) {
%4 = mul i64 %2, %1
%5 = tail call i32 @mem_reverse(i8* %0, i32 1, i64 %4)
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i64 0, i64 %2
ret i64 %7
}
void ff_hevc_put_hevc_qpel_hv16_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_hv16_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char const *);
void foo(const char *input) {
  char buf[10];
  printf("My stack looks like:\n%p\n%p\n%p\n%p\n%p\n% p\n\n");
  strcpy(buf, input);
  printf("%s\n", buf);
  printf("Now the stack looks like:\n%p\n%p\n%p\n%p\n%p\n%p\n\n");
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x12(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x12(%rbp),%rsi
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [42 x i8] c"My stack looks like:\0A%p\0A%p\0A%p\0A%p\0A%p\0A% p\0A\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [46 x i8] c"Now the stack looks like:\0A%p\0A%p\0A%p\0A%p\0A%p\0A%p\0A\0A\00"
define void @foo(i8* %0) {
%2 = alloca i8*
%3 = alloca [10 x i8]
store i8* %0, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @strcpy(i8* %5, i8* %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"My stack looks like:\0A%p\0A%p\0A%p\0A%p\0A%p\0A% p\0A\0A\00"
@.str.2 = [46 x i8] c"Now the stack looks like:\0A%p\0A%p\0A%p\0A%p\0A%p\0A%p\0A\0A\00"
define void @foo(i8* %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @strcpy(i8* %3, i8* %0)
%6 = call i32 @puts(i8* %3)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_PKEY_CTX;

/* Variables and functions */
int pkey_gost_paramgen_init(EVP_PKEY_CTX *ctx) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @pkey_gost_paramgen_init(i32* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
scalar_t__ matchColorName(char const **);
scalar_t__ matchHexColor(char const **);
scalar_t__ matchRgbColor(char const **);
int matchColor(const char **strptr) {
  return (matchHexColor(strptr) || matchRgbColor(strptr) ||
          matchColorName(strptr));
}


x86 assembly (clang, -O0):
<matchColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <matchHexColor@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1185 <matchColor+0x55>
mov    -0x8(%rbp),%rdi
call   1040 <matchRgbColor@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1185 <matchColor+0x55>
mov    -0x8(%rbp),%rdi
call   1050 <matchColorName@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matchColor>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <matchHexColor@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    1163 <matchColor+0x33>
mov    %rbx,%rdi
call   1040 <matchRgbColor@plt>
test   %rax,%rax
jne    1163 <matchColor+0x33>
mov    %rbx,%rdi
call   1050 <matchColorName@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @matchColor(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = call i64 @matchHexColor(i8** %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8**, i8*** %2
%8 = call i64 @matchRgbColor(i8** %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8**, i8*** %2
%12 = call i64 @matchColorName(i8** %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @matchColor(i8** %0) {
%2 = tail call i64 @matchHexColor(i8** %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i64 @matchRgbColor(i8** %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i64 @matchColorName(i8** %0)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %4 ], [ 1, %1 ], [ %10, %7 ]
ret i32 %12
}
void *render_string(char *str, void *dest) {
  int len = strlen(str);
  memmove(dest, str, len);
  return (unsigned char *)dest + len;
}


x86 assembly (clang, -O0):
<render_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x14(%rbp),%rdx
call   1040 <memmove@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<render_string>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
movslq %eax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memmove@plt>
add    %r15,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @render_string(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = load i8*, i8** %3
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
ret i8* %16
}

LLVM IR (-O2):
define i8* @render_string(i8* nocapture %0, i8* writeonly %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = shl i64 %3, 32
%5 = ashr exact i64 %4, 32
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 %0, i64 %5, i1 false)
%6 = getelementptr inbounds i8, i8* %1, i64 %5
ret i8* %6
}
int f1(int x) {
  switch (x) {
  case 17:
    return 12;
  default:
    break;
  }
  int array[x * 17 + 3];
  return x * 2;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x11,%eax
jne    1128 <f1+0x28>
jmp    111c <f1+0x1c>
movl   $0xc,-0x4(%rbp)
jmp    1151 <f1+0x51>
jmp    112d <f1+0x2d>
imul   $0x11,-0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
lea    (%rdi,%rdi,1),%ecx
cmp    $0x11,%edi
mov    $0xc,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i32 %0, i32* %3
%6 = load i32, i32* %3
switch i32 %6, label %8 [
i32 17, label %7
]
7: ; preds = %1
store i32 12, i32* %2
br label %19
8: ; preds = %1
br label %9
9: ; preds = %8
%10 = load i32, i32* %3
%11 = mul nsw i32 %10, 17
%12 = add nsw i32 %11, 3
%13 = zext i32 %12 to i64
%14 = call i8* @llvm.stacksave()
store i8* %14, i8** %4
%15 = alloca i32, i64 %13
store i64 %13, i64* %5
%16 = load i32, i32* %3
%17 = mul nsw i32 %16, 2
store i32 %17, i32* %2
%18 = load i8*, i8** %4
br label %19
19: ; preds = %9, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = icmp eq i32 %0, 17
%3 = shl nsw i32 %0, 1
%4 = select i1 %2, i32 12, i32 %3
ret i32 %4
}
void ff_hevc_v_loop_filter_luma_12_avx() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_v_loop_filter_luma_12_avx() {
ret void
}
unsigned short scanword(char **ptr) {
  unsigned short val;
  if (*(*ptr) & 1) {
    val = (*(unsigned short *)*ptr) >> 1;
    *ptr += 2;
  } else {
    val = (*(unsigned char *)*ptr) >> 1;
    *ptr += 1;
  }
  return val;
}


x86 assembly (clang, -O0):
<scanword>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1142 <scanword+0x42>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzwl (%rax),%eax
sar    $0x1,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
jmp    1161 <scanword+0x61>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl (%rax),%eax
sar    $0x1,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scanword>:
mov    (%rdi),%rcx
movzbl (%rcx),%eax
test   $0x1,%al
jne    1116 <scanword+0x16>
movzwl %ax,%eax
shr    %eax
mov    $0x1,%edx
jmp    1120 <scanword+0x20>
movzwl (%rcx),%eax
shr    %eax
mov    $0x2,%edx
add    %rdx,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define zeroext i16 @scanword(i8** %0) {
%2 = alloca i8**
%3 = alloca i16
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = and i32 %7, 1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %1
%11 = load i8**, i8*** %2
%12 = load i8*, i8** %11
%13 = bitcast i8* %12 to i16*
%14 = load i16, i16* %13
%15 = zext i16 %14 to i32
%16 = ashr i32 %15, 1
%17 = trunc i32 %16 to i16
store i16 %17, i16* %3
%18 = load i8**, i8*** %2
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8, i8* %19, i64 2
store i8* %20, i8** %18
br label %31
21: ; preds = %1
%22 = load i8**, i8*** %2
%23 = load i8*, i8** %22
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = ashr i32 %25, 1
%27 = trunc i32 %26 to i16
store i16 %27, i16* %3
%28 = load i8**, i8*** %2
%29 = load i8*, i8** %28
%30 = getelementptr inbounds i8, i8* %29, i64 1
store i8* %30, i8** %28
br label %31
31: ; preds = %21, %10
%32 = load i16, i16* %3
ret i16 %32
}

LLVM IR (-O2):
define zeroext i16 @scanword(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = and i8 %3, 1
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = bitcast i8* %2 to i16*
%8 = load i16, i16* %7
%9 = lshr i16 %8, 1
br label %13
10: ; preds = %1
%11 = lshr i8 %3, 1
%12 = zext i8 %11 to i16
br label %13
13: ; preds = %10, %6
%14 = phi i64 [ 1, %10 ], [ 2, %6 ]
%15 = phi i16 [ %12, %10 ], [ %9, %6 ]
%16 = getelementptr inbounds i8, i8* %2, i64 %14
store i8* %16, i8** %0
ret i16 %15
}
/* Variables and functions */
int /*<<< orphan*/ AccelDesiredHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void AccelDesiredUpdated() { UAVObjUpdated(AccelDesiredHandle()); }


x86 assembly (clang, -O0):
<AccelDesiredUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <AccelDesiredHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AccelDesiredUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <AccelDesiredHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @AccelDesiredUpdated() {
%1 = call i32 (...) @AccelDesiredHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AccelDesiredUpdated() {
%1 = tail call i32 (...) @AccelDesiredHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
int Emptied(int i, double **delta) { return ((int)delta[i][0]); }


x86 assembly (clang, -O0):
<Emptied>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cvttsd2si (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Emptied>:
movslq %edi,%rax
mov    (%rsi,%rax,8),%rax
cvttsd2si (%rax),%eax
ret

LLVM IR (-O0):
define i32 @Emptied(i32 %0, double** %1) {
%3 = alloca i32
%4 = alloca double**
store i32 %0, i32* %3
store double** %1, double*** %4
%5 = load double**, double*** %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds double*, double** %5, i64 %7
%9 = load double*, double** %8
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = fptosi double %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @Emptied(i32 %0, double** nocapture %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds double*, double** %1, i64 %3
%5 = load double*, double** %4
%6 = load double, double* %5
%7 = fptosi double %6 to i32
ret i32 %7
}
/* Variables and functions */
int atoi(char const *);
void parse_pin(int *port, int *pin, const char *name) {
  if (*name == 'P')
    name++;
  *port = *name++ - 'A';
  *pin = atoi(name);
}


x86 assembly (clang, -O0):
<parse_pin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x50,%eax
jne    1140 <parse_pin+0x30>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%ecx
sub    $0x41,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_pin>:
push   %rbx
mov    %rsi,%rbx
xor    %ecx,%ecx
cmpb   $0x50,(%rdx)
sete   %cl
lea    (%rdx,%rcx,1),%rax
add    $0x1,%rax
movsbl (%rdx,%rcx,1),%ecx
add    $0xffffffbf,%ecx
mov    %ecx,(%rdi)
mov    %rax,%rdi
call   1030 <atoi@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @parse_pin(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i8* nocapture %2) {
%4 = load i8, i8* %2
%5 = icmp eq i8 %4, 80
%6 = zext i1 %5 to i64
%7 = getelementptr i8, i8* %2, i64 %6
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = add nsw i32 %10, -65
store i32 %11, i32* %0
%12 = tail call i32 @atoi(i8* %8)
store i32 %12, i32* %1
ret void
}
void push_variable_to_stack(char *text_section, char *text) {}


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

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

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

LLVM IR (-O2):
define void @push_variable_to_stack(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f1();
int /*<<< orphan*/ f2();
int main(void) {
  f1();
  f2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f1()
%2 = tail call i32 (...) @f2()
ret i32 0
}
unsigned long xnarch_atomic_xchg(volatile void *ptr, unsigned long x) {
  __asm__ __volatile__("xchgq %0,%1"
                       : "=r"(x)
                       : "m"(*((volatile long *)(ptr))), "0"(x)
                       : "memory");
  return x;
}


x86 assembly (clang, -O0):
<xnarch_atomic_xchg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
xchg   %rax,(%rcx)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @xnarch_atomic_xchg(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %4
%8 = call i64 asm sideeffect "xchgq $0,$1", "=r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i64 %7)
store i64 %8, i64* %4
%9 = load i64, i64* %4
ret i64 %9
}

LLVM IR (-O2):
define i64 @xnarch_atomic_xchg(i8* %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
%4 = tail call i64 asm sideeffect "xchgq $0,$1", "=r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %3, i64 %1)
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ EPOLLIN;
int /*<<< orphan*/ EPOLLOUT;
uint32_t mg_epf_to_evflags(unsigned int epf) {
  uint32_t result = 0;
  if (epf & (1 << 0))
    result |= EPOLLIN;
  if (epf & (1 << 1))
    result |= EPOLLOUT;
  return result;
}


x86 assembly (clang, -O0):
<mg_epf_to_evflags>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     112c <mg_epf_to_evflags+0x2c>
mov    0x2ec4(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     114a <mg_epf_to_evflags+0x4a>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_epf_to_evflags>:
mov    %edi,%eax
and    $0x1,%eax
neg    %eax
mov    0x2eda(%rip),%rcx
and    (%rcx),%eax
shl    $0x1e,%edi
sar    $0x1f,%edi
mov    0x2ebb(%rip),%rcx
and    (%rcx),%edi
or     %edi,%eax
ret

LLVM IR (-O0):
@EPOLLIN = global i32 0
@EPOLLOUT = global i32 0
define i32 @mg_epf_to_evflags(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* @EPOLLIN
%9 = load i32, i32* %3
%10 = or i32 %9, %8
store i32 %10, i32* %3
br label %11
11: ; preds = %7, %1
%12 = load i32, i32* %2
%13 = and i32 %12, 2
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i32, i32* @EPOLLOUT
%17 = load i32, i32* %3
%18 = or i32 %17, %16
store i32 %18, i32* %3
br label %19
19: ; preds = %15, %11
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@EPOLLIN = global i32 0
@EPOLLOUT = global i32 0
define i32 @mg_epf_to_evflags(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = load i32, i32* @EPOLLIN
%5 = select i1 %3, i32 0, i32 %4
%6 = and i32 %0, 2
%7 = icmp eq i32 %6, 0
%8 = load i32, i32* @EPOLLOUT
%9 = select i1 %7, i32 0, i32 %8
%10 = or i32 %9, %5
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *remove_ext(char *, char, char);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void change_ext(char *input, char *output, char *ext) {
  char *tmp_file;
  if (!strcmp(output, "")) {
    tmp_file = remove_ext(input, '.', '/');
    strcpy(output, tmp_file);
    strcat(output, ext);
    free(tmp_file);
  }
}


x86 assembly (clang, -O0):
<change_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    11b7 <change_ext+0x67>
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
mov    $0x2f,%edx
call   1050 <remove_ext@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1070 <strcat@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_ext>:
push   %r15
push   %r14
push   %rbx
cmpb   $0x0,(%rsi)
je     1150 <change_ext+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %rdx,%r14
mov    %rsi,%rbx
mov    $0x2e,%esi
mov    $0x2f,%edx
call   1050 <remove_ext@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @change_ext(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %5
%9 = call i32 @strcmp(i8* %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i32 %9, 0
br i1 %10, label %22, label %11
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = call i8* @remove_ext(i8* %12, i8 signext 46, i8 signext 47)
store i8* %13, i8** %7
%14 = load i8*, i8** %5
%15 = load i8*, i8** %7
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %5
%18 = load i8*, i8** %6
%19 = call i32 @strcat(i8* %17, i8* %18)
%20 = load i8*, i8** %7
%21 = call i32 @free(i8* %20)
br label %22
22: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @change_ext(i8* %0, i8* %1, i8* %2) {
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = tail call i8* @remove_ext(i8* %0, i8 signext 46, i8 signext 47)
%8 = tail call i32 @strcpy(i8* %1, i8* %7)
%9 = tail call i32 @strcat(i8* %1, i8* %2)
%10 = tail call i32 @free(i8* %7)
br label %11
11: ; preds = %6, %3
ret void
}
/* Type definitions */
struct delete_args_info {
  int dummy;
};

/* Variables and functions */
int delete_cmdline_parser2(int, char **, struct delete_args_info *,
                           int /*<<< orphan*/, int, int);
int delete_cmdline_parser(int argc, char **argv,
                          struct delete_args_info *args_info) {
  return delete_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<delete_cmdline_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <delete_cmdline_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_cmdline_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <delete_cmdline_parser2@plt>

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

LLVM IR (-O2):
%struct.delete_args_info = type { i32 }
define i32 @delete_cmdline_parser(i32 %0, i8** %1, %struct.delete_args_info* %2) {
%4 = tail call i32 @delete_cmdline_parser2(i32 %0, i8** %1, %struct.delete_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sleep(int);
void *thread_entry(void *ptr) {
  char *name = (char *)ptr;
  printf("%s-A\n", name);
  sleep(1);
  printf("%s-B\n", name);
  sleep(1);
  printf("%s-C\n", name);
}


x86 assembly (clang, -O0):
<thread_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    -0x18(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    -0x18(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_entry>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xeaf(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s-A\0A\00"
@.str.1 = [6 x i8] c"%s-B\0A\00"
@.str.2 = [6 x i8] c"%s-C\0A\00"
define i8* @thread_entry(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 @sleep(i32 1)
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 @sleep(i32 1)
%12 = load i8*, i8** %4
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s-A\0A\00"
@.str.1 = [6 x i8] c"%s-B\0A\00"
@.str.2 = [6 x i8] c"%s-C\0A\00"
define noalias i8* @thread_entry(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @sleep(i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 @sleep(i32 1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ bswap_16(int /*<<< orphan*/);
uint16_t htobe16(uint16_t host_16bits) { return bswap_16(host_16bits); }


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

x86 assembly (clang, -O2):
<htobe16>:
jmp    1030 <bswap_16@plt>

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

LLVM IR (-O2):
define i32 @htobe16(i32 %0) {
%2 = tail call i32 @bswap_16(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int send(int, char const *, size_t, int);
ssize_t socket_send(int sock, const char *data, size_t size, int flags) {
  ssize_t sendSize;
  if ((sendSize = send(sock, data, size, flags)) < 0) {
    perror("socket_send() -> send()");
    return -1;
  }
  return sendSize;
}


x86 assembly (clang, -O0):
<socket_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <send@plt>
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jge    116d <socket_send+0x4d>
lea    0xea4(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <socket_send+0x53>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_send>:
push   %rax
call   1030 <send@plt>
test   %eax,%eax
js     112c <socket_send+0xc>
pop    %rcx
ret
lea    0xecd(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"socket_send() -> send()\00"
define i32 @socket_send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i32 %3, i32* %9
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i32, i32* %9
%15 = call i32 @send(i32 %11, i8* %12, i64 %13, i32 %14)
store i32 %15, i32* %10
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %4
%18 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %5
br label %21
19: ; preds = %4
%20 = load i32, i32* %10
store i32 %20, i32* %5
br label %21
21: ; preds = %19, %17
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
@.str = [24 x i8] c"socket_send() -> send()\00"
define i32 @socket_send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @send(i32 %0, i8* %1, i64 %2, i32 %3)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ -1, %7 ], [ %5, %4 ]
ret i32 %10
}