xunge/DecIR huggingface dataset:
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_new_method_call(void *bus, void **m, const char *destination,
                               const char *path, const char *interface,
                               const char *member) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_new_method_call>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
mov    0x2ebb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_new_method_call>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_new_method_call(i8* nocapture readnone %0, i8** nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}
void avpicture_layout() {}


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

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

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

LLVM IR (-O2):
define void @avpicture_layout() {
ret void
}
/* Variables and functions */
unsigned long get_dscr();
unsigned long get_dscr_usr();
int /*<<< orphan*/ printf(char *, char *, unsigned long, unsigned long);
int check_dscr(char *str) {
  unsigned long cur_dscr, cur_dscr_usr;
  cur_dscr = get_dscr();
  cur_dscr_usr = get_dscr_usr();
  if (cur_dscr != cur_dscr_usr) {
    printf("%s set, kernel get %lx != user get %lx\n", str, cur_dscr,
           cur_dscr_usr);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_dscr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <get_dscr@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <get_dscr_usr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     1184 <check_dscr+0x54>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    118b <check_dscr+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_dscr>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <get_dscr@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <get_dscr_usr@plt>
cmp    %rax,%rbx
je     1169 <check_dscr+0x39>
lea    0xeaa(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <printf@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"%s set, kernel get %lx != user get %lx\0A\00"
define i32 @check_dscr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
%6 = call i64 (...) @get_dscr()
store i64 %6, i64* %4
%7 = call i64 (...) @get_dscr_usr()
store i64 %7, i64* %5
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = load i64, i64* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %12, i64 %13, i64 %14)
store i32 1, i32* %2
br label %17
16: ; preds = %1
store i32 0, i32* %2
br label %17
17: ; preds = %16, %11
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [40 x i8] c"%s set, kernel get %lx != user get %lx\0A\00"
define i32 @check_dscr(i8* %0) {
%2 = tail call i64 (...) @get_dscr()
%3 = tail call i64 (...) @get_dscr_usr()
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %2, i64 %3)
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ 1, %5 ], [ 0, %1 ]
ret i32 %8
}
void dispatcher(void (*funptr)(int)) { funptr(1); }


x86 assembly (clang, -O0):
<dispatcher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispatcher>:
mov    %rdi,%rax
mov    $0x1,%edi
jmp    *%rax

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

LLVM IR (-O2):
define void @dispatcher(void (i32)* nocapture %0) {
tail call void %0(i32 1)
ret void
}
void SSMR3Close(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3Close() {
ret void
}
/* Variables and functions */
size_t cl_lzo_compress_output_len(size_t uncomp_len) {
  return uncomp_len + (uncomp_len / 16) + 64 + 3 + 1;
}


x86 assembly (clang, -O0):
<cl_lzo_compress_output_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x4,%rcx
add    %rcx,%rax
add    $0x40,%rax
add    $0x3,%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cl_lzo_compress_output_len>:
mov    %rdi,%rax
shr    $0x4,%rax
add    %rdi,%rax
add    $0x44,%rax
ret

LLVM IR (-O0):
define i64 @cl_lzo_compress_output_len(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = udiv i64 %4, 16
%6 = add i64 %3, %5
%7 = add i64 %6, 64
%8 = add i64 %7, 3
%9 = add i64 %8, 1
ret i64 %9
}

LLVM IR (-O2):
define i64 @cl_lzo_compress_output_len(i64 %0) {
%2 = lshr i64 %0, 4
%3 = add i64 %0, 68
%4 = add i64 %3, %2
ret i64 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int ispow2_32(uint32_t n) { return (n & (n - 1)) == 0; }


x86 assembly (clang, -O0):
<ispow2_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispow2_32>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @ispow2_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ispow2_32(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int __socketcall(int, unsigned long *);
int getpeername(int sockfd, struct sockaddr *addr, socklen_t *paddrlen) {
  unsigned long args[3];
  args[0] = sockfd;
  args[1] = (unsigned long)addr;
  args[2] = (unsigned long)paddrlen;
  return __socketcall(7, args);
}


x86 assembly (clang, -O0):
<getpeername>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x30(%rbp),%rsi
mov    $0x7,%edi
call   1030 <__socketcall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpeername>:
sub    $0x18,%rsp
movslq %edi,%rax
mov    %rax,(%rsp)
mov    %rsi,0x8(%rsp)
mov    %rdx,0x10(%rsp)
mov    %rsp,%rsi
mov    $0x7,%edi
call   1030 <__socketcall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @getpeername(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
%7 = alloca [3 x i64]
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 0
store i64 %9, i64* %10
%11 = load %struct.sockaddr*, %struct.sockaddr** %5
%12 = ptrtoint %struct.sockaddr* %11 to i64
%13 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 1
store i64 %12, i64* %13
%14 = load i32*, i32** %6
%15 = ptrtoint i32* %14 to i64
%16 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 2
store i64 %15, i64* %16
%17 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 0
%18 = call i32 @__socketcall(i32 7, i64* %17)
ret i32 %18
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @getpeername(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca [3 x i64]
%5 = bitcast [3 x i64]* %4 to i8*
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 0
store i64 %6, i64* %7
%8 = ptrtoint %struct.sockaddr* %1 to i64
%9 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 1
store i64 %8, i64* %9
%10 = ptrtoint i32* %2 to i64
%11 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 2
store i64 %10, i64* %11
%12 = call i32 @__socketcall(i32 7, i64* %7)
ret i32 %12
}
void ftrace_nmi_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @ftrace_nmi_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int /*<<< orphan*/ triple_from_id(int, int, int *, int *, int *);
void print_triple(int n, int id) {
  int a = 0, b = 0, c = 0;
  triple_from_id(n, id, &a, &b, &c);
  printf("id:%d (%d, %d, %d)\n", id, a, b, c);
}


x86 assembly (clang, -O0):
<print_triple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <triple_from_id@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_triple>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r8
call   1030 <triple_from_id@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    0x4(%rsp),%r8d
lea    0xe99(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"id:%d (%d, %d, %d)\0A\00"
define void @print_triple(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @triple_from_id(i32 %8, i32 %9, i32* %5, i32* %6, i32* %7)
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %13, i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"id:%d (%d, %d, %d)\0A\00"
define void @print_triple(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%8 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%9 = call i32 @triple_from_id(i32 %0, i32 %1, i32* %3, i32* %4, i32* %5)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %10, i32 %11, i32 %12)
ret void
}
int test_imm_68uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x68 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_68uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 104
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int errno;
void xclosedir(DIR **d) {
  assert(d != NULL);
  if (*d) {
    int tmp_errno = errno;
    (void)closedir(*d);
    errno = tmp_errno;
  }
}


x86 assembly (clang, -O0):
<xclosedir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1170 <xclosedir+0x50>
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <closedir@plt>
mov    -0xc(%rbp),%ecx
mov    0x2e72(%rip),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xclosedir>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    (%rbx),%rdi
test   %rdi,%rdi
je     114c <xclosedir+0x2c>
mov    0x2e9d(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <closedir@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define void @xclosedir(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = icmp ne i32** %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32**, i32*** %2
%9 = load i32*, i32** %8
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %17
11: ; preds = %1
%12 = load i32, i32* @errno
store i32 %12, i32* %3
%13 = load i32**, i32*** %2
%14 = load i32*, i32** %13
%15 = call i32 @closedir(i32* %14)
%16 = load i32, i32* %3
store i32 %16, i32* @errno
br label %17
17: ; preds = %11, %1
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @xclosedir(i32** %0) {
%2 = icmp ne i32** %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i32*, i32** %0
%6 = icmp eq i32* %5, null
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* @errno
%9 = tail call i32 @closedir(i32* %5)
store i32 %8, i32* @errno
br label %10
10: ; preds = %7, %1
ret void
}
void swap(int *a, int *b) {
  int aux;
  aux = *a;
  *a = *b;
  *b = aux;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
int share__getopt_long_only(argc, argv, options, long_options, opt_index)
int argc;
char *const *argv;
const char *options;
const struct share__option *long_options;
int *opt_index;
{
  return share___getopt_internal(argc, argv, options, long_options, opt_index,
                                 1);
}


x86 assembly (clang, -O0):
<share__getopt_long_only>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x1,%r9d
mov    $0x0,%al
call   1030 <share___getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<share__getopt_long_only>:
mov    $0x1,%r9d
xor    %eax,%eax
jmp    1030 <share___getopt_internal@plt>

LLVM IR (-O0):
%struct.share__option = type opaque
define i32 @share__getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.share__option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.share__option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.share__option* %3, %struct.share__option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.share__option*, %struct.share__option** %9
%15 = load i32*, i32** %10
%16 = call i32 (i32, i8**, i8*, %struct.share__option*, i32*, i32, ...) bitcast (i32 (...)* @share___getopt_internal to i32 (i32, i8**, i8*, %struct.share__option*, i32*, i32, ...)*)(i32 %11, i8** %12, i8* %13, %struct.share__option* %14, i32* %15, i32 1)
ret i32 %16
}

LLVM IR (-O2):
%struct.share__option = type opaque
define i32 @share__getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.share__option* %3, i32* %4) {
%6 = tail call i32 (i32, i8**, i8*, %struct.share__option*, i32*, i32, ...) bitcast (i32 (...)* @share___getopt_internal to i32 (i32, i8**, i8*, %struct.share__option*, i32*, i32, ...)*)(i32 %0, i8** %1, i8* %2, %struct.share__option* %3, i32* %4, i32 1)
ret i32 %6
}
OP(dd, fd) {
  illegal_1();
  op_fd();
}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_fd()
ret i32 undef
}
int rnn2d_lstm_input_nelem(const int H, const int W, const int N, const int K) {
  return H * W * N * K;
}


x86 assembly (clang, -O0):
<rnn2d_lstm_input_nelem>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnn2d_lstm_input_nelem>:
mov    %edx,%eax
imul   %esi,%edi
imul   %ecx,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @rnn2d_lstm_input_nelem(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %1, %0
%6 = mul nsw i32 %5, %2
%7 = mul nsw i32 %6, %3
ret i32 %7
}
int length_of(char *s) {
  int i;
  for (i = 0; s[i] != '\0'; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<length_of>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <length_of+0x37>
jmp    1129 <length_of+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <length_of+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length_of>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <length_of+0x10>
ret

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

LLVM IR (-O2):
define i32 @length_of(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
__attribute__((no)) __complex__ float give_neg1(void) {
  __complex__ float res;
  __real__ res = -1.0;
  __imag__ res = 1.0;
  return res;
}


x86 assembly (clang, -O0):
<give_neg1>:
push   %rbp
mov    %rsp,%rbp
movl   $0xbf800000,-0x10(%rbp)
movl   $0x3f800000,-0xc(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<give_neg1>:
movaps 0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define <2 x float> @give_neg1() {
%1 = alloca { float, float }
%2 = alloca { float, float }
%3 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
store float -1.000000e+00, float* %3
%4 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
store float 1.000000e+00, float* %4
%5 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%6 = load float, float* %5
%7 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%8 = load float, float* %7
%9 = getelementptr inbounds { float, float }, { float, float }* %1, i32 0, i32 0
%10 = getelementptr inbounds { float, float }, { float, float }* %1, i32 0, i32 1
store float %6, float* %9
store float %8, float* %10
%11 = bitcast { float, float }* %1 to <2 x float>*
%12 = load <2 x float>, <2 x float>* %11
ret <2 x float> %12
}

LLVM IR (-O2):
define <2 x float> @give_neg1() {
ret <2 x float> <float -1.000000e+00, float 1.000000e+00>
}
int g(int *f) { return *f; }


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

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

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

LLVM IR (-O2):
define i32 @g(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void version() {
  puts("Multigrep v0.1");
  exit(0);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Multigrep v0.1\00"
define void @version() {
%1 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"Multigrep v0.1\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_4Cuint8_reg(unsigned char val) {
  return ((val) & (-0x4C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Cuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffb4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_4Cuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -76
%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_4Cuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -76
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void BOARD_InitBootPeripherals(void) {}


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

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

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

LLVM IR (-O2):
define void @BOARD_InitBootPeripherals() {
ret void
}
/* Variables and functions */
int opensys(char *, int, int);
int _open(char *name, int flags, int perms) {
  int temp;
  temp = opensys(name, flags, perms);
  return temp;
}


x86 assembly (clang, -O0):
<_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <opensys@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_open>:
jmp    1030 <opensys@plt>

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

LLVM IR (-O2):
define i32 @_open(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @opensys(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct si_sm_data {
  int dummy;
};
typedef scalar_t__ status;

/* Variables and functions */
int /*<<< orphan*/ read_data(struct si_sm_data *);
void clear_obf(struct si_sm_data *kcs, unsigned char status) {
  if (((status)&0x01))
    read_data(kcs);
}


x86 assembly (clang, -O0):
<clear_obf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113b <clear_obf+0x2b>
mov    -0x8(%rbp),%rdi
call   1030 <read_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_obf>:
test   $0x1,%sil
jne    1117 <clear_obf+0x7>
ret
jmp    1030 <read_data@plt>

LLVM IR (-O0):
%struct.si_sm_data = type { i32 }
define void @clear_obf(%struct.si_sm_data* %0, i8 zeroext %1) {
%3 = alloca %struct.si_sm_data*
%4 = alloca i8
store %struct.si_sm_data* %0, %struct.si_sm_data** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load %struct.si_sm_data*, %struct.si_sm_data** %3
%11 = call i32 @read_data(%struct.si_sm_data* %10)
br label %12
12: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
%struct.si_sm_data = type { i32 }
define void @clear_obf(%struct.si_sm_data* %0, i8 zeroext %1) {
%3 = and i8 %1, 1
%4 = icmp eq i8 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @read_data(%struct.si_sm_data* %0)
br label %7
7: ; preds = %5, %2
ret void
}
int test_imm_B2uint16_reg(unsigned short val) {
  return ((val) & (0xB2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B2uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xb2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_B2uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 178
%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_B2uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 178
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getcwd(char *, int);
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int pwd() {
  char *wd = malloc(1024 * sizeof(char));
  getcwd(wd, 1024 * sizeof(char));
  printf("%s\n", wd);
  return 0;
}


x86 assembly (clang, -O0):
<pwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
mov    -0x8(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwd>:
push   %rbx
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @pwd() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1024)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @getcwd(i8* %3, i32 1024)
%5 = load i8*, i8** %1
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @pwd() {
%1 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%2 = tail call i32 @getcwd(i8* %1, i32 1024)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
int _test_channel_pressure(void *buffer) {
  return (((unsigned char *)buffer)[0] & 0xf0) == (0xd << 4);
}


x86 assembly (clang, -O0):
<_test_channel_pressure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xf0,%eax
cmp    $0xd0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_test_channel_pressure>:
mov    (%rdi),%cl
and    $0xf0,%cl
xor    %eax,%eax
cmp    $0xd0,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @_test_channel_pressure(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 240
%8 = icmp eq i32 %7, 208
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @_test_channel_pressure(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -16
%4 = icmp eq i8 %3, -48
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void millissleep(int millis) {
  struct timespec ts = {.tv_sec = 0, .tv_nsec = millis * 1000000};
  nanosleep(&ts, NULL);
}


x86 assembly (clang, -O0):
<millissleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0xf4240,-0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<millissleep>:
push   %rax
imul   $0xf4240,%edi,%eax
mov    %eax,(%rsp)
movl   $0x0,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @millissleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 1000000
store i32 %6, i32* %4
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 0, i32* %7
%8 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @millissleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%5 = mul nsw i32 %0, 1000000
store i32 %5, i32* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 0, i32* %6
%7 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
void _Unwind_GetIP() {}


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

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

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

LLVM IR (-O2):
define void @_Unwind_GetIP() {
ret void
}
int right_child(int i) {
  int index = (2 * i) + 2;
  return index;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @_glfwInitLibraries() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ retval;
};
union bpf_attr {
  TYPE_1__ test;
};
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
__u32 bpf_attr_prog_run_retval(union bpf_attr *attr) {
  return attr->test.retval;
}


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

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

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

LLVM IR (-O2):
%union.bpf_attr = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
define i32 @bpf_attr_prog_run_retval(%union.bpf_attr* nocapture %0) {
%2 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %0, i64 0, i32 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
void sws_alloc_set_opts() {}


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

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

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

LLVM IR (-O2):
define void @sws_alloc_set_opts() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ refresh();
int clean_exit() {
  clear();
  refresh();
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<clean_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <clear@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<clean_exit>:
push   %rax
xor    %eax,%eax
call   1060 <clear@plt>
xor    %eax,%eax
call   1030 <refresh@plt>
xor    %eax,%eax
call   1040 <endwin@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @clean_exit() {
%1 = call i32 (...) @clear()
%2 = call i32 (...) @refresh()
%3 = call i32 (...) @endwin()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @clean_exit() {
%1 = tail call i32 (...) @clear()
%2 = tail call i32 (...) @refresh()
%3 = tail call i32 (...) @endwin()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef char wchar_t;

/* Variables and functions */
int wcslen(char *);
void treu_intro(wchar_t *cadena) {
  int longitud;
  longitud = wcslen(cadena);
  if (cadena[longitud - 1] = '\n')
    cadena[longitud - 1] = '\0';
}


x86 assembly (clang, -O0):
<treu_intro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <wcslen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0xa,(%rax,%rcx,1)
mov    $0x1,%al
test   $0x1,%al
jne    1148 <treu_intro+0x38>
jmp    1159 <treu_intro+0x49>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<treu_intro>:
push   %rbx
mov    %rdi,%rbx
call   1030 <wcslen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @treu_intro(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @wcslen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
store i8 10, i8* %10
br i1 true, label %11, label %17
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
store i8 0, i8* %16
br label %17
17: ; preds = %11, %1
ret void
}

LLVM IR (-O2):
define void @treu_intro(i8* nocapture %0) {
%2 = tail call i32 @wcslen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
ret void
}
/* Variables and functions */
int sqrt(int);
int arrangeCoinsMath(int n) {
  long nl = n * 8L;
  return (-1 + sqrt(1 + nl)) / 2;
}


x86 assembly (clang, -O0):
<arrangeCoinsMath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %eax,%edi
call   1030 <sqrt@plt>
add    $0xffffffff,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrangeCoinsMath>:
push   %rax
lea    0x1(,%rdi,8),%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
add    $0xffffffff,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0xffffffff,%eax
sar    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @arrangeCoinsMath(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul nsw i64 %5, 8
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add nsw i64 1, %7
%9 = trunc i64 %8 to i32
%10 = call i32 @sqrt(i32 %9)
%11 = add nsw i32 -1, %10
%12 = sdiv i32 %11, 2
ret i32 %12
}

LLVM IR (-O2):
define i32 @arrangeCoinsMath(i32 %0) {
%2 = shl i32 %0, 3
%3 = or i32 %2, 1
%4 = tail call i32 @sqrt(i32 %3)
%5 = add nsw i32 %4, -1
%6 = sdiv i32 %5, 2
ret i32 %6
}
void str_array_free(char **array) {
  int i = 0;
  while (array[i])
    free(array[i++]);
  free(array);
}


x86 assembly (clang, -O0):
<str_array_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1156 <str_array_free+0x46>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    1123 <str_array_free+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_array_free>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <str_array_free+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <str_array_free+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @str_array_free(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %9, %4 ], [ %2, %1 ]
%7 = add nuw nsw i64 %5, 1
tail call void @free(i8* %6)
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = bitcast i8** %0 to i8*
tail call void @free(i8* %12)
ret void
}
/* Variables and functions */
int flog_get_level();
int flog_is_debug_enabled() { return 1 >= flog_get_level(); }


x86 assembly (clang, -O0):
<flog_is_debug_enabled>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <flog_get_level@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flog_is_debug_enabled>:
push   %rax
xor    %eax,%eax
call   1030 <flog_get_level@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
setl   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @flog_is_debug_enabled() {
%1 = call i32 (...) @flog_get_level()
%2 = icmp sge i32 1, %1
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @flog_is_debug_enabled() {
%1 = tail call i32 (...) @flog_get_level()
%2 = icmp slt i32 %1, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ FlightPlanControlHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void FlightPlanControlLogging() { UAVObjLogging(FlightPlanControlHandle()); }


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

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

LLVM IR (-O0):
define void @FlightPlanControlLogging() {
%1 = call i32 (...) @FlightPlanControlHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FlightPlanControlLogging() {
%1 = tail call i32 (...) @FlightPlanControlHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int syscall(int, char const *, int /*<<< orphan*/, int /*<<< orphan*/);
int lchown(const char *path, uid_t uid, gid_t gid) {
  return syscall(198, path, uid, gid);
}


x86 assembly (clang, -O0):
<lchown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0xc6,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lchown>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0xc6,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @lchown(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @syscall(i32 198, i8* %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @lchown(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @syscall(i32 198, i8* %0, i32 %1, i32 %2)
ret i32 %4
}
__attribute__((always_)) void cli(void) { __asm__ __volatile__("cli"); }


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

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

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

LLVM IR (-O2):
define void @cli() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void free_3d_char(char ***ptr) {
  free(ptr[0][0]);
  free(ptr[0]);
  free(ptr);
}


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

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

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

LLVM IR (-O2):
define void @free_3d_char(i8*** nocapture %0) {
%2 = load i8**, i8*** %0
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast i8*** %0 to i8**
%5 = load i8*, i8** %4
tail call void @free(i8* %5)
%6 = bitcast i8*** %0 to i8*
tail call void @free(i8* %6)
ret void
}