xunge/DecIR huggingface dataset:
/* Variables and functions */
char *getenv(char *);
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int);
void _getenv_flag(char *flagname, int *flagval) {
  char *tmpstr = getenv(flagname);
  if (!tmpstr)
    *flagval = 0;
  else
    *flagval = (int)strtol(tmpstr, NULL, 10);
}


x86 assembly (clang, -O0):
<_getenv_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <_getenv_flag+0x37>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
jmp    1171 <_getenv_flag+0x51>
mov    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_getenv_flag>:
push   %rbx
mov    %rsi,%rbx
call   1030 <getenv@plt>
test   %rax,%rax
je     113f <_getenv_flag+0x1f>
mov    %rax,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
jmp    1141 <_getenv_flag+0x21>
xor    %eax,%eax
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @_getenv_flag(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = tail call i8* @getenv(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i64 @strtol(i8* nocapture %3, i32* null, i32 10)
%7 = trunc i64 %6 to i32
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %7, %5 ], [ 0, %2 ]
store i32 %9, i32* %1
ret void
}
void foo_1_2_1_2_1_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_2_1_2_1_2_1() {
ret void
}
/* Variables and functions */
double const exp(double const);
double dexp(const double x, const double lambda) {
  return lambda * exp(-lambda * x);
}


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

x86 assembly (clang, -O2):
<dexp>:
sub    $0x18,%rsp
movapd %xmm1,(%rsp)
movapd 0xedf(%rip),%xmm2
xorpd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
call   1030 <exp@plt>
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @dexp(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %4
%7 = fneg double %6
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = call double @exp(double %9)
%11 = fmul double %5, %10
ret double %11
}

LLVM IR (-O2):
define double @dexp(double %0, double %1) {
%3 = fneg double %1
%4 = fmul double %3, %0
%5 = tail call double @exp(double %4)
%6 = fmul double %5, %1
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void tx() {
  char buf[8 * 1024 * 1024];
  memset(buf, 0, sizeof(buf));
}


x86 assembly (clang, -O0):
<tx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x800000,%rsp
lea    -0x800000(%rbp),%rdi
xor    %esi,%esi
mov    $0x800000,%edx
call   1030 <memset@plt>
add    $0x800000,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tx>:
sub    $0x800008,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x800000,%edx
call   1030 <memset@plt>
add    $0x800008,%rsp
ret

LLVM IR (-O0):
define void @tx() {
%1 = alloca [8388608 x i8]
%2 = getelementptr inbounds [8388608 x i8], [8388608 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 8388608)
ret void
}

LLVM IR (-O2):
define void @tx() {
%1 = alloca [8388608 x i8]
%2 = getelementptr inbounds [8388608 x i8], [8388608 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 8388608)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int printUsage() {
  printf("Usage: [input VGM file] [OKIM6295 sample ROM] "
         "[Bank1(0-F)] [Bank2(0-F)] [Bank3(0-F)] [Bank4(0-F)]"
         "[output VGM file]\n");
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [116 x i8] c"Usage: [input VGM file] [OKIM6295 sample ROM] [Bank1(0-F)] [Bank2(0-F)] [Bank3(0-F)] [Bank4(0-F)][output VGM file]\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [115 x i8] c"Usage: [input VGM file] [OKIM6295 sample ROM] [Bank1(0-F)] [Bank2(0-F)] [Bank3(0-F)] [Bank4(0-F)][output VGM file]\00"
define i32 @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([115 x i8], [115 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int strlen(char *);
int pointer2(char *p) { return strlen(p); }


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

x86 assembly (clang, -O2):
<pointer2>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @pointer2(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_record_write_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_record@%p::pktwrite (rtpp_record_write) is invoked "
          "after destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_record_write_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_record_write_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [82 x i8] c"Method rtpp_record@%p::pktwrite (rtpp_record_write) is invoked after destruction\0A\00"
define void @rtpp_record_write_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [82 x i8] c"Method rtpp_record@%p::pktwrite (rtpp_record_write) is invoked after destruction\0A\00"
define void @rtpp_record_write_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int grib_encode_unsigned_long(unsigned char *, unsigned long, long *, long);
int grib_encode_unsigned_longb(unsigned char *p, unsigned long val, long *bitp,
                               long nbits) {
  return grib_encode_unsigned_long(p, val, bitp, nbits);
}


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

x86 assembly (clang, -O2):
<grib_encode_unsigned_longb>:
jmp    1030 <grib_encode_unsigned_long@plt>

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

LLVM IR (-O2):
define i32 @grib_encode_unsigned_longb(i8* %0, i64 %1, i64* %2, i64 %3) {
%5 = tail call i32 @grib_encode_unsigned_long(i8* %0, i64 %1, i64* %2, i64 %3)
ret i32 %5
}
int calc_index(int n, int row, int col) { return row * n + col; }


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

x86 assembly (clang, -O2):
<calc_index>:
imul   %esi,%edi
lea    (%rdi,%rdx,1),%eax
ret

LLVM IR (-O0):
define i32 @calc_index(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @calc_index(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
void gtk_tree_view_drop_position_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_drop_position_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(unsigned char *, unsigned char *, int);
int dect_compare_RFPI(unsigned char *packet, unsigned char *RFPI) {
  if ((packet[5] & 0xe0) == 0x60) {
    if (!memcmp(&packet[6], RFPI, 5))
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<dect_compare_RFPI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%eax
and    $0xe0,%eax
cmp    $0x60,%eax
jne    1166 <dect_compare_RFPI+0x56>
mov    -0x10(%rbp),%rdi
add    $0x6,%rdi
mov    -0x18(%rbp),%rsi
mov    $0x5,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
jne    1161 <dect_compare_RFPI+0x51>
movl   $0x1,-0x4(%rbp)
jmp    116d <dect_compare_RFPI+0x5d>
jmp    1166 <dect_compare_RFPI+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dect_compare_RFPI>:
push   %rax
mov    0x5(%rdi),%al
and    $0xe0,%al
cmp    $0x60,%al
jne    112c <dect_compare_RFPI+0x1c>
add    $0x6,%rdi
mov    $0x5,%edx
call   1030 <memcmp@plt>
test   %eax,%eax
je     1130 <dect_compare_RFPI+0x20>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dect_compare_RFPI(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 5
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = and i32 %9, 224
%11 = icmp eq i32 %10, 96
br i1 %11, label %12, label %20
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 6
%15 = load i8*, i8** %5
%16 = call i32 @memcmp(i8* %14, i8* %15, i32 5)
%17 = icmp ne i32 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %12
store i32 1, i32* %3
br label %21
19: ; preds = %12
br label %20
20: ; preds = %19, %2
store i32 0, i32* %3
br label %21
21: ; preds = %20, %18
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @dect_compare_RFPI(i8* %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 5
%4 = load i8, i8* %3
%5 = and i8 %4, -32
%6 = icmp eq i8 %5, 96
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %0, i64 6
%9 = tail call i32 @memcmp(i8* %8, i8* %1, i32 5)
%10 = icmp eq i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %7, %2
br label %12
12: ; preds = %7, %11
%13 = phi i32 [ 0, %11 ], [ 1, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int doPostProcess(void) {
  printf("PostProcess running.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"PostProcess running.\0A\00"
define i32 @doPostProcess() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"PostProcess running.\00"
define i32 @doPostProcess() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int foo(int a, int b, volatile int *c, volatile int *d) {
  if (a > b)
    return c[0];
  else
    return d[0];
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    112c <foo+0x2c>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <foo+0x35>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    %esi,%edi
cmovle %rcx,%rdx
mov    (%rdx),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32* %2, i32* %3) {
%5 = icmp sgt i32 %0, %1
%6 = select i1 %5, i32* %2, i32* %3
%7 = load volatile i32, i32* %6
ret i32 %7
}
void X509_VERIFY_PARAM_set_purpose(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_VERIFY_PARAM_set_purpose() {
ret void
}
int Center(int x) {
  int result = x % 257;
  if (result > (257 / 2))
    result -= 257;
  if (result < (257 / -2))
    result += 257;
  return result;
}


x86 assembly (clang, -O0):
<Center>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x101,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jle    112d <Center+0x2d>
mov    -0x8(%rbp),%eax
sub    $0x101,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xffffff80,-0x8(%rbp)
jge    1142 <Center+0x42>
mov    -0x8(%rbp),%eax
add    $0x101,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Center>:
movslq %edi,%rax
imul   $0x7f807f81,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x8,%edx
add    %ecx,%edx
mov    %eax,%ecx
sub    %edx,%ecx
neg    %edx
cmp    $0x81,%ecx
lea    -0x101(%rax,%rdx,1),%edx
cmovl  %ecx,%edx
lea    0x101(%rdx),%eax
cmp    $0xffffff80,%edx
cmovge %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @Center(i32 %0) {
%2 = srem i32 %0, 257
%3 = icmp sgt i32 %2, 128
%4 = add nsw i32 %2, -257
%5 = select i1 %3, i32 %4, i32 %2
%6 = icmp slt i32 %5, -128
%7 = add nsw i32 %5, 257
%8 = select i1 %6, i32 %7, i32 %5
ret i32 %8
}
signed long long negdi_extendsidi(signed int x) {
  return -((signed long long)x);
}


x86 assembly (clang, -O0):
<negdi_extendsidi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<negdi_extendsidi>:
movslq %edi,%rax
neg    %rax
ret

LLVM IR (-O0):
define i64 @negdi_extendsidi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = sub nsw i64 0, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @negdi_extendsidi(i32 %0) {
%2 = sext i32 %0 to i64
%3 = sub nsw i64 0, %2
ret i64 %3
}
void target(int *p) {}


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

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

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

LLVM IR (-O2):
define void @target(i32* nocapture %0) {
ret void
}
void dummynet(void *__attribute__((__unused__)) unused) {}


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

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

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

LLVM IR (-O2):
define void @dummynet(i8* nocapture %0) {
ret void
}
int _cmd_snd_ud_global_readout(struct m_l2 *l2, unsigned char mask) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.m_l2 = type opaque
define i32 @_cmd_snd_ud_global_readout(%struct.m_l2* %0, i8 zeroext %1) {
%3 = alloca %struct.m_l2*
%4 = alloca i8
store %struct.m_l2* %0, %struct.m_l2** %3
store i8 %1, i8* %4
ret i32 0
}

LLVM IR (-O2):
%struct.m_l2 = type opaque
define i32 @_cmd_snd_ud_global_readout(%struct.m_l2* nocapture readnone %0, i8 zeroext %1) {
ret i32 0
}
int main() {
  int a = 0;
  while (1)
    a++;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %0, %3
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_gettid;
int /*<<< orphan*/ syscall(int /*<<< orphan*/);
pid_t gettid(void) {
  pid_t tid;
  tid = syscall(__NR_gettid);
  return tid;
}


x86 assembly (clang, -O0):
<gettid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettid>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_gettid = global i32 0
define i32 @gettid() {
%1 = alloca i32
%2 = load i32, i32* @__NR_gettid
%3 = call i32 @syscall(i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@__NR_gettid = global i32 0
define i32 @gettid() {
%1 = load i32, i32* @__NR_gettid
%2 = tail call i32 @syscall(i32 %1)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
void ref_add_int32_t(int32_t arg1, int32_t arg2, int32_t *result) {
  *result = arg1 + arg2;
}


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

x86 assembly (clang, -O2):
<ref_add_int32_t>:
add    %rsi,%rdi
mov    %rdi,(%rdx)
ret

LLVM IR (-O0):
define void @ref_add_int32_t(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = add nsw i64 %7, %8
%10 = load i64*, i64** %6
store i64 %9, i64* %10
ret void
}

LLVM IR (-O2):
define void @ref_add_int32_t(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = add nsw i64 %1, %0
store i64 %4, i64* %2
ret void
}
/* Type definitions */
typedef void *uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t rw(uint32_t word) {
  union {
    uint8_t bytes[4];
    uint32_t word;
  } subWord __attribute__((aligned));
  subWord.word = word;
  uint8_t B0 = subWord.bytes[3], B1 = subWord.bytes[2], B2 = subWord.bytes[1],
          B3 = subWord.bytes[0];
  subWord.bytes[3] = B1;
  subWord.bytes[2] = B2;
  subWord.bytes[1] = B3;
  subWord.bytes[0] = B0;
  return subWord.word;
}


x86 assembly (clang, -O0):
<rw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { [4 x i8*] }
define i32 @rw(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i32 %0, i32* %2
%8 = load i32, i32* %2
%9 = bitcast %union.anon* %3 to i32*
store i32 %8, i32* %9
%10 = bitcast %union.anon* %3 to [4 x i8*]*
%11 = getelementptr inbounds [4 x i8*], [4 x i8*]* %10, i64 0, i64 3
%12 = load i8*, i8** %11
store i8* %12, i8** %4
%13 = bitcast %union.anon* %3 to [4 x i8*]*
%14 = getelementptr inbounds [4 x i8*], [4 x i8*]* %13, i64 0, i64 2
%15 = load i8*, i8** %14
store i8* %15, i8** %5
%16 = bitcast %union.anon* %3 to [4 x i8*]*
%17 = getelementptr inbounds [4 x i8*], [4 x i8*]* %16, i64 0, i64 1
%18 = load i8*, i8** %17
store i8* %18, i8** %6
%19 = bitcast %union.anon* %3 to [4 x i8*]*
%20 = getelementptr inbounds [4 x i8*], [4 x i8*]* %19, i64 0, i64 0
%21 = load i8*, i8** %20
store i8* %21, i8** %7
%22 = load i8*, i8** %5
%23 = bitcast %union.anon* %3 to [4 x i8*]*
%24 = getelementptr inbounds [4 x i8*], [4 x i8*]* %23, i64 0, i64 3
store i8* %22, i8** %24
%25 = load i8*, i8** %6
%26 = bitcast %union.anon* %3 to [4 x i8*]*
%27 = getelementptr inbounds [4 x i8*], [4 x i8*]* %26, i64 0, i64 2
store i8* %25, i8** %27
%28 = load i8*, i8** %7
%29 = bitcast %union.anon* %3 to [4 x i8*]*
%30 = getelementptr inbounds [4 x i8*], [4 x i8*]* %29, i64 0, i64 1
store i8* %28, i8** %30
%31 = load i8*, i8** %4
%32 = bitcast %union.anon* %3 to [4 x i8*]*
%33 = getelementptr inbounds [4 x i8*], [4 x i8*]* %32, i64 0, i64 0
store i8* %31, i8** %33
%34 = bitcast %union.anon* %3 to i32*
%35 = load i32, i32* %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @rw(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
void append_buzz_to_buffer(char *buffer) {
  sprintf(buffer, "%s%s", buffer, "buzz");
}


x86 assembly (clang, -O0):
<append_buzz_to_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xed5(%rip),%rsi
lea    0xed3(%rip),%rcx
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_buzz_to_buffer>:
lea    0xee9(%rip),%rsi
lea    0xee7(%rip),%rcx
mov    %rdi,%rdx
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [5 x i8] c"buzz\00"
define void @append_buzz_to_buffer(i8* %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
char *strdup(char const *);
int /*<<< orphan*/ system(char *);
void removeADir(const char *dname) {
  char temp[512];
  sprintf(temp, "rm -R %s", strdup(dname));
  system(temp);
}


x86 assembly (clang, -O0):
<removeADir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rax
mov    %rax,-0x218(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    -0x218(%rbp),%rdi
mov    %rax,%rdx
lea    0xe99(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <system@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeADir>:
push   %rbx
sub    $0x200,%rsp
call   1050 <strdup@plt>
lea    0xebc(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rax,%rdx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"rm -R %s\00"
define void @removeADir(i8* %0) {
%2 = alloca i8*
%3 = alloca [512 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i8* @strdup(i8* %5)
%7 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%9 = call i32 @system(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"rm -R %s\00"
define void @removeADir(i8* nocapture %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = tail call i8* @strdup(i8* %0)
%5 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @system(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assertEq(int, int);
int /*<<< orphan*/ endTest();
int main() {
  int total = 0;
  int i = 10;
  while (i > 0)
    total += i--;
  assertEq(total, 55);
  assertEq(i, 0);
  endTest();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    115d <main+0x3d>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
mov    -0x8(%rbp),%edi
mov    $0x37,%esi
call   1040 <assertEq@plt>
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   1040 <assertEq@plt>
mov    $0x0,%al
call   1030 <endTest@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x37,%edi
mov    $0x37,%esi
call   1040 <assertEq@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <assertEq@plt>
xor    %eax,%eax
call   1030 <endTest@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 10, i32* %3
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, -1
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %8
store i32 %11, i32* %2
br label %4
12: ; preds = %4
%13 = load i32, i32* %2
%14 = call i32 @assertEq(i32 %13, i32 55)
%15 = load i32, i32* %3
%16 = call i32 @assertEq(i32 %15, i32 0)
%17 = call i32 (...) @endTest()
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assertEq(i32 55, i32 55)
%2 = tail call i32 @assertEq(i32 0, i32 0)
%3 = tail call i32 (...) @endTest()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sendCmd(int, char *, int, unsigned int);
void sketchSlide(int fd, int pixels, unsigned int times) {
  sendCmd(fd, "slide %i %u\n", pixels, times);
}


x86 assembly (clang, -O0):
<sketchSlide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xecf(%rip),%rsi
call   1030 <sendCmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sketchSlide>:
mov    %edx,%ecx
mov    %esi,%edx
lea    0xee5(%rip),%rsi
jmp    1030 <sendCmd@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"slide %i %u\0A\00"
define void @sketchSlide(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @sendCmd(i32 %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"slide %i %u\0A\00"
define void @sketchSlide(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @sendCmd(i32 %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}
void mega_foo3(const int *a) { (void)a; }


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

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

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

LLVM IR (-O2):
define void @mega_foo3(i32* nocapture %0) {
ret void
}
char CCharChars(const char *Src) { return Src[0]; }


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

x86 assembly (clang, -O2):
<CCharChars>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define signext i8 @CCharChars(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
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @CCharChars(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ objc_msgSend();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("null_objc_msgSend");
  objc_msgSend();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <objc_msgSend@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"null_objc_msgSend\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @objc_msgSend()
ret i32 0
}
/* Type definitions */
struct sk_buff {
  int dummy;
};
struct llc_pdu_sn {
  int dummy;
};

/* Variables and functions */
scalar_t__ skb_network_header(struct sk_buff *);
struct llc_pdu_sn *llc_pdu_sn_hdr(struct sk_buff *skb) {
  return (struct llc_pdu_sn *)skb_network_header(skb);
}


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

x86 assembly (clang, -O2):
<llc_pdu_sn_hdr>:
jmp    1030 <skb_network_header@plt>

LLVM IR (-O0):
%struct.llc_pdu_sn = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.llc_pdu_sn* @llc_pdu_sn_hdr(%struct.sk_buff* %0) {
%2 = alloca %struct.sk_buff*
store %struct.sk_buff* %0, %struct.sk_buff** %2
%3 = load %struct.sk_buff*, %struct.sk_buff** %2
%4 = call i64 @skb_network_header(%struct.sk_buff* %3)
%5 = inttoptr i64 %4 to %struct.llc_pdu_sn*
ret %struct.llc_pdu_sn* %5
}

LLVM IR (-O2):
%struct.llc_pdu_sn = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.llc_pdu_sn* @llc_pdu_sn_hdr(%struct.sk_buff* %0) {
%2 = tail call i64 @skb_network_header(%struct.sk_buff* %0)
%3 = inttoptr i64 %2 to %struct.llc_pdu_sn*
ret %struct.llc_pdu_sn* %3
}
int calc_bytes_per_sample_f32_stereo(int channel_count) {
  return 2 * sizeof(float);
}


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

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

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

LLVM IR (-O2):
define i32 @calc_bytes_per_sample_f32_stereo(i32 %0) {
ret i32 8
}
/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ free(char *);
char *s_strdup(char *);
char *s_basename(char *path) {
  char *tmpstr;
  char *rdir;
  char *retstr;
  tmpstr = s_strdup(path);
  rdir = basename(tmpstr);
  retstr = s_strdup(rdir);
  free(tmpstr);
  return retstr;
}


x86 assembly (clang, -O0):
<s_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <s_strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <basename@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <s_strdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_basename>:
push   %r14
push   %rbx
push   %rax
call   1050 <s_strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <basename@plt>
mov    %rax,%rdi
call   1050 <s_strdup@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @s_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i8* @s_strdup(i8* %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i8* @basename(i8* %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = call i8* @s_strdup(i8* %10)
store i8* %11, i8** %5
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @s_basename(i8* %0) {
%2 = tail call i8* @s_strdup(i8* %0)
%3 = tail call i8* @basename(i8* %2)
%4 = tail call i8* @s_strdup(i8* %3)
%5 = tail call i32 @free(i8* %2)
ret i8* %4
}
int ft_len(long int n, int sys) {
  int j;
  j = 0;
  while (n >= sys) {
    n /= sys;
    j++;
  }
  return (j);
}


x86 assembly (clang, -O0):
<ft_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmp    %rcx,%rax
jl     1142 <ft_len+0x42>
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <ft_len+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_len>:
mov    %rdi,%rax
movslq %esi,%rdi
xor    %ecx,%ecx
cmp    %rax,%rdi
jle    111d <ft_len+0x1d>
mov    %ecx,%eax
ret
cqto
idiv   %rdi
add    $0x1,%ecx
cmp    %rdi,%rax
jl     110d <ft_len+0xd>
mov    %rax,%rdx
or     %rdi,%rdx
shr    $0x20,%rdx
jne    1110 <ft_len+0x10>
xor    %edx,%edx
div    %esi
jmp    1115 <ft_len+0x15>

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

LLVM IR (-O2):
define i32 @ft_len(i64 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = icmp sgt i64 %3, %0
br i1 %4, label %11, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %9, %5 ], [ 0, %2 ]
%7 = phi i64 [ %8, %5 ], [ %0, %2 ]
%8 = sdiv i64 %7, %3
%9 = add nuw nsw i32 %6, 1
%10 = icmp slt i64 %8, %3
br i1 %10, label %11, label %5
11: ; preds = %5, %2
%12 = phi i32 [ 0, %2 ], [ %9, %5 ]
ret i32 %12
}
/* Variables and functions */
float pow2if(int);
__attribute__((always_)) const float ldexp2kf(float d, int e) {
  return d * pow2if(e >> 1) * pow2if(e - (e >> 1));
}


x86 assembly (clang, -O0):
<ldexp2kf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sar    $0x1,%edi
call   1030 <pow2if@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
sub    %eax,%edi
call   1030 <pow2if@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexp2kf>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
movss  %xmm0,0x4(%rsp)
mov    %edi,%ebp
sar    %ebp
mov    %ebp,%edi
call   1030 <pow2if@plt>
mulss  0x4(%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
sub    %ebp,%ebx
mov    %ebx,%edi
call   1030 <pow2if@plt>
mulss  0x4(%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define float @ldexp2kf(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = load i32, i32* %4
%7 = ashr i32 %6, 1
%8 = call float @pow2if(i32 %7)
%9 = fmul float %5, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = ashr i32 %11, 1
%13 = sub nsw i32 %10, %12
%14 = call float @pow2if(i32 %13)
%15 = fmul float %9, %14
ret float %15
}

LLVM IR (-O2):
define float @ldexp2kf(float %0, i32 %1) {
%3 = ashr i32 %1, 1
%4 = tail call float @pow2if(i32 %3)
%5 = fmul float %4, %0
%6 = sub nsw i32 %1, %3
%7 = tail call float @pow2if(i32 %6)
%8 = fmul float %5, %7
ret float %8
}
int checkExcludeList(const char *path) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @checkExcludeList(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int randmt();
unsigned long long randi54(void) {
  const unsigned int lo = randmt();
  const unsigned int hi = randmt() & 0x3FFFFF;
  return (((unsigned long long)hi << 32) | lo);
}


x86 assembly (clang, -O0):
<randi54>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <randmt@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <randmt@plt>
and    $0x3fffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x20,%rax
mov    -0x4(%rbp),%ecx
or     %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randi54>:
push   %rbx
xor    %eax,%eax
call   1030 <randmt@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <randmt@plt>
and    $0x3fffff,%eax
shl    $0x20,%rax
mov    %ebx,%ecx
or     %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @randi54() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @randmt()
store i32 %3, i32* %1
%4 = call i32 (...) @randmt()
%5 = and i32 %4, 4194303
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = shl i64 %7, 32
%9 = load i32, i32* %1
%10 = zext i32 %9 to i64
%11 = or i64 %8, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @randi54() {
%1 = tail call i32 (...) @randmt()
%2 = tail call i32 (...) @randmt()
%3 = and i32 %2, 4194303
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 %4, 32
%6 = zext i32 %1 to i64
%7 = or i64 %5, %6
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ ut;
struct utmp {
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  struct utmp ut = {0};
  printf("sizeof (struct utmp) = %d\n", sizeof(ut));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    0xeb3(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.utmp = type { i32 }
@.str = [27 x i8] c"sizeof (struct utmp) = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.utmp
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast %struct.utmp* %6 to i8*
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"sizeof (struct utmp) = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int SaveFile(char *path) {
  printf("Saving file: %s\n", path);
  return 1;
}


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

x86 assembly (clang, -O2):
<SaveFile>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"Saving file: %s\0A\00"
define i32 @SaveFile(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ clearScreen_24064();
void clearScreen(void) { clearScreen_24064(); }


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

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

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

LLVM IR (-O2):
define void @clearScreen() {
%1 = tail call i32 (...) @clearScreen_24064()
ret void
}
int close(int fildes) {
  long code = 0x2000006;
  unsigned long ret = 0;
  __asm__("movq %1, %%rax;\n"
          "movq %2, %%rdi;\n"
          "syscall;\n"
          "movq %%rax, %0;\n"
          : "=g"(ret)
          : "g"(code), "g"(fildes)
          :);
  return ret;
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x2000006,-0x10(%rbp)
02
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%eax
mov    %rcx,-0x20(%rbp)
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%rdi
syscall
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @close(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i32 %0, i32* %2
store i64 33554438, i64* %3
store i64 0, i64* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %2
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t negative_31(uint8_t a) { return a ^ 0x1f; }


x86 assembly (clang, -O0):
<negative_31>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<negative_31>:
mov    %edi,%eax
xor    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @negative_31(i32 %0) {
%2 = xor i32 %0, 31
ret i32 %2
}
void insertElement(int arr[], int index, int value) { arr[index] = value; }


x86 assembly (clang, -O0):
<insertElement>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insertElement>:
movslq %esi,%rax
mov    %edx,(%rdi,%rax,4)
ret

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

LLVM IR (-O2):
define void @insertElement(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %2, i32* %5
ret void
}