xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int xCompileOptions(void *pCtx, int nVal, char **azVal, char **azCol) {
  printf("-- Compile option: %s\n", azVal[0]);
  return 0;
}


x86 assembly (clang, -O0):
<xCompileOptions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"-- Compile option: %s\0A\00"
define i32 @xCompileOptions(i8* %0, i32 %1, i8** %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8**
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%9 = load i8**, i8*** %7
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"-- Compile option: %s\0A\00"
define i32 @xCompileOptions(i8* nocapture readnone %0, i32 %1, i8** nocapture %2, i8** nocapture readnone %3) {
%5 = load i8*, i8** %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ func_1(int, char *, unsigned long);
int main(int argc, char *argv[]) {
  int a;
  char *b;
  unsigned long c;
  a = 1;
  b = "This is a string.";
  c = 0xdeadL;
  func_1(a, b, c);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    0xebc(%rip),%rax
mov    %rax,-0x20(%rbp)
movq   $0xdead,-0x28(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <func_1@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0xdead,%edx
mov    $0x1,%edi
call   1030 <func_1@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"This is a string.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %7
store i64 57005, i64* %8
%9 = load i32, i32* %6
%10 = load i8*, i8** %7
%11 = load i64, i64* %8
%12 = call i32 @func_1(i32 %9, i8* %10, i64 %11)
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"This is a string.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @func_1(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 57005)
%4 = tail call i32 @exit(i32 0)
unreachable
}
int signbit(x)
double x;
{
  union {
    double d;
    short s[4];
    int i[2];
  } u;
  u.d = x;
  if (sizeof(int) == 4) {
    return (u.i[1] < 0);
  } else {
    return (u.s[3] < 0);
  }
}


x86 assembly (clang, -O0):
<signbit>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signbit>:
movmskpd %xmm0,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @signbit(double %0) {
%2 = bitcast double %0 to i64
%3 = lshr i64 %2, 63
%4 = trunc i64 %3 to i32
ret i32 %4
}
int GetPclk() { return 14745600; }


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

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

LLVM IR (-O0):
define i32 @GetPclk() {
ret i32 14745600
}

LLVM IR (-O2):
define i32 @GetPclk() {
ret i32 14745600
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int state;
};
struct TYPE_4__ {
  TYPE_1__ xproperty;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xproperty_state(void *_p, int _v) {
  ((XEvent *)_p)->xproperty.state = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xproperty_state>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xproperty_state(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xproperty_state(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
const char *stb_plural(int n) { return n == 1 ? "" : "s"; }


x86 assembly (clang, -O0):
<stb_plural>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xeef(%rip),%rax
lea    0xee9(%rip),%rcx
cmp    $0x1,%edx
cmove  %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_plural>:
cmp    $0x1,%edi
lea    0xef7(%rip),%rcx
lea    0xeef(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"s\00"
define i8* @stb_plural(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"s\00"
define i8* @stb_plural(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
/* Type definitions */
struct tipc_msg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ msg_set_bits(struct tipc_msg *, int, int /*<<< orphan*/, int,
                                int);
void msg_set_grp_evt(struct tipc_msg *m, int n) {
  msg_set_bits(m, 10, 0, 0x3, n);
}


x86 assembly (clang, -O0):
<msg_set_grp_evt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%r8d
mov    $0xa,%esi
xor    %edx,%edx
mov    $0x3,%ecx
call   1030 <msg_set_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_set_grp_evt>:
mov    %esi,%r8d
mov    $0xa,%esi
xor    %edx,%edx
mov    $0x3,%ecx
jmp    1030 <msg_set_bits@plt>

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

LLVM IR (-O2):
%struct.tipc_msg = type { i32 }
define void @msg_set_grp_evt(%struct.tipc_msg* %0, i32 %1) {
%3 = tail call i32 @msg_set_bits(%struct.tipc_msg* %0, i32 10, i32 0, i32 3, i32 %1)
ret void
}
int keynybble(const unsigned char *key, int keybytes, int index) {
  int i = index % (2 * keybytes);
  int j;
  j = key[i >> 1];
  if (i & 1)
    j >>= 4;
  return (j & 0xf);
}


x86 assembly (clang, -O0):
<keynybble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sar    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1149 <keynybble+0x49>
mov    -0x18(%rbp),%eax
sar    $0x4,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<keynybble>:
mov    %edx,%eax
add    %esi,%esi
cltd
idiv   %esi
mov    %edx,%eax
sar    %eax
cltq
movzbl (%rdi,%rax,1),%ecx
mov    %ecx,%eax
shr    $0x4,%eax
test   $0x1,%dl
cmove  %ecx,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @keynybble(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = mul nsw i32 2, %10
%12 = srem i32 %9, %11
store i32 %12, i32* %7
%13 = load i8*, i8** %4
%14 = load i32, i32* %7
%15 = ashr i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
store i32 %19, i32* %8
%20 = load i32, i32* %7
%21 = and i32 %20, 1
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %3
%24 = load i32, i32* %8
%25 = ashr i32 %24, 4
store i32 %25, i32* %8
br label %26
26: ; preds = %23, %3
%27 = load i32, i32* %8
%28 = and i32 %27, 15
ret i32 %28
}

LLVM IR (-O2):
define i32 @keynybble(i8* nocapture %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %1, 1
%5 = srem i32 %2, %4
%6 = ashr i32 %5, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = and i32 %5, 1
%12 = icmp eq i32 %11, 0
%13 = lshr i32 %10, 4
%14 = select i1 %12, i32 %10, i32 %13
%15 = and i32 %14, 15
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_PRINTABLESTRING;

/* Variables and functions */
int /*<<< orphan*/ ASN1_PRINTABLESTRING_it;
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int i2d_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_PRINTABLESTRING_it);
}


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

x86 assembly (clang, -O2):
<i2d_ASN1_PRINTABLESTRING>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@ASN1_PRINTABLESTRING_it = global i32 0
define i32 @i2d_ASN1_PRINTABLESTRING(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @ASN1_PRINTABLESTRING_it)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
void i830_debug_hvsyncblank(char *result, int len, int reg, uint32_t val,
                            uint32_t devid) {
  snprintf(result, len, "%d start, %d end", (val & 0xffff) + 1,
           ((val & 0xffff0000) >> 16) + 1);
}


x86 assembly (clang, -O0):
<i830_debug_hvsyncblank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%ecx
and    $0xffff,%ecx
add    $0x1,%ecx
mov    -0x14(%rbp),%r8d
and    $0xffff0000,%r8d
shr    $0x10,%r8d
add    $0x1,%r8d
lea    0xeaa(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i830_debug_hvsyncblank>:
movzwl %cx,%eax
add    $0x1,%eax
shr    $0x10,%ecx
lea    0x1(%rcx),%r8d
lea    0xedc(%rip),%rdx
mov    %eax,%ecx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%d start, %d end\00"
define void @i830_debug_hvsyncblank(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %9
%14 = and i32 %13, 65535
%15 = add nsw i32 %14, 1
%16 = load i32, i32* %9
%17 = and i32 %16, -65536
%18 = lshr i32 %17, 16
%19 = add i32 %18, 1
%20 = call i32 @snprintf(i8* %11, i32 %12, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%d start, %d end\00"
define void @i830_debug_hvsyncblank(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = and i32 %3, 65535
%7 = add nuw nsw i32 %6, 1
%8 = lshr i32 %3, 16
%9 = add nuw nsw i32 %8, 1
%10 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
ret void
}
/* Variables and functions */
int fc8150_bypass_read(void *, unsigned char, unsigned char, unsigned char *,
                       unsigned char);
int fci_bypass_read(void *hDevice, unsigned char chip, unsigned char addr,
                    unsigned char alen, unsigned char *data,
                    unsigned char len) {
  int res;
  res = fc8150_bypass_read(hDevice, chip, addr, data, len);
  return res;
}


x86 assembly (clang, -O0):
<fci_bypass_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r9b,%al
mov    %rdi,-0x8(%rbp)
mov    %sil,-0x9(%rbp)
mov    %dl,-0xa(%rbp)
mov    %cl,-0xb(%rbp)
mov    %r8,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%dl
mov    -0xa(%rbp),%al
mov    -0x18(%rbp),%rcx
movzbl %dl,%esi
movzbl %al,%edx
movzbl -0x19(%rbp),%r8d
call   1030 <fc8150_bypass_read@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fci_bypass_read>:
mov    %r8,%rcx
mov    %r9d,%r8d
jmp    1030 <fc8150_bypass_read@plt>

LLVM IR (-O0):
define i32 @fci_bypass_read(i8* %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3, i8* %4, i8 zeroext %5) {
%7 = alloca i8*
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8*
%12 = alloca i8
%13 = alloca i32
store i8* %0, i8** %7
store i8 %1, i8* %8
store i8 %2, i8* %9
store i8 %3, i8* %10
store i8* %4, i8** %11
store i8 %5, i8* %12
%14 = load i8*, i8** %7
%15 = load i8, i8* %8
%16 = load i8, i8* %9
%17 = load i8*, i8** %11
%18 = load i8, i8* %12
%19 = call i32 @fc8150_bypass_read(i8* %14, i8 zeroext %15, i8 zeroext %16, i8* %17, i8 zeroext %18)
store i32 %19, i32* %13
%20 = load i32, i32* %13
ret i32 %20
}

LLVM IR (-O2):
define i32 @fci_bypass_read(i8* %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3, i8* %4, i8 zeroext %5) {
%7 = tail call i32 @fc8150_bypass_read(i8* %0, i8 zeroext %1, i8 zeroext %2, i8* %4, i8 zeroext %5)
ret i32 %7
}
char *rindex(s, c)
register char *s, c;
{
  register char *result;
  result = 0;
  do
    if (*s == c)
      result = s;
  while (*s++ != 0);
  return (result);
}


x86 assembly (clang, -O0):
<rindex>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1131 <rindex+0x31>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1136 <rindex+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1116 <rindex+0x16>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rindex>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi),%ecx
cmp    %sil,%cl
cmove  %rdi,%rax
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <rindex+0x10>
ret

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

LLVM IR (-O2):
define i8* @rindex(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = phi i8* [ null, %2 ], [ %8, %3 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, %1
%8 = select i1 %7, i8* %4, i8* %5
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = icmp eq i8 %6, 0
br i1 %10, label %11, label %3
11: ; preds = %3
ret i8* %8
}
/* Variables and functions */
int printf(char *, ...);
void f3(void) {
  printf("%d\n", 0 ? printf("x1\n") : 11);
  printf("%d\n", 1 ? 12 : printf("x2\n"));
  printf("%d\n", 0 && printf("x3\n"));
  printf("%d\n", 1 || printf("x4\n"));
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xb,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0xc,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @f3() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 11)
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 12)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @f3() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 11)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 12)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FCEU_QSimpleCommand(int);
void FCEUI_FDSSelect(void) { FCEU_QSimpleCommand(0x1A); }


x86 assembly (clang, -O0):
<FCEUI_FDSSelect>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1a,%edi
call   1030 <FCEU_QSimpleCommand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FCEUI_FDSSelect>:
mov    $0x1a,%edi
jmp    1030 <FCEU_QSimpleCommand@plt>

LLVM IR (-O0):
define void @FCEUI_FDSSelect() {
%1 = call i32 @FCEU_QSimpleCommand(i32 26)
ret void
}

LLVM IR (-O2):
define void @FCEUI_FDSSelect() {
%1 = tail call i32 @FCEU_QSimpleCommand(i32 26)
ret void
}
/* Variables and functions */
int rand();
double drand(double min, double max) {
  double r = ((double)(rand() % 10000)) / 10000.0;
  return min + r * (max - min);
}


x86 assembly (clang, -O0):
<drand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x2710,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  0xec3(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drand>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x68db8bad,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2c,%rcx
add    %edx,%ecx
imul   $0x2710,%ecx,%ecx
sub    %ecx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
divsd  0xeac(%rip),%xmm1
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @drand(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = call i32 (...) @rand()
%7 = srem i32 %6, 10000
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.000000e+04
store double %9, double* %5
%10 = load double, double* %3
%11 = load double, double* %5
%12 = load double, double* %4
%13 = load double, double* %3
%14 = fsub double %12, %13
%15 = call double @llvm.fmuladd.f64(double %11, double %14, double %10)
ret double %15
}

LLVM IR (-O2):
define double @drand(double %0, double %1) {
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 10000
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 1.000000e+04
%7 = fsub double %1, %0
%8 = tail call double @llvm.fmuladd.f64(double %6, double %7, double %0)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ nondet_assume(int);
void map2check_assume(int expr) { nondet_assume(expr); }


x86 assembly (clang, -O0):
<map2check_assume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <nondet_assume@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map2check_assume>:
jmp    1030 <nondet_assume@plt>

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

LLVM IR (-O2):
define void @map2check_assume(i32 %0) {
%2 = tail call i32 @nondet_assume(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(int /*<<< orphan*/);
void ft_putstr(char *str) {
  while (*str)
    ft_putchar(*str++);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <ft_putstr+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <ft_putchar@plt>
jmp    111c <ft_putstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <ft_putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <ft_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ft_putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @ft_putchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int logarithm(int base, int x) { return -1; }


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

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

LLVM IR (-O0):
define i32 @logarithm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @logarithm(i32 %0, i32 %1) {
ret i32 -1
}
/* Type definitions */
struct timespec {
  int dummy;
};
struct io_event {
  int dummy;
};
typedef int /*<<< orphan*/ aio_context_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_io_getevents;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, long, long,
            struct io_event *, struct timespec *);
int __io_getevents(aio_context_t ctx_id, long min_nr, long nr,
                   struct io_event *events, struct timespec *timeout) {
  return syscall(__NR_io_getevents, ctx_id, min_nr, nr, events, timeout);
}


x86 assembly (clang, -O0):
<__io_getevents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__io_getevents>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.io_event = type { i32 }
%struct.timespec = type { i32 }
@__NR_io_getevents = global i32 0
define i32 @__io_getevents(i32 %0, i64 %1, i64 %2, %struct.io_event* %3, %struct.timespec* %4) {
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca %struct.io_event*
%10 = alloca %struct.timespec*
store i32 %0, i32* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store %struct.io_event* %3, %struct.io_event** %9
store %struct.timespec* %4, %struct.timespec** %10
%11 = load i32, i32* @__NR_io_getevents
%12 = load i32, i32* %6
%13 = load i64, i64* %7
%14 = load i64, i64* %8
%15 = load %struct.io_event*, %struct.io_event** %9
%16 = load %struct.timespec*, %struct.timespec** %10
%17 = call i32 @syscall(i32 %11, i32 %12, i64 %13, i64 %14, %struct.io_event* %15, %struct.timespec* %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.io_event = type { i32 }
%struct.timespec = type { i32 }
@__NR_io_getevents = global i32 0
define i32 @__io_getevents(i32 %0, i64 %1, i64 %2, %struct.io_event* %3, %struct.timespec* %4) {
%6 = load i32, i32* @__NR_io_getevents
%7 = tail call i32 @syscall(i32 %6, i32 %0, i64 %1, i64 %2, %struct.io_event* %3, %struct.timespec* %4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void tgi_clear(void) {
  printf("\033[0;0H\033[J");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<tgi_clear>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgi_clear>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\1B[0;0H\1B[J\00"
@stdout = global i32 0
define void @tgi_clear() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"\1B[0;0H\1B[J\00"
@stdout = global i32 0
define void @tgi_clear() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
float *mat2_assign_mat3(float *result, float *m) {
  result[0] = m[0];
  result[1] = m[1];
  result[2] = m[3];
  result[3] = m[4];
  return result;
}


x86 assembly (clang, -O0):
<mat2_assign_mat3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movss  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat2_assign_mat3>:
mov    %rdi,%rax
movss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0xc(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
movss  0x10(%rsi),%xmm0
movss  %xmm0,0xc(%rdi)
ret

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

LLVM IR (-O2):
define float* @mat2_assign_mat3(float* returned writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
store float %3, float* %0
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %0, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %1, i64 3
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %0, i64 2
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 4
%11 = load float, float* %10
%12 = getelementptr inbounds float, float* %0, i64 3
store float %11, float* %12
ret float* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ stdin;
int vfscanf(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int vscanf(const char *format, va_list ap) {
  return vfscanf(stdin, format, ap);
}


x86 assembly (clang, -O0):
<vscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vfscanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vscanf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfscanf@plt>

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

LLVM IR (-O2):
@stdin = global i32 0
define i32 @vscanf(i8* %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @vfscanf(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void terminate_sequence() { putchar('\n'); }


x86 assembly (clang, -O0):
<terminate_sequence>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminate_sequence>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @terminate_sequence() {
%1 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @terminate_sequence() {
%1 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *tmpnam(char *);
int main() {
  char *name = tmpnam("a.txt");
  printf("%s\n", name);
  printf("%d\n", name == NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <tmpnam@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
movslq %eax,%rsi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <tmpnam@plt>
mov    %rax,%rbx
lea    0xecf(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %esi,%esi
test   %rbx,%rbx
sete   %sil
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"a.txt\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @tmpnam(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = icmp eq i8* %6, null
%8 = zext i1 %7 to i32
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"a.txt\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i8* @tmpnam(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%3 = icmp eq i8* %1, null
%4 = zext i1 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret i32 0
}
int rtl838x_dma_if_rx_ring_cntr(int i) { return (0xB7E8) + ((i >> 3) << 2); }


x86 assembly (clang, -O0):
<rtl838x_dma_if_rx_ring_cntr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
shl    $0x2,%eax
add    $0xb7e8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtl838x_dma_if_rx_ring_cntr>:
sar    %edi
lea    0xb7e8(%rdi),%eax
and    $0xfffffffc,%eax
ret

LLVM IR (-O0):
define i32 @rtl838x_dma_if_rx_ring_cntr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 3
%5 = shl i32 %4, 2
%6 = add nsw i32 47080, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @rtl838x_dma_if_rx_ring_cntr(i32 %0) {
%2 = ashr i32 %0, 1
%3 = add nsw i32 %2, 47080
%4 = and i32 %3, -4
ret i32 %4
}
int bytesToInt(char *bytes) {
  int *aPointInt;
  aPointInt = (int *)bytes;
  return *aPointInt;
}


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

x86 assembly (clang, -O2):
<bytesToInt>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @bytesToInt(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @bytesToInt(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("which number?  ");
  scanf("%d", &n);
  printf("fib(%d) = %d\n", n, fib(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <fib@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1050 <fib@plt>
lea    0xead(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"which number? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"fib(%d) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @fib(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"which number? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"fib(%d) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fib(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int ncc_three_parm_optimization();
int noncoplanar_calibration() { return ncc_three_parm_optimization(); }


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

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

LLVM IR (-O0):
define i32 @noncoplanar_calibration() {
%1 = call i32 (...) @ncc_three_parm_optimization()
ret i32 %1
}

LLVM IR (-O2):
define i32 @noncoplanar_calibration() {
%1 = tail call i32 (...) @ncc_three_parm_optimization()
ret i32 %1
}
long power(int i, int j) {
  int n = 1;
  long factor = 1;
  while (n <= j) {
    factor = factor * i;
    n++;
  }
  return factor;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movq   $0x1,-0x18(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1143 <power+0x43>
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <power+0x19>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %esi,%esi
jle    111b <power+0x1b>
movslq %edi,%rcx
lea    -0x1(%rsi),%eax
mov    %esi,%edx
and    $0x7,%edx
cmp    $0x7,%eax
jae    1121 <power+0x21>
mov    $0x1,%eax
jmp    1155 <power+0x55>
mov    $0x1,%eax
ret
and    $0xfffffff8,%esi
mov    $0x1,%eax
nopl   0x0(%rax)
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
add    $0xfffffff8,%esi
jne    1130 <power+0x30>
test   %edx,%edx
je     1169 <power+0x69>
nopl   0x0(%rax)
imul   %rcx,%rax
add    $0xffffffff,%edx
jne    1160 <power+0x60>
ret

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

LLVM IR (-O2):
define i64 @power(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %34, label %4
4: ; preds = %2
%5 = sext i32 %0 to i64
%6 = add i32 %1, -1
%7 = and i32 %1, 7
%8 = icmp ult i32 %6, 7
br i1 %8, label %24, label %9
9: ; preds = %4
%10 = and i32 %1, -8
br label %11
11: ; preds = %11, %9
%12 = phi i64 [ 1, %9 ], [ %21, %11 ]
%13 = phi i32 [ 0, %9 ], [ %22, %11 ]
%14 = mul nsw i64 %12, %5
%15 = mul nsw i64 %14, %5
%16 = mul nsw i64 %15, %5
%17 = mul nsw i64 %16, %5
%18 = mul nsw i64 %17, %5
%19 = mul nsw i64 %18, %5
%20 = mul nsw i64 %19, %5
%21 = mul nsw i64 %20, %5
%22 = add i32 %13, 8
%23 = icmp eq i32 %22, %10
br i1 %23, label %24, label %11
24: ; preds = %11, %4
%25 = phi i64 [ undef, %4 ], [ %21, %11 ]
%26 = phi i64 [ 1, %4 ], [ %21, %11 ]
%27 = icmp eq i32 %7, 0
br i1 %27, label %34, label %28
28: ; preds = %24, %28
%29 = phi i64 [ %31, %28 ], [ %26, %24 ]
%30 = phi i32 [ %32, %28 ], [ 0, %24 ]
%31 = mul nsw i64 %29, %5
%32 = add i32 %30, 1
%33 = icmp eq i32 %32, %7
br i1 %33, label %34, label %28
34: ; preds = %24, %28, %2
%35 = phi i64 [ 1, %2 ], [ %25, %24 ], [ %31, %28 ]
ret i64 %35
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int args, char *argv[]) {
  printf("Hello World!\n");
  return 0;
}


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)
lea    0xed3(%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 = [14 x i8] c"Hello World!\0A\00"
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 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int reverse_digits(int n) {
  int rev = 0;
  while (n > 0) {
    rev = rev * 10 + n % 10;
    n = n / 10;
  }
  return rev;
}


x86 assembly (clang, -O0):
<reverse_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1145 <reverse_digits+0x45>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <reverse_digits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_digits>:
xor    %eax,%eax
test   %edi,%edi
jle    1131 <reverse_digits+0x31>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
lea    (%rcx,%rax,2),%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <reverse_digits+0x10>
ret

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

LLVM IR (-O2):
define i32 @reverse_digits(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = urem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = udiv i32 %5, 10
%10 = icmp ult i32 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
/* Type definitions */
struct boolean_vector {
  int dummy;
};

/* Variables and functions */
int _setstate(struct boolean_vector *, int, int);
bool _clear(struct boolean_vector *pi, int vnum) {
  return _setstate(pi, vnum, false);
}


x86 assembly (clang, -O0):
<_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <_setstate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_clear>:
xor    %edx,%edx
jmp    1030 <_setstate@plt>

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

LLVM IR (-O2):
%struct.boolean_vector = type { i32 }
define i32 @_clear(%struct.boolean_vector* %0, i32 %1) {
%3 = tail call i32 @_setstate(%struct.boolean_vector* %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ initialize();
int /*<<< orphan*/ report_and_exit();
int /*<<< orphan*/ test_if();
int main() {
  initialize();
  test_if();
  report_and_exit();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <initialize@plt>
mov    $0x0,%al
call   1050 <test_if@plt>
mov    $0x0,%al
call   1030 <report_and_exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <initialize@plt>
xor    %eax,%eax
call   1050 <test_if@plt>
xor    %eax,%eax
call   1030 <report_and_exit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initialize()
%3 = call i32 (...) @test_if()
%4 = call i32 (...) @report_and_exit()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initialize()
%2 = tail call i32 (...) @test_if()
%3 = tail call i32 (...) @report_and_exit()
ret i32 0
}