xunge/DecIR huggingface dataset:
double v_bin(double mu) { return (mu * (1.0 - mu)); }


x86 assembly (clang, -O0):
<v_bin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_bin>:
movsd  0xef8(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @v_bin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fsub double 1.000000e+00, %4
%6 = fmul double %3, %5
ret double %6
}

LLVM IR (-O2):
define double @v_bin(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = fmul double %2, %0
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
void *malloc(size_t);
void *xmalloc(size_t len) {
  void *p;
  if ((p = malloc(len)) == NULL)
    errx(1, "out of memory");
  return (p);
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1154 <xmalloc+0x34>
mov    $0x1,%edi
lea    0xeb1(%rip),%rsi
call   1030 <errx@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xmalloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <errx@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @errx(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int test_imm_9Auint8_reg(unsigned char val) {
  return ((val) & (0x9A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Auint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -102
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *tlib_malloc(size_t);
void *tlib_mallocz(size_t size) {
  void *ret = tlib_malloc(size);
  memset(ret, 0, size);
  return ret;
}


x86 assembly (clang, -O0):
<tlib_mallocz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <tlib_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlib_mallocz>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <tlib_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @tlib_mallocz(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @tlib_malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @tlib_mallocz(i64 %0) {
%2 = tail call i8* @tlib_malloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
void write_enn(char *buf) {
  buf[0] = 'E';
  buf[1] = '0';
  buf[2] = '1';
  buf[3] = '\0';
}


x86 assembly (clang, -O0):
<write_enn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x45,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x30,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x31,0x2(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_enn>:
movl   $0x313045,(%rdi)
ret

LLVM IR (-O0):
define void @write_enn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 69, i8* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 48, i8* %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 2
store i8 49, i8* %8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 3
store i8 0, i8* %10
ret void
}

LLVM IR (-O2):
define void @write_enn(i8* nocapture writeonly %0) {
store i8 69, i8* %0
%2 = getelementptr inbounds i8, i8* %0, i64 1
store i8 48, i8* %2
%3 = getelementptr inbounds i8, i8* %0, i64 2
store i8 49, i8* %3
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 0, i8* %4
ret void
}
/* Variables and functions */
double rand_double();
double rand_double_between(int start, int end) {
  return ((rand_double() * (double)(end - start + 1)) + (double)(start));
}


x86 assembly (clang, -O0):
<rand_double_between>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand_double@plt>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm2
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_double_between>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand_double@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cvtsi2sd %ebx,%xmm1
cvtsi2sd %ebp,%xmm2
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @rand_double_between(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call double (...) @rand_double()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = sitofp i32 %9 to double
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to double
%13 = call double @llvm.fmuladd.f64(double %5, double %10, double %12)
ret double %13
}

LLVM IR (-O2):
define double @rand_double_between(i32 %0, i32 %1) {
%3 = tail call double (...) @rand_double()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = sitofp i32 %5 to double
%7 = sitofp i32 %0 to double
%8 = tail call double @llvm.fmuladd.f64(double %3, double %6, double %7)
ret double %8
}
void RTVfsSymlinkRetain(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsSymlinkRetain() {
ret void
}
void XtCallAcceptFocus() {}


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

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

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

LLVM IR (-O2):
define void @XtCallAcceptFocus() {
ret void
}
unsigned int maxSpeedCheck(unsigned int speed, unsigned int max) {
  BCLMarkFunc(__PRETTY_FUNCTION__, __FUNCTION__);
  return (speed > max) ? max : speed;
}


x86 assembly (clang, -O0):
<maxSpeedCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xedb(%rip),%rdi
lea    0xf0b(%rip),%rsi
mov    $0x0,%al
call   1030 <BCLMarkFunc@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    114a <maxSpeedCheck+0x3a>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <maxSpeedCheck+0x40>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxSpeedCheck>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
lea    0xf12(%rip),%rsi
xor    %eax,%eax
call   1030 <BCLMarkFunc@plt>
cmp    %ebx,%ebp
cmova  %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__PRETTY_FUNCTION__.maxSpeedCheck = [55 x i8] c"unsigned int maxSpeedCheck(unsigned int, unsigned int)\00"
@__FUNCTION__.maxSpeedCheck = [14 x i8] c"maxSpeedCheck\00"
define i32 @maxSpeedCheck(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @BCLMarkFunc to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @__PRETTY_FUNCTION__.maxSpeedCheck, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__.maxSpeedCheck, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp ugt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
br label %13
11: ; preds = %2
%12 = load i32, i32* %3
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ %10, %9 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
@__PRETTY_FUNCTION__.maxSpeedCheck = [55 x i8] c"unsigned int maxSpeedCheck(unsigned int, unsigned int)\00"
@__FUNCTION__.maxSpeedCheck = [14 x i8] c"maxSpeedCheck\00"
define i32 @maxSpeedCheck(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @BCLMarkFunc to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @__PRETTY_FUNCTION__.maxSpeedCheck, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__.maxSpeedCheck, i64 0, i64 0))
%4 = icmp ugt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
ret i32 %5
}
main() { return (void *)5; }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 ptrtoint (i8* inttoptr (i64 5 to i8*) to i32)
}

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
void fpeek(uint8_t *buf, int bytes, FILE *file) {
  fread(buf, sizeof(uint8_t), bytes, file);
  fseek(file, -bytes, SEEK_CUR);
}


x86 assembly (clang, -O0):
<fpeek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x4,%esi
call   1030 <fread@plt>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
sub    -0xc(%rbp),%esi
mov    0x2e90(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpeek>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
mov    $0x4,%esi
mov    %ebp,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
neg    %ebp
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fseek@plt>

LLVM IR (-O0):
@SEEK_CUR = global i32 0
define void @fpeek(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 @fread(i32* %7, i32 4, i32 %8, i32* %9)
%11 = load i32*, i32** %6
%12 = load i32, i32* %5
%13 = sub nsw i32 0, %12
%14 = load i32, i32* @SEEK_CUR
%15 = call i32 @fseek(i32* %11, i32 %13, i32 %14)
ret void
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
define void @fpeek(i32* nocapture %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32 @fread(i32* %0, i32 4, i32 %1, i32* %2)
%5 = sub nsw i32 0, %1
%6 = load i32, i32* @SEEK_CUR
%7 = tail call i32 @fseek(i32* %2, i32 %5, i32 %6)
ret void
}
int main() {
  typedef int INT, INT2, INT3;
  typedef float FLOAT;
  typedef void VOID;
  typedef void VOID2, VOID3;
  INT f[3][3 * 3 - (4 + 2) / 2];
  FLOAT f2;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [3 x [6 x i32]]
%2 = alloca float
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void gtk_action_create_menu_item() {}


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

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

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

LLVM IR (-O2):
define void @gtk_action_create_menu_item() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getMacAddress(char *);
int main(int argc, char *argv[]) { getMacAddress(argv[1]); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <getMacAddress@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @getMacAddress(i8* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @getMacAddress(i8* %4)
ret i32 0
}
int idx_msb(unsigned int x) {
  int ret = 0;
  if (x > 0) {
    ret = ((sizeof(x) << 3) - __builtin_clz(x));
  }
  return ret;
}


x86 assembly (clang, -O0):
<idx_msb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jbe    112f <idx_msb+0x2f>
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
movslq %eax,%rcx
mov    $0x20,%eax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<idx_msb>:
test   %edi,%edi
je     110e <idx_msb+0xe>
bsr    %edi,%eax
xor    $0xffffffe0,%eax
add    $0x21,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @idx_msb(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp ugt i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @llvm.ctlz.i32(i32 %7, i1 true)
%9 = sext i32 %8 to i64
%10 = sub i64 32, %9
%11 = trunc i64 %10 to i32
store i32 %11, i32* %3
br label %12
12: ; preds = %6, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @idx_msb(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%5 = sub nuw nsw i32 32, %4
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
void r_list_fini(struct r_list *list) {
  do {
    ;
  } while (0);
}


x86 assembly (clang, -O0):
<r_list_fini>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
jmp    110d <r_list_fini+0xd>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.r_list = type opaque
define void @r_list_fini(%struct.r_list* %0) {
%2 = alloca %struct.r_list*
store %struct.r_list* %0, %struct.r_list** %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.r_list = type opaque
define void @r_list_fini(%struct.r_list* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int rand();
int main() {
  for (int i = 0; i < 10000; i++) {
    int random = rand();
    if (random < 0) {
      abort();
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jge    1171 <main+0x51>
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    115e <main+0x3e>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1163 <main+0x43>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2710,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
test   %eax,%eax
js     1144 <main+0x24>
add    $0xffffffff,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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
br label %4
4: ; preds = %14, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10000
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = call i32 (...) @rand()
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %7
br label %14
14: ; preds = %13
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %4
17: ; preds = %4
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
br label %5
1: ; preds = %5
%2 = add nuw nsw i32 %6, 1
%3 = icmp eq i32 %2, 10000
br i1 %3, label %4, label %5
4: ; preds = %1
ret i32 0
5: ; preds = %0, %1
%6 = phi i32 [ 0, %0 ], [ %2, %1 ]
%7 = tail call i32 (...) @rand()
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %1
9: ; preds = %5
%10 = tail call i32 (...) @abort()
unreachable
}
int test_imm_22int8_reg(signed char val) {
  return ((val) & (-0x22 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_22int8_reg(i8 signext %0) {
%2 = and i8 %0, -34
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ first_element_artist(char *);
int /*<<< orphan*/ print_list(int /*<<< orphan*/);
void print_entries_artist(char *song_artist) {
  print_list(first_element_artist(song_artist));
}


x86 assembly (clang, -O0):
<print_entries_artist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <first_element_artist@plt>
mov    %eax,%edi
call   1030 <print_list@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_entries_artist>:
push   %rax
call   1040 <first_element_artist@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <print_list@plt>

LLVM IR (-O0):
define void @print_entries_artist(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @first_element_artist(i8* %3)
%5 = call i32 @print_list(i32 %4)
ret void
}

LLVM IR (-O2):
define void @print_entries_artist(i8* %0) {
%2 = tail call i32 @first_element_artist(i8* %0)
%3 = tail call i32 @print_list(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(char const *, char const *);
int octet_contains(const char *pat, const char *text) {
  return (strstr(text, pat) != NULL);
}


x86 assembly (clang, -O0):
<octet_contains>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<octet_contains>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @octet_contains(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32* @strstr(i8* %5, i8* %6)
%8 = icmp ne i32* %7, null
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @octet_contains(i8* nocapture %0, i8* %1) {
%3 = tail call i32* @strstr(i8* dereferenceable(1) %1, i8* dereferenceable(1) %0)
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ scanf(char *, int *);
void inputArray(int *a, unsigned size) {
  unsigned cnt = 0;
  for (; cnt < size; ++cnt) {
    scanf("%d", a + cnt);
    getchar();
  }
}


x86 assembly (clang, -O0):
<inputArray>:
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    1171 <inputArray+0x51>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%eax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xea9(%rip),%rdi
call   1040 <scanf@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <inputArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputArray>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     115c <inputArray+0x3c>
mov    %rdi,%rbx
mov    %esi,%r15d
lea    0xeca(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r15
jne    1140 <inputArray+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @inputArray(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 = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %14)
%16 = call i32 (...) @getchar()
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @inputArray(i32* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%10 = tail call i32 (...) @getchar()
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void func_2g(int const *const *const i) { printf("func_2g : %d\n", **i); }


x86 assembly (clang, -O0):
<func_2g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_2g>:
mov    (%rdi),%rax
mov    (%rax),%esi
lea    0xee4(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"func_2g : %d\0A\00"
define void @func_2g(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = load i32, i32* %2
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
double Sleef_asin_u10(double x) { return __builtin_asin(x); }


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

x86 assembly (clang, -O2):
<Sleef_asin_u10>:
jmp    1030 <asin@plt>

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

LLVM IR (-O2):
define double @Sleef_asin_u10(double %0) {
%2 = tail call double @asin(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_secp256k1_mul(uintptr_t, uintptr_t, uintptr_t);
void fiat_secp256k1_mul(uint32_t out1[8], const uint32_t arg1[8],
                        const uint32_t arg2[8]) {
  internal_fiat_secp256k1_mul((uintptr_t)out1, (uintptr_t)arg1,
                              (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_secp256k1_mul>:
jmp    1030 <internal_fiat_secp256k1_mul@plt>

LLVM IR (-O0):
define void @fiat_secp256k1_mul(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 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_secp256k1_mul(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_secp256k1_mul(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_secp256k1_mul(i64 %4, i64 %5, i64 %6)
ret void
}
/* Type definitions */
struct obus_object {
  int dummy;
};
struct net_interface {
  int dummy;
};

/* Variables and functions */
int obus_object_is_registered(struct obus_object const *);
int net_interface_is_registered(const struct net_interface *object) {
  const struct obus_object *obj = (const struct obus_object *)object;
  return obus_object_is_registered(obj);
}


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

x86 assembly (clang, -O2):
<net_interface_is_registered>:
jmp    1030 <obus_object_is_registered@plt>

LLVM IR (-O0):
%struct.net_interface = type { i32 }
%struct.obus_object = type { i32 }
define i32 @net_interface_is_registered(%struct.net_interface* %0) {
%2 = alloca %struct.net_interface*
%3 = alloca %struct.obus_object*
store %struct.net_interface* %0, %struct.net_interface** %2
%4 = load %struct.net_interface*, %struct.net_interface** %2
%5 = bitcast %struct.net_interface* %4 to %struct.obus_object*
store %struct.obus_object* %5, %struct.obus_object** %3
%6 = load %struct.obus_object*, %struct.obus_object** %3
%7 = call i32 @obus_object_is_registered(%struct.obus_object* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.net_interface = type { i32 }
%struct.obus_object = type { i32 }
define i32 @net_interface_is_registered(%struct.net_interface* %0) {
%2 = bitcast %struct.net_interface* %0 to %struct.obus_object*
%3 = tail call i32 @obus_object_is_registered(%struct.obus_object* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ strncmp(char const *, char const *, int /*<<< orphan*/);
int strbw(const char *a, const char *b) { return !strncmp(a, b, strlen(b)); }


x86 assembly (clang, -O0):
<strbw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strbw>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @strbw(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 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @strbw(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ run_service();
int /*<<< orphan*/ setsid();
void daemonize(void) {
  if (fork()) {
    return;
  }
  setsid();
  if (fork()) {
    _exit(0);
  }
  run_service();
}


x86 assembly (clang, -O0):
<daemonize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <fork@plt>
cmp    $0x0,%rax
je     115a <daemonize+0x1a>
jmp    1180 <daemonize+0x40>
mov    $0x0,%al
call   1040 <setsid@plt>
mov    $0x0,%al
call   1060 <fork@plt>
cmp    $0x0,%rax
je     1179 <daemonize+0x39>
xor    %edi,%edi
call   1030 <_exit@plt>
mov    $0x0,%al
call   1050 <run_service@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<daemonize>:
push   %rax
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
je     114f <daemonize+0xf>
pop    %rax
ret
xor    %eax,%eax
call   1040 <setsid@plt>
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
jne    116a <daemonize+0x2a>
xor    %eax,%eax
pop    %rcx
jmp    1050 <run_service@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @daemonize() {
%1 = call i64 (...) @fork()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %12
4: ; preds = %0
%5 = call i32 (...) @setsid()
%6 = call i64 (...) @fork()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = call i32 @_exit(i32 0)
unreachable
10: ; preds = %4
%11 = call i32 (...) @run_service()
br label %12
12: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
define void @daemonize() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %11
3: ; preds = %0
%4 = tail call i32 (...) @setsid()
%5 = tail call i64 (...) @fork()
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @_exit(i32 0)
unreachable
9: ; preds = %3
%10 = tail call i32 (...) @run_service()
br label %11
11: ; preds = %0, %9
ret void
}
double vde_forw_pendulum_sq(double x) { return x * x; }


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

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

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

LLVM IR (-O2):
define double @vde_forw_pendulum_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
int sys$cmkrnl(int (*routin)(), unsigned int *arglst) {
  return ({
    unsigned long resultvar;
    register long int _a2 asm("rsi") = (long)(arglst);
    register long int _a1 asm("rdi") = (long)(routin);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(81), "r"(_a1), "r"(_a2)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$cmkrnl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x51,%rax
int    $0x81
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$cmkrnl>:
mov    $0x51,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$cmkrnl"(i32 (...)* %0, i32* %1) {
%3 = alloca i32 (...)*
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32 (...)* %0, i32 (...)** %3
store i32* %1, i32** %4
%9 = load i32*, i32** %4
%10 = ptrtoint i32* %9 to i64
store i64 %10, i64* %6
%11 = load i32 (...)*, i32 (...)** %3
%12 = ptrtoint i32 (...)* %11 to i64
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = load i64, i64* %6
%15 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 81, i64 %13, i64 %14)
store i64 %15, i64* %5
%16 = load i64, i64* %5
store i64 %16, i64* %8
%17 = load i64, i64* %8
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @"sys$cmkrnl"(i32 (...)* %0, i32* %1) {
%3 = ptrtoint i32* %1 to i64
%4 = ptrtoint i32 (...)* %0 to i64
%5 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 81, i64 %4, i64 %3)
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
char const *find_pattern_in_string(char const *, char *);
const char *find_date_time_in_string(const char *str) {
  return find_pattern_in_string(
      str, "\376\376\376\376-\376\376-\376\376\377\376\376.\376\376.\376\376");
}


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

x86 assembly (clang, -O2):
<find_date_time_in_string>:
lea    0xee9(%rip),%rsi
jmp    1030 <find_pattern_in_string@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"\FE\FE\FE\FE-\FE\FE-\FE\FE\FF\FE\FE.\FE\FE.\FE\FE\00"
define i8* @find_date_time_in_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @find_pattern_in_string(i8* %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [20 x i8] c"\FE\FE\FE\FE-\FE\FE-\FE\FE\FF\FE\FE.\FE\FE.\FE\FE\00"
define i8* @find_date_time_in_string(i8* %0) {
%2 = tail call i8* @find_pattern_in_string(i8* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
char *pd9p_enc2(char *buf, uint16_t val) {
  buf[0] = val % (1 << 8);
  buf[1] = val >> 8;
  return buf + 2;
}


x86 assembly (clang, -O0):
<pd9p_enc2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pd9p_enc2>:
mov    %si,(%rdi)
lea    0x2(%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @pd9p_enc2(i8* writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = getelementptr inbounds i8, i8* %0, i64 2
ret i8* %7
}
float convert(int deg) {
  float result;
  result = (deg - 32.) / 1.8;
  return result;
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xef4(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xee0(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
cvtsi2sd %edi,%xmm0
addsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @convert(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = fsub double %5, 3.200000e+01
%7 = fdiv double %6, 1.800000e+00
%8 = fptrunc double %7 to float
store float %8, float* %3
%9 = load float, float* %3
ret float %9
}

LLVM IR (-O2):
define float @convert(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fdiv double %3, 1.800000e+00
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int strlen(char *);
char *usage(char *argv0) {
  int size = (strlen(argv0) + strlen("Usage:  <textfile>") + 2);
  char *usage = (char *)malloc(size);
  snprintf(usage, size, "Usage: %s <textfile>", argv0);
  return usage;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
lea    0xeb1(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rcx
lea    0xe94(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %eax,%r14d
lea    0xeb7(%rip),%rdi
call   1030 <strlen@plt>
lea    (%r14,%rax,1),%ebp
add    $0x2,%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xead(%rip),%rdx
mov    %rax,%rdi
mov    %ebp,%esi
mov    %r15,%rcx
call   1040 <snprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Usage: <textfile>\00"
@.str.1 = [21 x i8] c"Usage: %s <textfile>\00"
define i8* @usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = call i32 @strlen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = add nsw i32 %6, %7
%9 = add nsw i32 %8, 2
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i32, i32* %3
%15 = load i8*, i8** %2
%16 = call i32 @snprintf(i8* %13, i32 %14, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
@.str = [19 x i8] c"Usage: <textfile>\00"
@.str.1 = [21 x i8] c"Usage: %s <textfile>\00"
define i8* @usage(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = add i32 %2, 2
%5 = add i32 %4, %3
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @snprintf(i8* %7, i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i8* %7
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ selection;
};
typedef TYPE_1__ XSelectionEvent;

/* Variables and functions */
unsigned long get_XSelectionEvent_selection(void *_p) {
  return (unsigned long)((XSelectionEvent *)_p)->selection;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XSelectionEvent_selection(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
__attribute__((always_)) void __writew(unsigned short val,
                                       volatile void *addr) {
  asm volatile("mov"
               "w"
               " %0,%1"
               :
               : "r"(val), "m"(*(volatile unsigned short *)addr));
}


x86 assembly (clang, -O0):
<__writew>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x10(%rbp),%rcx
mov    %ax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__writew>:
mov    %di,(%rsi)
ret

LLVM IR (-O0):
define void @__writew(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
store i16 %0, i16* %3
store i8* %1, i8** %4
%5 = load i16, i16* %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i16*
ret void
}

LLVM IR (-O2):
define void @__writew(i16 zeroext %0, i8* %1) {
%3 = bitcast i8* %1 to i16*
tail call void asm sideeffect "movw $0,$1", "r,*m,~{dirflag},~{fpsr},~{flags}"(i16 %0, i16* elementtype(i16) %3)
ret void
}
/* Variables and functions */
int a1();
int a2();
int b1();
int b2();
int c(void) { return 0 + a1() + a2() + b1() + b2(); }


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <a1@plt>
add    $0x0,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <a2@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <b1@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <b2@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <a1@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <a2@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1060 <b1@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1040 <b2@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @c() {
%1 = call i32 (...) @a1()
%2 = add nsw i32 0, %1
%3 = call i32 (...) @a2()
%4 = add nsw i32 %2, %3
%5 = call i32 (...) @b1()
%6 = add nsw i32 %4, %5
%7 = call i32 (...) @b2()
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @c() {
%1 = tail call i32 (...) @a1()
%2 = tail call i32 (...) @a2()
%3 = add nsw i32 %2, %1
%4 = tail call i32 (...) @b1()
%5 = add nsw i32 %3, %4
%6 = tail call i32 (...) @b2()
%7 = add nsw i32 %5, %6
ret i32 %7
}
/* Type definitions */
struct timeval {
  long tv_sec;
  long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ srand(long);
void seedgenrand() {
  long seed;
  struct timeval now;
  gettimeofday(&now, NULL);
  seed = now.tv_sec * now.tv_usec;
  srand(seed);
}


x86 assembly (clang, -O0):
<seedgenrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x18(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <srand@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seedgenrand>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x10(%rsp),%rdi
imul   0x8(%rsp),%rdi
add    $0x18,%rsp
jmp    1040 <srand@plt>

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define void @seedgenrand() {
%1 = alloca i64
%2 = alloca %struct.timeval
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%7 = load i64, i64* %6
%8 = mul nsw i64 %5, %7
store i64 %8, i64* %1
%9 = load i64, i64* %1
%10 = call i32 @srand(i64 %9)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define void @seedgenrand() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = mul nsw i64 %7, %5
%9 = tail call i32 @srand(i64 %8)
ret void
}
int f(int x, int y) {
  int ret;
  if (x == y)
    ret = x - y;
  else
    ret = 1;
  return ret;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1124 <f+0x24>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112b <f+0x2b>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}