xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: piggyback vmlinux.aout System.map fs_img.gz\n");
  fprintf(stderr, "\tKernel image will be modified in place.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeeb(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: piggyback vmlinux.aout System.map fs_img.gz\0A\00"
@.str.1 = [42 x i8] c"\09Kernel image will be modified in place.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: piggyback vmlinux.aout System.map fs_img.gz\0A\00"
@.str.1 = [42 x i8] c"\09Kernel image will be modified in place.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
void DeleteLines(Howmany) int Howmany;
{
  char Str[10];
  if (Howmany == 0)
    return;
  sprintf(Str, "\033[%dM", Howmany);
  WRITETEST(Str);
}


x86 assembly (clang, -O0):
<DeleteLines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113a <DeleteLines+0x1a>
jmp    115a <DeleteLines+0x3a>
lea    -0xe(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0xe(%rbp),%rdi
mov    $0x0,%al
call   1030 <WRITETEST@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DeleteLines>:
test   %edi,%edi
je     1150 <DeleteLines+0x30>
push   %rbx
sub    $0x10,%rsp
mov    %edi,%edx
lea    0xece(%rip),%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <WRITETEST@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[%dM\00"
define void @DeleteLines(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %13
7: ; preds = %1
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = load i32, i32* %2
%10 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @WRITETEST to i32 (i8*, ...)*)(i8* %11)
br label %13
13: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dM\00"
define void @DeleteLines(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = icmp eq i32 %0, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @WRITETEST to i32 (i8*, ...)*)(i8* %3)
br label %8
8: ; preds = %1, %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
struct strbuf {
  int dummy;
};

/* Variables and functions */
int strbuf_vprintf_internal(struct strbuf *, char const *, int /*<<< orphan*/,
                            int);
int strbuf_vconcatf(struct strbuf *sb, const char *format, va_list ap) {
  return strbuf_vprintf_internal(sb, format, ap, 1);
}


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

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

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

LLVM IR (-O2):
%struct.strbuf = type { i32 }
define i32 @strbuf_vconcatf(%struct.strbuf* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strbuf_vprintf_internal(%struct.strbuf* %0, i8* %1, i32 %2, i32 1)
ret i32 %4
}
int test_imm_F2int8_reg(signed char val) {
  return ((val) & (0xF2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F2int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 242
%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_F2int8_reg(i8 signext %0) {
%2 = and i8 %0, -14
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int atoi(char *);
int get_numvar(char *);
int get_numval(char *str) {
  if (str[0] == '#') {
    return (get_numvar(str));
  } else {
    return (atoi(str));
  }
}


x86 assembly (clang, -O0):
<get_numval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    114d <get_numval+0x2d>
mov    -0x10(%rbp),%rdi
call   1030 <get_numvar@plt>
mov    %eax,-0x4(%rbp)
jmp    1159 <get_numval+0x39>
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_numval>:
cmpb   $0x23,(%rdi)
jne    112a <get_numval+0xa>
jmp    1030 <get_numvar@plt>
jmp    1040 <atoi@plt>

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

LLVM IR (-O2):
define i32 @get_numval(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 35
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @get_numvar(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @atoi(i8* %0)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
void ARGBAffineRow_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBAffineRow_SSE2() {
ret void
}
/* Variables and functions */
int rand();
int shape_rand(void) { return rand() % 7; }


x86 assembly (clang, -O0):
<shape_rand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shape_rand>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0xffffffff92492493,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x2,%eax
add    %edx,%eax
lea    0x0(,%rax,8),%edx
sub    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @shape_rand() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 7
ret i32 %2
}

LLVM IR (-O2):
define i32 @shape_rand() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 7
ret i32 %2
}
void ff_hevc_put_hevc_uni_qpel_h24_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_h24_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __svgalib_driver8_getbox(int, int, int, int, void *, int);
void __svgalib_driver8_getboxpart(int x, int y, int w, int h, int ow, int oh,
                                  void *b, int xo, int yo) {
  __svgalib_driver8_getbox(x, y, w, h, b + yo * ow + xo, ow);
}


x86 assembly (clang, -O0):
<__svgalib_driver8_getboxpart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    0x10(%rbp),%r8
mov    0x20(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
add    %rax,%r8
movslq 0x18(%rbp),%rax
add    %rax,%r8
mov    -0x14(%rbp),%r9d
call   1030 <__svgalib_driver8_getbox@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__svgalib_driver8_getboxpart>:
mov    %r8d,%r9d
movslq 0x10(%rsp),%r10
mov    0x18(%rsp),%eax
imul   %r8d,%eax
movslq %eax,%r8
add    0x8(%rsp),%r8
add    %r10,%r8
jmp    1030 <__svgalib_driver8_getbox@plt>

LLVM IR (-O0):
define void @__svgalib_driver8_getboxpart(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7, i32 %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i32
store i32 %0, i32* %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i8* %6, i8** %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%19 = load i32, i32* %10
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = load i32, i32* %13
%23 = load i8*, i8** %16
%24 = load i32, i32* %18
%25 = load i32, i32* %14
%26 = mul nsw i32 %24, %25
%27 = sext i32 %26 to i64
%28 = getelementptr i8, i8* %23, i64 %27
%29 = load i32, i32* %17
%30 = sext i32 %29 to i64
%31 = getelementptr i8, i8* %28, i64 %30
%32 = load i32, i32* %14
%33 = call i32 @__svgalib_driver8_getbox(i32 %19, i32 %20, i32 %21, i32 %22, i8* %31, i32 %32)
ret void
}

LLVM IR (-O2):
define void @__svgalib_driver8_getboxpart(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7, i32 %8) {
%10 = mul nsw i32 %8, %4
%11 = sext i32 %10 to i64
%12 = getelementptr i8, i8* %6, i64 %11
%13 = sext i32 %7 to i64
%14 = getelementptr i8, i8* %12, i64 %13
%15 = tail call i32 @__svgalib_driver8_getbox(i32 %0, i32 %1, i32 %2, i32 %3, i8* %14, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr(char const *);
int /*<<< orphan*/ write(int, char *, int);
void ft_putendl(char const *s) {
  ft_putstr(s);
  write(1, "\n", 1);
}


x86 assembly (clang, -O0):
<ft_putendl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_putstr@plt>
mov    $0x1,%edx
lea    0xebf(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl>:
push   %rax
call   1040 <ft_putstr@plt>
lea    0xed3(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
pop    %rax
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ft_putstr(i8* %3)
%5 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl(i8* %0) {
%2 = tail call i32 @ft_putstr(i8* %0)
%3 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test(int arg) { printf("Result %i\n", arg); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"Result %i\0A\00"
define void @test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Result %i\0A\00"
define void @test(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printUsage() {
  printf("usage: %s <inputfile.csv> <starting TS> <ending TS> <outputname>\n");
}


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

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

LLVM IR (-O0):
@.str = [66 x i8] c"usage: %s <inputfile.csv> <starting TS> <ending TS> <outputname>\0A\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [66 x i8] c"usage: %s <inputfile.csv> <starting TS> <ending TS> <outputname>\0A\00"
define void @printUsage() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int __u64;

/* Variables and functions */
int XSK_UNALIGNED_BUF_ADDR_MASK;
__u64 xsk_umem__extract_addr(__u64 addr) {
  return addr & XSK_UNALIGNED_BUF_ADDR_MASK;
}


x86 assembly (clang, -O0):
<xsk_umem__extract_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ecf(%rip),%rcx
and    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsk_umem__extract_addr>:
mov    %edi,%eax
mov    0x2ed7(%rip),%rcx
and    (%rcx),%eax
ret

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

LLVM IR (-O2):
@XSK_UNALIGNED_BUF_ADDR_MASK = global i32 0
define i32 @xsk_umem__extract_addr(i32 %0) {
%2 = load i32, i32* @XSK_UNALIGNED_BUF_ADDR_MASK
%3 = and i32 %2, %0
ret i32 %3
}
unsigned long long shift_64_bit_feedback_register() {
  static unsigned long long register_64 = 1;
  unsigned long long new_bit;
  new_bit = ((register_64 & 0x01) ^ ((register_64 & 0x02) >> 1) ^
             ((register_64 & 0x08) >> 3) ^ ((register_64 & 0x10) >> 4));
  register_64 = register_64 >> 1;
  register_64 = register_64 | (new_bit << 63);
  return (register_64);
}


x86 assembly (clang, -O0):
<shift_64_bit_feedback_register>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
and    $0x1,%rax
mov    0x2f0a(%rip),%rcx
and    $0x2,%rcx
shr    $0x1,%rcx
xor    %rcx,%rax
mov    0x2ef8(%rip),%rcx
and    $0x8,%rcx
shr    $0x3,%rcx
xor    %rcx,%rax
mov    0x2ee6(%rip),%rcx
and    $0x10,%rcx
shr    $0x4,%rcx
xor    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    0x2ed0(%rip),%rax
shr    $0x1,%rax
mov    %rax,0x2ec5(%rip)
mov    0x2ebe(%rip),%rax
mov    -0x8(%rbp),%rcx
shl    $0x3f,%rcx
or     %rcx,%rax
mov    %rax,0x2eac(%rip)
mov    0x2ea5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_64_bit_feedback_register>:
mov    0x2f19(%rip),%rcx
mov    %ecx,%edx
shr    %edx
xor    %ecx,%edx
mov    %ecx,%esi
shr    $0x3,%esi
mov    %ecx,%eax
shr    $0x4,%eax
xor    %esi,%eax
xor    %edx,%eax
shld   $0x3f,%rcx,%rax
mov    %rax,0x2ef9(%rip)
ret

LLVM IR (-O0):
@shift_64_bit_feedback_register.register_64 = internal global i64 1
define i64 @shift_64_bit_feedback_register() {
%1 = alloca i64
%2 = load i64, i64* @shift_64_bit_feedback_register.register_64
%3 = and i64 %2, 1
%4 = load i64, i64* @shift_64_bit_feedback_register.register_64
%5 = and i64 %4, 2
%6 = lshr i64 %5, 1
%7 = xor i64 %3, %6
%8 = load i64, i64* @shift_64_bit_feedback_register.register_64
%9 = and i64 %8, 8
%10 = lshr i64 %9, 3
%11 = xor i64 %7, %10
%12 = load i64, i64* @shift_64_bit_feedback_register.register_64
%13 = and i64 %12, 16
%14 = lshr i64 %13, 4
%15 = xor i64 %11, %14
store i64 %15, i64* %1
%16 = load i64, i64* @shift_64_bit_feedback_register.register_64
%17 = lshr i64 %16, 1
store i64 %17, i64* @shift_64_bit_feedback_register.register_64
%18 = load i64, i64* @shift_64_bit_feedback_register.register_64
%19 = load i64, i64* %1
%20 = shl i64 %19, 63
%21 = or i64 %18, %20
store i64 %21, i64* @shift_64_bit_feedback_register.register_64
%22 = load i64, i64* @shift_64_bit_feedback_register.register_64
ret i64 %22
}

LLVM IR (-O2):
@shift_64_bit_feedback_register.register_64 = internal unnamed_addr global i64 1
define i64 @shift_64_bit_feedback_register() {
%1 = load i64, i64* @shift_64_bit_feedback_register.register_64
%2 = lshr i64 %1, 1
%3 = xor i64 %2, %1
%4 = lshr i64 %1, 3
%5 = xor i64 %3, %4
%6 = lshr i64 %1, 4
%7 = xor i64 %5, %6
%8 = tail call i64 @llvm.fshl.i64(i64 %7, i64 %1, i64 63)
store i64 %8, i64* @shift_64_bit_feedback_register.register_64
ret i64 %8
}
/* Variables and functions */
int abs(unsigned int);
int /*<<< orphan*/ printf(char *, int);
void cursor_up(unsigned int lines) { printf("\e[%uA", abs(lines)); }


x86 assembly (clang, -O0):
<cursor_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cursor_up>:
mov    %edi,%esi
neg    %esi
cmovs  %edi,%esi
lea    0xee2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[%uA\00"
define void @cursor_up(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @abs(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%uA\00"
define void @cursor_up(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sendv(unsigned int *, int);
void send(unsigned int data) { sendv(&data, 1); }


x86 assembly (clang, -O0):
<send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x1,%esi
call   1030 <sendv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
call   1030 <sendv@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @send(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @sendv(i32* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @send(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @sendv(i32* %2, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void close_uptime_file(FILE *fp) { fclose(fp); }


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

x86 assembly (clang, -O2):
<close_uptime_file>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @close_uptime_file(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret void
}
void TAMP_STAMP_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @TAMP_STAMP_IRQHandler() {
ret void
}
/* Type definitions */
struct plainstring {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ plainstring_set(struct plainstring *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void plainstring_set_int(struct plainstring *this_string, int i) {
  char buffer[0xFF];
  sprintf(buffer, "%i", i);
  plainstring_set(this_string, buffer);
}


x86 assembly (clang, -O0):
<plainstring_set_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xebd(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1030 <plainstring_set@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plainstring_set_int>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xeca(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <plainstring_set@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.plainstring = type { i32 }
@.str = [3 x i8] c"%i\00"
define void @plainstring_set_int(%struct.plainstring* %0, i32 %1) {
%3 = alloca %struct.plainstring*
%4 = alloca i32
%5 = alloca [255 x i8]
store %struct.plainstring* %0, %struct.plainstring** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load %struct.plainstring*, %struct.plainstring** %3
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%11 = call i32 @plainstring_set(%struct.plainstring* %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.plainstring = type { i32 }
@.str = [3 x i8] c"%i\00"
define void @plainstring_set_int(%struct.plainstring* %0, i32 %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @plainstring_set(%struct.plainstring* %0, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_head();
int /*<<< orphan*/ map_existing_link(int /*<<< orphan*/);
int /*<<< orphan*/ set_probe(int /*<<< orphan*/);
void reset_iterator() { set_probe(map_existing_link(get_head())); }


x86 assembly (clang, -O0):
<reset_iterator>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_head@plt>
mov    %eax,%edi
call   1040 <map_existing_link@plt>
mov    %eax,%edi
call   1050 <set_probe@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_iterator>:
push   %rax
xor    %eax,%eax
call   1030 <get_head@plt>
mov    %eax,%edi
call   1040 <map_existing_link@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <set_probe@plt>

LLVM IR (-O0):
define void @reset_iterator() {
%1 = call i32 (...) @get_head()
%2 = call i32 @map_existing_link(i32 %1)
%3 = call i32 @set_probe(i32 %2)
ret void
}

LLVM IR (-O2):
define void @reset_iterator() {
%1 = tail call i32 (...) @get_head()
%2 = tail call i32 @map_existing_link(i32 %1)
%3 = tail call i32 @set_probe(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void my_free(void *ptr) {
  if (!ptr)
    free(ptr);
}


x86 assembly (clang, -O0):
<my_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1130 <my_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_free>:
test   %rdi,%rdi
je     1116 <my_free+0x6>
ret
xor    %edi,%edi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @my_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @my_free(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @free(i8* null)
br label %5
5: ; preds = %3, %1
ret void
}
unsigned long long g(unsigned long long i) { return (i << 4) & 0xff0; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x4,%rax
and    $0xff0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
movzbl %dil,%eax
shl    $0x4,%rax
ret

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

LLVM IR (-O2):
define i64 @g(i64 %0) {
%2 = shl i64 %0, 4
%3 = and i64 %2, 4080
ret i64 %3
}
void g(char c) { c; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @g(i8 signext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ runtime_gc();
void go_gc() { runtime_gc(); }


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

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

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

LLVM IR (-O2):
define void @go_gc() {
%1 = tail call i32 (...) @runtime_gc()
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
scalar_t__ stat(char const *, struct stat *);
off_t flen(const char *fname) {
  struct stat statres;
  if (stat(fname, &statres) < 0) {
    perror("stat()");
    exit(1);
  }
  return statres.st_size;
}


x86 assembly (clang, -O0):
<flen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    1169 <flen+0x39>
lea    0xea6(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flen>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
js     1143 <flen+0x13>
mov    (%rsp),%eax
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [7 x i8] c"stat()\00"
define i32 @flen(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%11 = load i32, i32* %10
ret i32 %11
}
void ff_hevc_put_hevc_uni_w_qpel_hv32_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_hv32_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, char *);
void function_state(char *state) {
  write("json-task.json", "\"state\":\"%s\", ", state);
}


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

x86 assembly (clang, -O2):
<function_state>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [15 x i8] c"\22state\22:\22%s\22, \00"
define void @function_state(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [15 x i8] c"\22state\22:\22%s\22, \00"
define void @function_state(i8* %0) {
%2 = tail call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int main() {
  int arg1 = 40;
  int arg2 = 2;
  int mul = 0;
  __asm__("imull $2, %%eax;" : "=a"(mul) : "a"(arg1), "b"(arg2));
  return mul;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
movl   $0x0,-0xc(%rbp)
movl   $0x28,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ebx
imul   $0x2,%eax,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x28,%eax
mov    $0x2,%ebx
imul   $0x2,%eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 40, i32* %2
store i32 2, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 asm "imull $$2, %eax;", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 asm "imull $$2, %eax;", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 40, i32 2)
ret i32 %1
}
void _Jv_ulp(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
void ntx_dclose(DIR *dir) { closedir(dir); }


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

x86 assembly (clang, -O2):
<ntx_dclose>:
jmp    1030 <closedir@plt>

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

LLVM IR (-O2):
define void @ntx_dclose(i32* nocapture %0) {
%2 = tail call i32 @closedir(i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ *BIO_new(int /*<<< orphan*/);
int /*<<< orphan*/ BIO_s_datagram();
int /*<<< orphan*/ BIO_set_fd(int /*<<< orphan*/ *, int, int);
BIO *BIO_new_dgram(int fd, int close_flag) {
  BIO *ret;
  ret = BIO_new(BIO_s_datagram());
  if (ret == NULL)
    return (NULL);
  BIO_set_fd(ret, fd, close_flag);
  return (ret);
}


x86 assembly (clang, -O0):
<BIO_new_dgram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <BIO_s_datagram@plt>
mov    %eax,%edi
call   1040 <BIO_new@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1168 <BIO_new_dgram+0x38>
movq   $0x0,-0x8(%rbp)
jmp    117f <BIO_new_dgram+0x4f>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <BIO_set_fd@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIO_new_dgram>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <BIO_s_datagram@plt>
mov    %eax,%edi
call   1040 <BIO_new@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115c <BIO_new_dgram+0x2c>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1050 <BIO_set_fd@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32* @BIO_new_dgram(i32 %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = call i32 (...) @BIO_s_datagram()
%8 = call i32* @BIO_new(i32 %7)
store i32* %8, i32** %6
%9 = load i32*, i32** %6
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store i32* null, i32** %3
br label %18
12: ; preds = %2
%13 = load i32*, i32** %6
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i32 @BIO_set_fd(i32* %13, i32 %14, i32 %15)
%17 = load i32*, i32** %6
store i32* %17, i32** %3
br label %18
18: ; preds = %12, %11
%19 = load i32*, i32** %3
ret i32* %19
}

LLVM IR (-O2):
define i32* @BIO_new_dgram(i32 %0, i32 %1) {
%3 = tail call i32 (...) @BIO_s_datagram()
%4 = tail call i32* @BIO_new(i32 %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @BIO_set_fd(i32* %4, i32 %0, i32 %1)
br label %8
8: ; preds = %2, %6
ret i32* %4
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main() {
  char *x;
  int foo;
  x = (char *)malloc(10);
  strcpy(x, "123456789");
  foo = strlen(x + 10);
  x[foo] = 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
add    $0xa,%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x1,(%rax,%rcx,1)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
lea    0xa(%rbx),%rdi
call   1040 <strlen@plt>
cltq
movb   $0x1,(%rbx,%rax,1)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"123456789\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i64 @malloc(i32 10)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 10
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %3
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 1, i8* %14
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"123456789\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 10)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds i8, i8* %2, i64 10
%5 = tail call i32 @strlen(i8* %4)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %2, i64 %6
store i8 1, i8* %7
ret i32 0
}
void test45_Test8_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test45_Test8_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rmdir(char *);
int main(void) { rmdir("tata"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"tata\00"
define i32 @main() {
%1 = call i32 @rmdir(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"tata\00"
define i32 @main() {
%1 = tail call i32 @rmdir(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_16(uint64_t x) {
  __asm__("rolq $16, %0" : "=r"(x) : "0"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<ROL64_16>:
mov    %rdi,%rax
rol    $0x10,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$16, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_16(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$16, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int syscall(int, int, char const *, int /*<<< orphan*/);
int inotify_add_watch(int fd, const char *pathname, uint32_t mask) {
  return syscall(292, fd, pathname, mask);
}


x86 assembly (clang, -O0):
<inotify_add_watch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x124,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @inotify_add_watch(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @syscall(i32 292, i32 %0, i8* %1, i32 %2)
ret i32 %4
}
int func0(void) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @func0() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ hanoi(int, char, char, char);
int /*<<< orphan*/ scanf(char *, int *, char *, char *, char *);
int main(void) {
  char c1, c2, c3;
  int n;
  scanf("%d %c %c %c", &n, &c1, &c2, &c3);
  hanoi(n, c1, c3, c2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x5(%rbp),%rdx
lea    -0x6(%rbp),%rcx
lea    -0x7(%rbp),%r8
call   1030 <scanf@plt>
mov    -0xc(%rbp),%edi
mov    -0x5(%rbp),%cl
mov    -0x7(%rbp),%al
movsbl %cl,%esi
movsbl %al,%edx
movsbl -0x6(%rbp),%ecx
call   1040 <hanoi@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
lea    0x3(%rsp),%rdx
lea    0x2(%rsp),%rcx
lea    0x1(%rsp),%r8
call   1030 <scanf@plt>
mov    0x4(%rsp),%edi
movsbl 0x3(%rsp),%esi
movsbl 0x1(%rsp),%edx
movsbl 0x2(%rsp),%ecx
call   1040 <hanoi@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%d %c %c %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %5, i8* %2, i8* %3, i8* %4)
%7 = load i32, i32* %5
%8 = load i8, i8* %2
%9 = load i8, i8* %4
%10 = load i8, i8* %3
%11 = call i32 @hanoi(i32 %7, i8 signext %8, i8 signext %9, i8 signext %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d %c %c %c\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %4, i8* %1, i8* %2, i8* %3)
%7 = load i32, i32* %4
%8 = load i8, i8* %1
%9 = load i8, i8* %3
%10 = load i8, i8* %2
%11 = call i32 @hanoi(i32 %7, i8 signext %8, i8 signext %9, i8 signext %10)
ret i32 0
}
/* Variables and functions */
int parity(int /*<<< orphan*/);
int /*<<< orphan*/ rdtscp(int /*<<< orphan*/ *);
int f2() { return parity(rdtscp(NULL)); }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <rdtscp@plt>
mov    %eax,%edi
call   1040 <parity@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f2() {
%1 = call i32 @rdtscp(i32* null)
%2 = call i32 @parity(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @f2() {
%1 = tail call i32 @rdtscp(i32* null)
%2 = tail call i32 @parity(i32 %1)
ret i32 %2
}
/* Variables and functions */
void *cnfCptr(unsigned int);
int /*<<< orphan*/ cnfUregp(void *);
void cnf_unregp_(unsigned int *const FPTR) {

  void *cptr;
  cptr = cnfCptr(*FPTR);
  if (!cptr)
    return;
  cnfUregp(cptr);
  *FPTR = 0;
}


x86 assembly (clang, -O0):
<cnf_unregp_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <cnfCptr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <cnf_unregp_+0x2b>
jmp    115e <cnf_unregp_+0x3e>
mov    -0x10(%rbp),%rdi
call   1040 <cnfUregp@plt>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cnf_unregp_>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <cnfCptr@plt>
test   %rax,%rax
je     113e <cnf_unregp_+0x1e>
mov    %rax,%rdi
call   1040 <cnfUregp@plt>
movl   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @cnf_unregp_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i8* @cnfCptr(i32 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @cnfUregp(i8* %3)
store i32 0, i32* %0
br label %7
7: ; preds = %1, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printValue(int, int);
int /*<<< orphan*/ printf(char *);
int turnOffRightmostSet(int value) {
  value &= (value - 1);
  printValue(value, 8);
  printf(" TORMS\n");
  return value;
}


x86 assembly (clang, -O0):
<turnOffRightmostSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1040 <printValue@plt>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<turnOffRightmostSet>:
push   %rbx
lea    -0x1(%rdi),%ebx
and    %edi,%ebx
mov    %ebx,%edi
mov    $0x8,%esi
call   1040 <printValue@plt>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c" TORMS\0A\00"
define i32 @turnOffRightmostSet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = load i32, i32* %2
%6 = and i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printValue(i32 %7, i32 8)
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@str = [7 x i8] c" TORMS\00"
define i32 @turnOffRightmostSet(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = and i32 %2, %0
%4 = tail call i32 @printValue(i32 %3, i32 8)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ nums;

/* Variables and functions */
int /*<<< orphan*/ merge_sort(int *, int);
int /*<<< orphan*/ print(int *, int);
int main() {
  int nums[] = {2, 10, 3, 14, 15, 6, 3, 9};
  int n = sizeof(nums) / sizeof(nums[0]);
  merge_sort(nums, n);
  print(nums, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <merge_sort@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <merge_sort@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.nums = [8 x i32] [i32 2, i32 10, i32 3, i32 14, i32 15, i32 6, i32 3, i32 9]
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [8 x i32]* %2 to i8*
store i32 8, i32* %3
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @merge_sort(i32* %5, i32 %6)
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @print(i32* %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [8 x i32] [i32 2, i32 10, i32 3, i32 14, i32 15, i32 6, i32 3, i32 9]
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @merge_sort(i32* %3, i32 8)
%5 = call i32 @print(i32* %3, i32 8)
ret i32 0
}