xunge/DecIR huggingface dataset:
/* Variables and functions */
int strcmp(char const *, char const *);
int cmpf_string(const void *key1, const void *key2) {
  return strcmp((const char *)key1, (const char *)key2);
}


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

x86 assembly (clang, -O2):
<cmpf_string>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @cmpf_string(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
void av_buffer_pool_init2() {}


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

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

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

LLVM IR (-O2):
define void @av_buffer_pool_init2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ system(char *);
void suspend(char *str) {
  printf("%s\n", str);
  system("read -n1 -r");
}


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

x86 assembly (clang, -O2):
<suspend>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [12 x i8] c"read -n1 -r\00"
define void @suspend(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [12 x i8] c"read -n1 -r\00"
define void @suspend(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long time;
};
typedef TYPE_1__ XKeyPressedEvent;

/* Variables and functions */
void set_XKeyPressedEvent_time(void *_p, unsigned long _v) {
  ((XKeyPressedEvent *)_p)->time = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XKeyPressedEvent_time(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XKeyPressedEvent_time(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int qe_inrange(int, int /*<<< orphan*/, char);
int qe_isdigit(int c) { return qe_inrange(c, '0', '9'); }


x86 assembly (clang, -O0):
<qe_isdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x30,%esi
mov    $0x39,%edx
call   1030 <qe_inrange@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qe_isdigit>:
mov    $0x30,%esi
mov    $0x39,%edx
jmp    1030 <qe_inrange@plt>

LLVM IR (-O0):
define i32 @qe_isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @qe_inrange(i32 %3, i32 48, i8 signext 57)
ret i32 %4
}

LLVM IR (-O2):
define i32 @qe_isdigit(i32 %0) {
%2 = tail call i32 @qe_inrange(i32 %0, i32 48, i8 signext 57)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void elseTest() {
  int x = 0;
  if (2 == 2)
    ;
  else
    x = 4;
  assert(x == 4);
}


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

x86 assembly (clang, -O2):
<elseTest>:
xor    %edi,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define void @elseTest() {
%1 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_getc();
int /*<<< orphan*/ uart_putc(int /*<<< orphan*/);
void c_irq_handler(void) { uart_putc(uart_getc()); }


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

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

LLVM IR (-O0):
define void @c_irq_handler() {
%1 = call i32 (...) @uart_getc()
%2 = call i32 @uart_putc(i32 %1)
ret void
}

LLVM IR (-O2):
define void @c_irq_handler() {
%1 = tail call i32 (...) @uart_getc()
%2 = tail call i32 @uart_putc(i32 %1)
ret void
}
/* Type definitions */
struct ct2db_args_info {
  int dummy;
};

/* Variables and functions */
int ct2db_cmdline_parser2(int, char **, struct ct2db_args_info *,
                          int /*<<< orphan*/, int, int);
int ct2db_cmdline_parser(int argc, char **argv,
                         struct ct2db_args_info *args_info) {
  return ct2db_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


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

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

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

LLVM IR (-O2):
%struct.ct2db_args_info = type { i32 }
define i32 @ct2db_cmdline_parser(i32 %0, i8** %1, %struct.ct2db_args_info* %2) {
%4 = tail call i32 @ct2db_cmdline_parser2(i32 %0, i8** %1, %struct.ct2db_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
/* Type definitions */
struct server {
  int dummy;
};
struct imapmsg {
  int dummy;
};
struct folder {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ start_select(struct server *, struct folder *);
void imap_loginok(struct imapmsg *msg, struct server *sptr,
                  struct folder *fptr) {
  start_select(sptr, fptr);
}


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

x86 assembly (clang, -O2):
<imap_loginok>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <start_select@plt>

LLVM IR (-O0):
%struct.imapmsg = type { i32 }
%struct.server = type { i32 }
%struct.folder = type { i32 }
define void @imap_loginok(%struct.imapmsg* %0, %struct.server* %1, %struct.folder* %2) {
%4 = alloca %struct.imapmsg*
%5 = alloca %struct.server*
%6 = alloca %struct.folder*
store %struct.imapmsg* %0, %struct.imapmsg** %4
store %struct.server* %1, %struct.server** %5
store %struct.folder* %2, %struct.folder** %6
%7 = load %struct.server*, %struct.server** %5
%8 = load %struct.folder*, %struct.folder** %6
%9 = call i32 @start_select(%struct.server* %7, %struct.folder* %8)
ret void
}

LLVM IR (-O2):
%struct.imapmsg = type { i32 }
%struct.server = type { i32 }
%struct.folder = type { i32 }
define void @imap_loginok(%struct.imapmsg* nocapture readnone %0, %struct.server* %1, %struct.folder* %2) {
%4 = tail call i32 @start_select(%struct.server* %1, %struct.folder* %2)
ret void
}
double vdC(int i, int base) {
  double h = 0.0, f, factor;
  int digit;
  f = factor = 1.0 / (double)base;
  while (i > 0) {
    digit = i % base;
    h += (double)digit * factor;
    i /= base;
    factor *= f;
  }
  return h;
}


x86 assembly (clang, -O0):
<vdC>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xee1(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    117d <vdC+0x7d>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x24(%rbp)
cvtsi2sdl -0x24(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    112d <vdC+0x2d>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdC>:
test   %edi,%edi
jle    113b <vdC+0x3b>
mov    %edi,%eax
cvtsi2sd %esi,%xmm0
movsd  0xeee(%rip),%xmm1
divsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
movapd %xmm1,%xmm2
xchg   %ax,%ax
cltd
idiv   %esi
xorps  %xmm3,%xmm3
cvtsi2sd %edx,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm3,%xmm0
mulsd  %xmm1,%xmm2
test   %eax,%eax
jg     1120 <vdC+0x20>
ret
xorps  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @vdC(i32 %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fdiv double 1.000000e+00, %3
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %16
6: ; preds = %2, %6
%7 = phi i32 [ %13, %6 ], [ %0, %2 ]
%8 = phi double [ %14, %6 ], [ %4, %2 ]
%9 = phi double [ %12, %6 ], [ 0.000000e+00, %2 ]
%10 = srem i32 %7, %1
%11 = sitofp i32 %10 to double
%12 = tail call double @llvm.fmuladd.f64(double %11, double %8, double %9)
%13 = sdiv i32 %7, %1
%14 = fmul double %4, %8
%15 = icmp sgt i32 %13, 0
br i1 %15, label %6, label %16
16: ; preds = %6, %2
%17 = phi double [ 0.000000e+00, %2 ], [ %12, %6 ]
ret double %17
}
int kstrlen(const char *str) {
  const char *s;
  for (s = str; *s; ++s)
    ;
  return (int)(s - str);
}


x86 assembly (clang, -O0):
<kstrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <kstrlen+0x33>
jmp    1122 <kstrlen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <kstrlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @kstrlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
void RTTarFileOpen(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTarFileOpen() {
ret void
}
/* Variables and functions */
void bzero(unsigned char *b, int n) {
  while (--n >= 0)
    *b++ = 0;
}


x86 assembly (clang, -O0):
<bzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jl     1134 <bzero+0x34>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
jmp    110b <bzero+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bzero>:
test   %esi,%esi
jle    1122 <bzero+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @bzero(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
store i8 0, i8* %10
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @bzero(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
double KMAPI_GetInternalVersion() { return 1.1; }


x86 assembly (clang, -O0):
<KMAPI_GetInternalVersion>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<KMAPI_GetInternalVersion>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @KMAPI_GetInternalVersion() {
ret double 1.100000e+00
}

LLVM IR (-O2):
define double @KMAPI_GetInternalVersion() {
ret double 1.100000e+00
}
/* Variables and functions */
int /*<<< orphan*/ cov_module_init();
void module_init() { cov_module_init(); }


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

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

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

LLVM IR (-O2):
define void @module_init() {
%1 = tail call i32 (...) @cov_module_init()
ret void
}
/* Variables and functions */
int rand();
void init(int m[], unsigned n) {
  unsigned i;
  for (i = 0; i < n; i++)
    m[i] = rand() % (2 * n + 1);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    115e <init+0x4e>
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
xor    %edx,%edx
div    %ecx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <init+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
je     1149 <init+0x39>
mov    %rdi,%r14
lea    (%rsi,%rsi,1),%r15d
add    $0x1,%r15d
mov    %esi,%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
xor    %edx,%edx
div    %r15d
mov    %edx,(%r14,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <init+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @init(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %20, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %23
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = load i32, i32* %4
%13 = mul i32 2, %12
%14 = add i32 %13, 1
%15 = urem i32 %11, %14
%16 = load i32*, i32** %3
%17 = load i32, i32* %5
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
store i32 %15, i32* %19
br label %20
20: ; preds = %10
%21 = load i32, i32* %5
%22 = add i32 %21, 1
store i32 %22, i32* %5
br label %6
23: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @init(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = shl i32 %1, 1
%6 = or i32 %5, 1
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = tail call i32 (...) @rand()
%11 = urem i32 %10, %6
%12 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %11, i32* %12
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_OUT();
void do0xD3() { _I8080_OUT(); }


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

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

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

LLVM IR (-O2):
define void @do0xD3() {
%1 = tail call i32 (...) @_I8080_OUT()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void tlb_fault_handler() {
  printf("TLB fault\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"TLB fault\0A\00"
define void @tlb_fault_handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [10 x i8] c"TLB fault\00"
define void @tlb_fault_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
void kmap_assert_nomap(void) {}


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

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

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

LLVM IR (-O2):
define void @kmap_assert_nomap() {
ret void
}
/* Type definitions */
struct v4l2_enc_idx {
  int dummy;
};
typedef int /*<<< orphan*/ i;

/* Variables and functions */
int main(void) {
  struct v4l2_enc_idx i;
  (void)i;
  return sizeof(i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.v4l2_enc_idx = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.v4l2_enc_idx
store i32 0, i32* %1
ret i32 4
}

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int asuint64(double);
uint32_t top16(double x) { return asuint64(x) >> 48; }


x86 assembly (clang, -O0):
<top16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <asuint64@plt>
mov    $0x30,%ecx
sar    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<top16>:
jmp    1030 <asuint64@plt>

LLVM IR (-O0):
define i32 @top16(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @asuint64(double %3)
%5 = ashr i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @top16(double %0) {
%2 = tail call i32 @asuint64(double %0)
ret i32 poison
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
uint32_t sext8to32(uint8_t val) { return (int8_t)val; }


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

x86 assembly (clang, -O2):
<sext8to32>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @sext8to32(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
size_t my_strlen(const char *s) {
  size_t count = 0;
  while (*s++)
    ++count;
  return count;
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1139 <my_strlen+0x39>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <my_strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
cmpb   $0x0,(%rdi)
je     111f <my_strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <my_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @my_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ exec_lua(char *);
void unset_stick_mode() {
  exec_lua("get_level_use_stick = -1; get_level_max_stick = -1");
}


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

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

LLVM IR (-O0):
@.str = [51 x i8] c"get_level_use_stick = -1; get_level_max_stick = -1\00"
define void @unset_stick_mode() {
%1 = call i32 @exec_lua(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"get_level_use_stick = -1; get_level_max_stick = -1\00"
define void @unset_stick_mode() {
%1 = tail call i32 @exec_lua(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret void
}
void av_codec_get_codec_descriptor() {}


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

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

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

LLVM IR (-O2):
define void @av_codec_get_codec_descriptor() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void sayhello(const char *msg) {
  if (!msg)
    printf("Hello2, World!\n");
  else
    printf("Hello2 from %s\n", msg);
}


x86 assembly (clang, -O0):
<sayhello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113a <sayhello+0x2a>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114c <sayhello+0x3c>
mov    -0x8(%rbp),%rsi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sayhello>:
test   %rdi,%rdi
je     1136 <sayhello+0x16>
mov    %rdi,%rsi
lea    0xed1(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xed3(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Hello2, World!\0A\00"
@.str.1 = [16 x i8] c"Hello2 from %s\0A\00"
define void @sayhello(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 %7, label %5
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str.1 = [16 x i8] c"Hello2 from %s\0A\00"
@str = [15 x i8] c"Hello2, World!\00"
define void @sayhello(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ longa();
void foo1() {
  int i;
  for (i = 0; i < 100; i++)
    longa();
}


x86 assembly (clang, -O0):
<foo1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    113e <foo1+0x2e>
mov    $0x0,%al
call   1030 <longa@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <foo1+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo1>:
push   %rbx
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <longa@plt>
add    $0xffffffff,%ebx
jne    1120 <foo1+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @foo1() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 100
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 (...) @longa()
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @foo1() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 (...) @longa()
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int q1p() {
  char *argv[] = {"hello", "beautiful", "world"};
  printf("\n%s\n", "q1p ------");
  printf("%s\n", *argv + 1);
  return 1;
}


x86 assembly (clang, -O0):
<q1p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ce1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cde(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cdb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xed6(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
add    $0x1,%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [10 x i8] c"beautiful\00"
@.str.2 = [6 x i8] c"world\00"
@__const.q1p.argv = [3 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0)]
@.str.3 = [5 x i8] c"\0A%s\0A\00"
@.str.4 = [11 x i8] c"q1p ------\00"
@.str.5 = [4 x i8] c"%s\0A\00"
define i32 @q1p() {
%1 = alloca [3 x i8*]
%2 = bitcast [3 x i8*]* %1 to i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %6)
ret i32 1
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.3 = [5 x i8] c"\0A%s\0A\00"
@.str.4 = [11 x i8] c"q1p ------\00"
@.str.5 = [4 x i8] c"%s\0A\00"
define i32 @q1p() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 1))
ret i32 1
}
int Aig_WordCountOnes(unsigned uWord) {
  uWord = (uWord & 0x55555555) + ((uWord >> 1) & 0x55555555);
  uWord = (uWord & 0x33333333) + ((uWord >> 2) & 0x33333333);
  uWord = (uWord & 0x0F0F0F0F) + ((uWord >> 4) & 0x0F0F0F0F);
  uWord = (uWord & 0x00FF00FF) + ((uWord >> 8) & 0x00FF00FF);
  return (uWord & 0x0000FFFF) + (uWord >> 16);
}


x86 assembly (clang, -O0):
<Aig_WordCountOnes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x55555555,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0f0f0f,%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
and    $0xf0f0f0f,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00ff,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Aig_WordCountOnes>:
mov    %edi,%eax
and    $0x55555555,%eax
shr    %edi
and    $0x55555555,%edi
add    %edi,%eax
mov    %eax,%ecx
and    $0x33333333,%ecx
shr    $0x2,%eax
and    $0x33333333,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0x7070707,%ecx
shr    $0x4,%eax
and    $0x7070707,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0xf000f,%ecx
shr    $0x8,%eax
and    $0xf000f,%eax
add    %ecx,%eax
movzwl %ax,%ecx
shr    $0x10,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Aig_WordCountOnes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1431655765
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = and i32 %6, 1431655765
%8 = add i32 %4, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = and i32 %9, 858993459
%11 = load i32, i32* %2
%12 = lshr i32 %11, 2
%13 = and i32 %12, 858993459
%14 = add i32 %10, %13
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = and i32 %15, 252645135
%17 = load i32, i32* %2
%18 = lshr i32 %17, 4
%19 = and i32 %18, 252645135
%20 = add i32 %16, %19
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = and i32 %21, 16711935
%23 = load i32, i32* %2
%24 = lshr i32 %23, 8
%25 = and i32 %24, 16711935
%26 = add i32 %22, %25
store i32 %26, i32* %2
%27 = load i32, i32* %2
%28 = and i32 %27, 65535
%29 = load i32, i32* %2
%30 = lshr i32 %29, 16
%31 = add i32 %28, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @Aig_WordCountOnes(i32 %0) {
%2 = and i32 %0, 1431655765
%3 = lshr i32 %0, 1
%4 = and i32 %3, 1431655765
%5 = add nuw i32 %4, %2
%6 = and i32 %5, 858993459
%7 = lshr i32 %5, 2
%8 = and i32 %7, 858993459
%9 = add nuw nsw i32 %8, %6
%10 = and i32 %9, 117901063
%11 = lshr i32 %9, 4
%12 = and i32 %11, 117901063
%13 = add nuw nsw i32 %12, %10
%14 = and i32 %13, 983055
%15 = lshr i32 %13, 8
%16 = and i32 %15, 983055
%17 = add nuw nsw i32 %16, %14
%18 = and i32 %17, 31
%19 = lshr i32 %17, 16
%20 = add nuw nsw i32 %18, %19
ret i32 %20
}
void xxx(int argc) {
  int x;
#pragma omp master taskloop simd
  for (int i = 0; i < 10; ++i)
    argc = x;
}


x86 assembly (clang, -O0):
<xxx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    112c <xxx+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <xxx+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @xxx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
br label %5
5: ; preds = %10, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i32, i32* %3
store i32 %9, i32* %2
br label %10
10: ; preds = %8
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
br label %5
13: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @xxx(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ is_triple_quote(char **);
char *strchr(char *, char);
int /*<<< orphan*/ traverse_triple_quote(char **);
char *next(char *str, char delim) {
  char *tmp;
  if (is_triple_quote(&str))
    traverse_triple_quote(&str);
  tmp = strchr(str, delim);
  if (tmp)
    tmp++;
  return tmp;
}


x86 assembly (clang, -O0):
<next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <is_triple_quote@plt>
cmp    $0x0,%rax
je     115e <next+0x2e>
lea    -0x8(%rbp),%rdi
call   1050 <traverse_triple_quote@plt>
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1186 <next+0x56>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <is_triple_quote@plt>
test   %rax,%rax
je     1155 <next+0x25>
lea    0x8(%rsp),%rdi
call   1050 <traverse_triple_quote@plt>
mov    0x8(%rsp),%rdi
movsbl %bl,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmovne %rcx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @next(i8* %0, i8 signext %1) {
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i64 @is_triple_quote(i8** %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = call i32 @traverse_triple_quote(i8** %3)
br label %8
8: ; preds = %6, %2
%9 = load i8*, i8** %3
%10 = call i8* @strchr(i8* dereferenceable(1) %9, i8 signext %1)
%11 = icmp eq i8* %10, null
%12 = getelementptr inbounds i8, i8* %10, i64 1
%13 = select i1 %11, i8* null, i8* %12
ret i8* %13
}
void gdk_window_withdraw() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_withdraw() {
ret void
}
char *hash_plugin_summary(void) { return ("md5 \t\tMD5 plugin"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"md5 \09\09MD5 plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [17 x i8] c"md5 \09\09MD5 plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
int main() {
  int c = EOF;
  printf("%x\n", c);
  if (c == -1) {
    putchar('-');
    putchar('1');
    putchar('\n');
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0xffffffff,-0x8(%rbp)
jne    1172 <main+0x52>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x31,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%ebx
lea    0xecf(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
cmp    $0xffffffff,%ebx
jne    115b <main+0x3b>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x31,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @EOF
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = call i32 @putchar(i8 signext 45)
%10 = call i32 @putchar(i8 signext 49)
%11 = call i32 @putchar(i8 signext 10)
br label %12
12: ; preds = %8, %0
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %1, -1
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = tail call i32 @putchar(i8 signext 45)
%6 = tail call i32 @putchar(i8 signext 49)
%7 = tail call i32 @putchar(i8 signext 10)
br label %8
8: ; preds = %4, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int NSIG;
int /*<<< orphan*/ __SIGADDSET(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ errno;
int sigaddset(sigset_t *set, int signo) {
  if (signo <= 0 || signo >= NSIG) {
    errno = EINVAL;
    return -1;
  }
  __SIGADDSET(set, signo);
  return (0);
}


x86 assembly (clang, -O0):
<sigaddset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    113b <sigaddset+0x2b>
mov    -0x14(%rbp),%eax
mov    0x2e9d(%rip),%rcx
cmp    (%rcx),%eax
jl     1159 <sigaddset+0x49>
mov    0x2e96(%rip),%rax
mov    (%rax),%ecx
mov    0x2e95(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <sigaddset+0x5c>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <__SIGADDSET@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigaddset>:
push   %rax
test   %esi,%esi
jle    1129 <sigaddset+0x19>
mov    0x2eb4(%rip),%rax
cmp    %esi,(%rax)
jle    1129 <sigaddset+0x19>
call   1030 <__SIGADDSET@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
mov    0x2ea7(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@NSIG = global i32 0
@EINVAL = global i32 0
@errno = global i32 0
define i32 @sigaddset(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
%4 = load i32, i32* @NSIG
%5 = icmp sgt i32 %4, %1
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = load i32, i32* @EINVAL
store i32 %8, i32* @errno
br label %11
9: ; preds = %2
%10 = tail call i32 @__SIGADDSET(i32* %0, i32 %1)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ -1, %7 ], [ 0, %9 ]
ret i32 %12
}
void XConfigureWindow() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ cancel_delayed_work_sync(struct delayed_work *);
void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq,
                                       struct delayed_work *work) {
  cancel_delayed_work_sync(work);
}


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

x86 assembly (clang, -O2):
<cancel_rearming_delayed_workqueue>:
mov    %rsi,%rdi
jmp    1030 <cancel_delayed_work_sync@plt>

LLVM IR (-O0):
%struct.workqueue_struct = type { i32 }
%struct.delayed_work = type { i32 }
define void @cancel_rearming_delayed_workqueue(%struct.workqueue_struct* %0, %struct.delayed_work* %1) {
%3 = alloca %struct.workqueue_struct*
%4 = alloca %struct.delayed_work*
store %struct.workqueue_struct* %0, %struct.workqueue_struct** %3
store %struct.delayed_work* %1, %struct.delayed_work** %4
%5 = load %struct.delayed_work*, %struct.delayed_work** %4
%6 = call i32 @cancel_delayed_work_sync(%struct.delayed_work* %5)
ret void
}

LLVM IR (-O2):
%struct.workqueue_struct = type { i32 }
%struct.delayed_work = type { i32 }
define void @cancel_rearming_delayed_workqueue(%struct.workqueue_struct* nocapture readnone %0, %struct.delayed_work* %1) {
%3 = tail call i32 @cancel_delayed_work_sync(%struct.delayed_work* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void bar(int a, char buffer[a]) {
  for (int i = 1; i < a; ++i) {
    char copy[i];
    memcpy(copy, buffer, i);
  }
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1175 <bar+0x65>
mov    -0x14(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <bar+0x16>
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
cmp    $0x2,%edi
jl     115a <bar+0x4a>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
mov    %rsp,%r12
mov    %rsp,%rdi
lea    0xf(%rbx),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
mov    %r12,%rsp
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <bar+0x20>
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @bar(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
store i32 %0, i32* %3
store i8* %1, i8** %4
%8 = load i32, i32* %3
%9 = zext i32 %8 to i64
store i32 1, i32* %5
br label %10
10: ; preds = %23, %2
%11 = load i32, i32* %5
%12 = load i32, i32* %3
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %26
14: ; preds = %10
%15 = load i32, i32* %5
%16 = zext i32 %15 to i64
%17 = call i8* @llvm.stacksave()
store i8* %17, i8** %6
%18 = alloca i8, i64 %16
store i64 %16, i64* %7
%19 = load i8*, i8** %4
%20 = load i32, i32* %5
%21 = call i32 @memcpy(i8* %18, i8* %19, i32 %20)
%22 = load i8*, i8** %6
br label %23
23: ; preds = %14
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %10
26: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @bar(i32 %0, i8* %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 1, %4 ], [ %13, %7 ]
%9 = call i8* @llvm.stacksave()
%10 = alloca i8, i64 %8
%11 = trunc i64 %8 to i32
%12 = call i32 @memcpy(i8* %10, i8* %1, i32 %11)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}