xunge/DecIR huggingface dataset:
void SDHostBlockSizeSet(unsigned long ulBase, unsigned short ulBlkSize) {
  (*((volatile unsigned long *)(ulBase + 0x00000204))) =
      (((*((volatile unsigned long *)(ulBase + 0x00000204))) & 0x00000FFF) |
       (ulBlkSize & 0xFFF));
}


x86 assembly (clang, -O0):
<SDHostBlockSizeSet>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    0x204(%rax),%rcx
and    $0xfff,%rcx
movzwl -0xa(%rbp),%eax
and    $0xfff,%eax
cltq
or     %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x204(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDHostBlockSizeSet>:
mov    0x204(%rdi),%rax
or     %esi,%eax
and    $0xfff,%eax
mov    %rax,0x204(%rdi)
ret

LLVM IR (-O0):
define void @SDHostBlockSizeSet(i64 %0, i16 zeroext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 516
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, 4095
%10 = load i16, i16* %4
%11 = zext i16 %10 to i32
%12 = and i32 %11, 4095
%13 = sext i32 %12 to i64
%14 = or i64 %9, %13
%15 = load i64, i64* %3
%16 = add i64 %15, 516
%17 = inttoptr i64 %16 to i64*
store volatile i64 %14, i64* %17
ret void
}

LLVM IR (-O2):
define void @SDHostBlockSizeSet(i64 %0, i16 zeroext %1) {
%3 = add i64 %0, 516
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, 4095
%7 = and i16 %1, 4095
%8 = zext i16 %7 to i64
%9 = or i64 %6, %8
store volatile i64 %9, i64* %4
ret void
}
/* Type definitions */
struct servent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ getservbyport_r(int, char const *, struct servent *, char *,
                                   size_t, struct servent **);
int __gnat_safe_getservbyport(int port, const char *proto, struct servent *ret,
                              char *buf, size_t buflen) {
  struct servent *rh;
  int ri;
  (void)getservbyport_r(port, proto, ret, buf, buflen, &rh);
  ri = (rh == NULL) ? -1 : 0;
  return ri;
}


x86 assembly (clang, -O0):
<__gnat_safe_getservbyport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
lea    -0x30(%rbp),%r9
call   1030 <getservbyport_r@plt>
mov    -0x30(%rbp),%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__gnat_safe_getservbyport>:
push   %rax
mov    %rsp,%r9
call   1030 <getservbyport_r@plt>
cmpq   $0x1,(%rsp)
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.servent = type { i32 }
define i32 @__gnat_safe_getservbyport(i32 %0, i8* %1, %struct.servent* %2, i8* %3, i64 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca %struct.servent*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca %struct.servent*
%12 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store %struct.servent* %2, %struct.servent** %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%13 = load i32, i32* %6
%14 = load i8*, i8** %7
%15 = load %struct.servent*, %struct.servent** %8
%16 = load i8*, i8** %9
%17 = load i64, i64* %10
%18 = call i32 @getservbyport_r(i32 %13, i8* %14, %struct.servent* %15, i8* %16, i64 %17, %struct.servent** %11)
%19 = load %struct.servent*, %struct.servent** %11
%20 = icmp eq %struct.servent* %19, null
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 -1, i32 0
store i32 %22, i32* %12
%23 = load i32, i32* %12
ret i32 %23
}

LLVM IR (-O2):
%struct.servent = type { i32 }
define i32 @__gnat_safe_getservbyport(i32 %0, i8* %1, %struct.servent* %2, i8* %3, i64 %4) {
%6 = alloca %struct.servent*
%7 = bitcast %struct.servent** %6 to i8*
%8 = call i32 @getservbyport_r(i32 %0, i8* %1, %struct.servent* %2, i8* %3, i64 %4, %struct.servent** %6)
%9 = load %struct.servent*, %struct.servent** %6
%10 = icmp eq %struct.servent* %9, null
%11 = sext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
uint32_t store32(__m128i x) {
  union {
    uint32_t ret[0];
    __m128i x;
  } box;
  box.x = x;
  return box.ret[0];
}


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

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

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @store32(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = bitcast %union.anon* %3 to i32*
store i32 %4, i32* %5
%6 = bitcast %union.anon* %3 to [0 x i32]*
%7 = getelementptr inbounds [0 x i32], [0 x i32]* %6, i64 0, i64 0
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @store32(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
struct ln_rst_time {
  int dummy;
};
struct ln_lnlat_posn {
  int dummy;
};
struct ln_ell_orbit {
  int dummy;
};

/* Variables and functions */
int ln_get_ell_body_rst_horizon(double, struct ln_lnlat_posn *,
                                struct ln_ell_orbit *, double,
                                struct ln_rst_time *);
int ln_get_ell_body_rst(double JD, struct ln_lnlat_posn *observer,
                        struct ln_ell_orbit *orbit, struct ln_rst_time *rst) {
  return ln_get_ell_body_rst_horizon(JD, observer, orbit, -0.5667, rst);
}


x86 assembly (clang, -O0):
<ln_get_ell_body_rst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
movsd  0xebe(%rip),%xmm1
call   1030 <ln_get_ell_body_rst_horizon@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_ell_body_rst>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <ln_get_ell_body_rst_horizon@plt>

LLVM IR (-O0):
%struct.ln_lnlat_posn = type { i32 }
%struct.ln_ell_orbit = type { i32 }
%struct.ln_rst_time = type { i32 }
define i32 @ln_get_ell_body_rst(double %0, %struct.ln_lnlat_posn* %1, %struct.ln_ell_orbit* %2, %struct.ln_rst_time* %3) {
%5 = alloca double
%6 = alloca %struct.ln_lnlat_posn*
%7 = alloca %struct.ln_ell_orbit*
%8 = alloca %struct.ln_rst_time*
store double %0, double* %5
store %struct.ln_lnlat_posn* %1, %struct.ln_lnlat_posn** %6
store %struct.ln_ell_orbit* %2, %struct.ln_ell_orbit** %7
store %struct.ln_rst_time* %3, %struct.ln_rst_time** %8
%9 = load double, double* %5
%10 = load %struct.ln_lnlat_posn*, %struct.ln_lnlat_posn** %6
%11 = load %struct.ln_ell_orbit*, %struct.ln_ell_orbit** %7
%12 = load %struct.ln_rst_time*, %struct.ln_rst_time** %8
%13 = call i32 @ln_get_ell_body_rst_horizon(double %9, %struct.ln_lnlat_posn* %10, %struct.ln_ell_orbit* %11, double -5.667000e-01, %struct.ln_rst_time* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.ln_lnlat_posn = type { i32 }
%struct.ln_ell_orbit = type { i32 }
%struct.ln_rst_time = type { i32 }
define i32 @ln_get_ell_body_rst(double %0, %struct.ln_lnlat_posn* %1, %struct.ln_ell_orbit* %2, %struct.ln_rst_time* %3) {
%5 = tail call i32 @ln_get_ell_body_rst_horizon(double %0, %struct.ln_lnlat_posn* %1, %struct.ln_ell_orbit* %2, double -5.667000e-01, %struct.ln_rst_time* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage:  tmpl_to_c [template_file var_name]...\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"usage: tmpl_to_c [template_file var_name]...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"usage: tmpl_to_c [template_file var_name]...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
void barfoo() {}


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

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

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

LLVM IR (-O2):
define void @barfoo() {
ret void
}
int _ltrcmp(int s, int t) {
  if (s == t)
    return 0;
}


x86 assembly (clang, -O0):
<_ltrcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    111d <_ltrcmp+0x1d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_ltrcmp(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* %4
%7 = load i32, i32* %5
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %10
10: ; preds = %9, %2
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @_ltrcmp(i32 %0, i32 %1) {
ret i32 0
}
int test_imm_ADint16_reg(short val) {
  return ((val) & (0xAD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_ADint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 173
%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_ADint16_reg(i16 signext %0) {
%2 = and i16 %0, 173
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char *sbrk(int incr) {
  extern char _end;
  static char *heap_end;
  char *prev_heap_end;
  if (heap_end == 0) {
    heap_end = &_end;
  }
  prev_heap_end = heap_end;
  heap_end += incr;
  return prev_heap_end;
}


x86 assembly (clang, -O0):
<sbrk>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpq   $0x0,0x2f19(%rip)
jne    1123 <sbrk+0x23>
mov    0x2ecc(%rip),%rax
mov    %rax,0x2f05(%rip)
mov    0x2efe(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ef0(%rip),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,0x2ee3(%rip)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbrk>:
mov    0x2f21(%rip),%rax
test   %rax,%rax
jne    1113 <sbrk+0x13>
mov    0x2ed5(%rip),%rax
movslq %edi,%rcx
add    %rax,%rcx
mov    %rcx,0x2f08(%rip)
ret

LLVM IR (-O0):
@sbrk.heap_end = internal global i8* null
@_end = external global i8
define i8* @sbrk(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i8*, i8** @sbrk.heap_end
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* @_end, i8** @sbrk.heap_end
br label %7
7: ; preds = %6, %1
%8 = load i8*, i8** @sbrk.heap_end
store i8* %8, i8** %3
%9 = load i32, i32* %2
%10 = load i8*, i8** @sbrk.heap_end
%11 = sext i32 %9 to i64
%12 = getelementptr inbounds i8, i8* %10, i64 %11
store i8* %12, i8** @sbrk.heap_end
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@sbrk.heap_end = internal unnamed_addr global i8* null
@_end = external global i8
define i8* @sbrk(i32 %0) {
%2 = load i8*, i8** @sbrk.heap_end
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* @_end, i8* %2
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds i8, i8* %4, i64 %5
store i8* %6, i8** @sbrk.heap_end
ret i8* %4
}
/* Type definitions */
struct connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Write(struct connection *, char *, int);
void StartHandshake(struct connection *conn) {
  do {
    char Ch = 17;
    Write(conn, &Ch, 1);
  } while (0);
}


x86 assembly (clang, -O0):
<StartHandshake>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x11,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <Write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StartHandshake>:
push   %rax
movb   $0x11,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <Write@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.connection = type { i32 }
define void @StartHandshake(%struct.connection* %0) {
%2 = alloca %struct.connection*
%3 = alloca i8
store %struct.connection* %0, %struct.connection** %2
br label %4
4: ; preds = %1
store i8 17, i8* %3
%5 = load %struct.connection*, %struct.connection** %2
%6 = call i32 @Write(%struct.connection* %5, i8* %3, i32 1)
br label %7
7: ; preds = %4
ret void
}

LLVM IR (-O2):
%struct.connection = type { i32 }
define void @StartHandshake(%struct.connection* %0) {
%2 = alloca i8
store i8 17, i8* %2
%3 = call i32 @Write(%struct.connection* %0, i8* %2, i32 1)
ret void
}
double transition_rate_from_probabilities(double from, double to,
                                          double num_from) {
  return (((1.) < (to / from)) ? (1.) : (to / from)) / num_from;
}


x86 assembly (clang, -O0):
<transition_rate_from_probabilities>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  0xedb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1141 <transition_rate_from_probabilities+0x41>
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1150 <transition_rate_from_probabilities+0x50>
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<transition_rate_from_probabilities>:
divsd  %xmm0,%xmm1
movsd  0xef4(%rip),%xmm0
minsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @transition_rate_from_probabilities(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %4
%9 = fdiv double %7, %8
%10 = fcmp olt double 1.000000e+00, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %16
12: ; preds = %3
%13 = load double, double* %5
%14 = load double, double* %4
%15 = fdiv double %13, %14
br label %16
16: ; preds = %12, %11
%17 = phi double [ 1.000000e+00, %11 ], [ %15, %12 ]
%18 = load double, double* %6
%19 = fdiv double %17, %18
ret double %19
}

LLVM IR (-O2):
define double @transition_rate_from_probabilities(double %0, double %1, double %2) {
%4 = fdiv double %1, %0
%5 = fcmp ogt double %4, 1.000000e+00
%6 = select i1 %5, double 1.000000e+00, double %4
%7 = fdiv double %6, %2
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ baz(int *);
void foo(void) {
  int i;
#pragma omp taskloop
  for (i = 0; i < 100; i++)
    baz(&i);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1140 <foo+0x30>
lea    -0x4(%rbp),%rdi
call   1030 <baz@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <foo+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <baz@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
cmp    $0x63,%eax
jl     1130 <foo+0x20>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @foo() {
%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 @baz(i32* %1)
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 @foo() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 @baz(i32* %1)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
%7 = icmp slt i32 %5, 99
br i1 %7, label %3, label %8
8: ; preds = %3
ret void
}
/* Type definitions */
struct rusage {
  int dummy;
};
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ wait4(scalar_t__, int /*<<< orphan*/ *, int /*<<< orphan*/,
                         struct rusage *);
int main(void) {
  struct rusage rusage;
  pid_t pid;
  pid = fork();
  if (pid == 0) {
    exit(0);
  }
  wait4(pid, NULL, 0, &rusage);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <main+0x2c>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
lea    -0x8(%rbp),%rcx
call   1030 <wait4@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
je     1150 <main+0x20>
mov    %rsp,%rcx
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <wait4@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.rusage = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.rusage
%3 = alloca i64
store i32 0, i32* %1
%4 = call i64 (...) @fork()
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %0
%10 = load i64, i64* %3
%11 = call i32 @wait4(i64 %10, i32* null, i32 0, %struct.rusage* %2)
ret i32 0
}

LLVM IR (-O2):
%struct.rusage = type { i32 }
define i32 @main() {
%1 = alloca %struct.rusage
%2 = bitcast %struct.rusage* %1 to i8*
%3 = tail call i64 (...) @fork()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %0
%8 = call i32 @wait4(i64 %3, i32* null, i32 0, %struct.rusage* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void terminate(int notused) { exit(0); }


x86 assembly (clang, -O0):
<terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<terminate>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @terminate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @terminate(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
void f(int i) { i++; }


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

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

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

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int advance_prop_addr(int);
int property_address(int);
int user_byte(int);
uint16_t first_property(uint16_t object) {
  uint16_t propaddr = property_address(object);
  propaddr += (2 * user_byte(propaddr)) + 1;
  return advance_prop_addr(propaddr);
}


x86 assembly (clang, -O0):
<first_property>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <property_address@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <user_byte@plt>
shl    $0x1,%eax
add    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <advance_prop_addr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_property>:
push   %rbx
call   1050 <property_address@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <user_byte@plt>
lea    (%rbx,%rax,2),%edi
add    $0x1,%edi
pop    %rbx
jmp    1040 <advance_prop_addr@plt>

LLVM IR (-O0):
define i32 @first_property(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @property_address(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @user_byte(i32 %6)
%8 = mul nsw i32 2, %7
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %3
%11 = add nsw i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = call i32 @advance_prop_addr(i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @first_property(i32 %0) {
%2 = tail call i32 @property_address(i32 %0)
%3 = tail call i32 @user_byte(i32 %2)
%4 = shl nsw i32 %3, 1
%5 = add i32 %2, 1
%6 = add i32 %5, %4
%7 = tail call i32 @advance_prop_addr(i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *, char *);
void paint_it(const char *string, const char *color_code) {
  printf("%s%s%s", color_code, string, "\x1b[0m");
}


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

x86 assembly (clang, -O2):
<paint_it>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee6(%rip),%rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s%s%s\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @paint_it(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 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s%s%s\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @paint_it(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *strchr(char *, char const);
int isSymbol(const char letter) {
  if (strchr("{}()[].,;+-*/&|<>=~", letter) != NULL)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isSymbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1144 <isSymbol+0x34>
movl   $0x1,-0x4(%rbp)
jmp    114b <isSymbol+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSymbol>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"{}()[].,;+-*/&|<>=~\00"
define i32 @isSymbol(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i32* @strchr(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [20 x i8] c"{}()[].,;+-*/&|<>=~\00"
define i32 @isSymbol(i8 signext %0) {
%2 = tail call i32* @strchr(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cowsay_print_string(char *);
void cowsay_print_multiline(int argc, char **argv) {
  cowsay_print_string("Blah blah blah, try something shorter.");
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"Blah blah blah, try something shorter.\00"
define void @cowsay_print_multiline(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @cowsay_print_string(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Blah blah blah, try something shorter.\00"
define void @cowsay_print_multiline(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @cowsay_print_string(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}
old(a, b) int a;
int b;
{ a = b; }


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

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

LLVM IR (-O0):
define i32 @old(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
store i32 %6, i32* %4
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @old(i32 %0, i32 %1) {
ret i32 undef
}
int mul5div8(int x) {
  int mul5 = x + (x << 2);
  int mul5_mask = mul5 >> ((sizeof(int) << 3) - 1);
  int bias = mul5_mask & 7;
  return (mul5 + bias) >> 3;
}


x86 assembly (clang, -O0):
<mul5div8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x7,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
sar    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul5div8>:
lea    (%rdi,%rdi,4),%ecx
mov    %ecx,%eax
sar    $0x1f,%eax
and    $0x7,%eax
add    %ecx,%eax
sar    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @mul5div8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = shl i32 %7, 2
%9 = add nsw i32 %6, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = ashr i32 %10, 31
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = and i32 %12, 7
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = add nsw i32 %14, %15
%17 = ashr i32 %16, 3
ret i32 %17
}

LLVM IR (-O2):
define i32 @mul5div8(i32 %0) {
%2 = mul i32 %0, 5
%3 = icmp slt i32 %2, 0
%4 = select i1 %3, i32 7, i32 0
%5 = add nsw i32 %4, %2
%6 = ashr i32 %5, 3
ret i32 %6
}
int tstbit(int word, int bit) { return ((word & (1 << bit)) != 0); }


x86 assembly (clang, -O0):
<tstbit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tstbit>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @tstbit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = and i32 %5, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @tstbit(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int picosat_main(int, char **);
int main(int argc, char **argv) { return picosat_main(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <picosat_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @picosat_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Buttons_CheckState(int /*<<< orphan*/);
int /*<<< orphan*/ Display_CurrentDigit();
int /*<<< orphan*/ Display_TimerTick();
void Panel_TimerTick() {
  Buttons_CheckState(Display_CurrentDigit());
  Display_TimerTick();
}


x86 assembly (clang, -O0):
<Panel_TimerTick>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <Display_CurrentDigit@plt>
mov    %eax,%edi
call   1050 <Buttons_CheckState@plt>
mov    $0x0,%al
call   1030 <Display_TimerTick@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Panel_TimerTick>:
push   %rax
xor    %eax,%eax
call   1040 <Display_CurrentDigit@plt>
mov    %eax,%edi
call   1050 <Buttons_CheckState@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <Display_TimerTick@plt>

LLVM IR (-O0):
define void @Panel_TimerTick() {
%1 = call i32 (...) @Display_CurrentDigit()
%2 = call i32 @Buttons_CheckState(i32 %1)
%3 = call i32 (...) @Display_TimerTick()
ret void
}

LLVM IR (-O2):
define void @Panel_TimerTick() {
%1 = tail call i32 (...) @Display_CurrentDigit()
%2 = tail call i32 @Buttons_CheckState(i32 %1)
%3 = tail call i32 (...) @Display_TimerTick()
ret void
}
void subvv(double *result, const double *s1) {
  result[0] -= s1[0];
  result[1] -= s1[1];
  result[2] -= s1[2];
}


x86 assembly (clang, -O0):
<subvv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<subvv>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
subsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
subsd  0x8(%rsi),%xmm1
movsd  %xmm1,0x8(%rdi)
movsd  0x10(%rdi),%xmm0
subsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @subvv(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fsub double %10, %7
store double %11, double* %9
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = fsub double %17, %14
store double %18, double* %16
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %3
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = fsub double %24, %21
store double %25, double* %23
ret void
}

LLVM IR (-O2):
define void @subvv(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = fsub double %4, %3
store double %5, double* %0
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = fsub double %9, %7
store double %10, double* %8
%11 = getelementptr inbounds double, double* %1, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = fsub double %14, %12
store double %15, double* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIDEO_STOP;
scalar_t__ ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int videoStop(int fd) {
  int ans;
  if ((ans = ioctl(fd, VIDEO_STOP, 0) < 0)) {
    perror("VIDEO STOP: ");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<videoStop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
setl   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0xc(%rbp)
test   $0x1,%al
jne    115d <videoStop+0x3d>
jmp    1175 <videoStop+0x55>
lea    0xe9c(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117c <videoStop+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<videoStop>:
push   %rbx
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
xor    %ebx,%ebx
xor    %edx,%edx
call   1030 <ioctl@plt>
test   %rax,%rax
js     113c <videoStop+0x1c>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%ebx
jmp    1138 <videoStop+0x18>

LLVM IR (-O0):
@VIDEO_STOP = global i32 0
@.str = [13 x i8] c"VIDEO STOP: \00"
define i32 @videoStop(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @VIDEO_STOP
%7 = call i64 @ioctl(i32 %5, i32 %6, i32 0)
%8 = icmp slt i64 %7, 0
%9 = zext i1 %8 to i32
store i32 %9, i32* %4
br i1 %8, label %10, label %12
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@VIDEO_STOP = global i32 0
@.str = [13 x i8] c"VIDEO STOP: \00"
define i32 @videoStop(i32 %0) {
%2 = load i32, i32* @VIDEO_STOP
%3 = tail call i64 @ioctl(i32 %0, i32 %2, i32 0)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ -1, %5 ], [ 0, %1 ]
ret i32 %8
}
/* Type definitions */
struct task_struct {
  int dummy;
};
struct cfs_rq {
  int dummy;
};

/* Variables and functions */
struct task_struct *__load_balance_iterator(struct cfs_rq *,
                                            int /*<<< orphan*/);
int /*<<< orphan*/ first_fair(struct cfs_rq *);
struct task_struct *load_balance_start_fair(void *arg) {
  struct cfs_rq *cfs_rq = arg;
  return __load_balance_iterator(cfs_rq, first_fair(cfs_rq));
}


x86 assembly (clang, -O0):
<load_balance_start_fair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <first_fair@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <__load_balance_iterator@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_balance_start_fair>:
push   %rbx
mov    %rdi,%rbx
call   1040 <first_fair@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <__load_balance_iterator@plt>

LLVM IR (-O0):
%struct.task_struct = type { i32 }
%struct.cfs_rq = type { i32 }
define %struct.task_struct* @load_balance_start_fair(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.cfs_rq*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.cfs_rq*
store %struct.cfs_rq* %5, %struct.cfs_rq** %3
%6 = load %struct.cfs_rq*, %struct.cfs_rq** %3
%7 = load %struct.cfs_rq*, %struct.cfs_rq** %3
%8 = call i32 @first_fair(%struct.cfs_rq* %7)
%9 = call %struct.task_struct* @__load_balance_iterator(%struct.cfs_rq* %6, i32 %8)
ret %struct.task_struct* %9
}

LLVM IR (-O2):
%struct.task_struct = type { i32 }
%struct.cfs_rq = type { i32 }
define %struct.task_struct* @load_balance_start_fair(i8* %0) {
%2 = bitcast i8* %0 to %struct.cfs_rq*
%3 = tail call i32 @first_fair(%struct.cfs_rq* %2)
%4 = tail call %struct.task_struct* @__load_balance_iterator(%struct.cfs_rq* %2, i32 %3)
ret %struct.task_struct* %4
}
extern int sfvfs_fsnode_write(struct sfvfs_fs *sfs, int fid, void *buffer,
                              int len) {
  return 0;
}


x86 assembly (clang, -O0):
<sfvfs_fsnode_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sfvfs_fs = type opaque
define i32 @sfvfs_fsnode_write(%struct.sfvfs_fs* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.sfvfs_fs*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct.sfvfs_fs* %0, %struct.sfvfs_fs** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
%struct.sfvfs_fs = type opaque
define i32 @sfvfs_fsnode_write(%struct.sfvfs_fs* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void msg_error_divbyzero(char *s) {
  printf("Error: attempt to divide %s by zero.\n", s);
}


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

x86 assembly (clang, -O2):
<msg_error_divbyzero>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Error: attempt to divide %s by zero.\0A\00"
define void @msg_error_divbyzero(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Error: attempt to divide %s by zero.\0A\00"
define void @msg_error_divbyzero(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(unsigned int);
int /*<<< orphan*/ stderr;
void *MemAlloc(unsigned int size) {
  void *p;
  p = malloc(size);
  if (!p) {
    fprintf(stderr, "***** Out of memory! *****\n");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<MemAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1171 <MemAlloc+0x41>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MemAlloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <MemAlloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"***** Out of memory! *****\0A\00"
define i8* @MemAlloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"***** Out of memory! *****\0A\00"
define noalias i8* @MemAlloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int user_cmp(void const *, void const *);
int rev_cmp(const void *a, const void *b) { return -user_cmp(a, b); }


x86 assembly (clang, -O0):
<rev_cmp>:
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 <user_cmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev_cmp>:
push   %rax
call   1030 <user_cmp@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rev_cmp(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 @user_cmp(i8* %5, i8* %6)
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @rev_cmp(i8* %0, i8* %1) {
%3 = tail call i32 @user_cmp(i8* %0, i8* %1)
%4 = sub nsw i32 0, %3
ret i32 %4
}
int test_imm_53uint16_mem(unsigned short *val) {
  return ((*val) & (0x53 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_53uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x53,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_53uint16_mem>:
testb  $0x53,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_53uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 83
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ print_seq(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  print_seq(n);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <print_seq@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @print_seq(i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world!!!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"Hello world!!!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"Hello world!!!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct chanfd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ chanfd_recv(struct chanfd *, unsigned int *);
void chanfd_recv_uint(struct chanfd *channel, unsigned int *elem) {
  chanfd_recv(channel, elem);
}


x86 assembly (clang, -O0):
<chanfd_recv_uint>:
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 <chanfd_recv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chanfd_recv_uint>:
jmp    1030 <chanfd_recv@plt>

LLVM IR (-O0):
%struct.chanfd = type { i32 }
define void @chanfd_recv_uint(%struct.chanfd* %0, i32* %1) {
%3 = alloca %struct.chanfd*
%4 = alloca i32*
store %struct.chanfd* %0, %struct.chanfd** %3
store i32* %1, i32** %4
%5 = load %struct.chanfd*, %struct.chanfd** %3
%6 = load i32*, i32** %4
%7 = call i32 @chanfd_recv(%struct.chanfd* %5, i32* %6)
ret void
}

LLVM IR (-O2):
%struct.chanfd = type { i32 }
define void @chanfd_recv_uint(%struct.chanfd* %0, i32* %1) {
%3 = tail call i32 @chanfd_recv(%struct.chanfd* %0, i32* %1)
ret void
}