xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, char *, unsigned long, unsigned long);
scalar_t__ pthread_self();
void print_id(char *prefix) {
  printf("%s pid = %lu, tid = %lu\n", prefix, (unsigned long int)getpid(),
         (unsigned long int)pthread_self());
}


x86 assembly (clang, -O0):
<print_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_id>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xeb1(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"%s pid = %lu, tid = %lu\0A\00"
define void @print_id(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 (...) @getpid()
%5 = call i64 (...) @pthread_self()
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3, i64 %4, i64 %5)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"%s pid = %lu, tid = %lu\0A\00"
define void @print_id(i8* %0) {
%2 = tail call i64 (...) @getpid()
%3 = tail call i64 (...) @pthread_self()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %2, i64 %3)
ret void
}
void func(int *i) { *i = 0; }


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

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

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

LLVM IR (-O2):
define void @func(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret void
}
int get_parent(i) { return (i - 1) / 2; }


x86 assembly (clang, -O0):
<get_parent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_parent>:
mov    %edi,%eax
add    $0xffffffff,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0xffffffff,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @get_parent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = sdiv i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_parent(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = sdiv i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(char *, char *, int);
int sto_key_empty(char key[16]) {
  char empty[16] = {0};
  return !memcmp(key, empty, 16);
}


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

x86 assembly (clang, -O2):
<sto_key_empty>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x10,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @sto_key_empty(i8* %0) {
%2 = alloca i8*
%3 = alloca [16 x i8]
store i8* %0, i8** %2
%4 = bitcast [16 x i8]* %3 to i8*
%5 = load i8*, i8** %2
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%7 = call i32 @memcmp(i8* %5, i8* %6, i32 16)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @sto_key_empty(i8* %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @memcmp(i8* %0, i8* %3, i32 16)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
char *pv_dup(char *p, char *ep) {
  int n = ep - p;
  char *rv = (char *)malloc(n + 1);
  memcpy(rv, p, n);
  rv[n] = 0;
  return rv;
}


x86 assembly (clang, -O0):
<pv_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pv_dup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
sub    %rdi,%rbx
lea    0x1(%rbx),%edi
call   1040 <malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
movslq %ebx,%rax
movb   $0x0,(%r15,%rax,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @pv_dup(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = load i8*, i8** %3
%9 = ptrtoint i8* %7 to i64
%10 = ptrtoint i8* %8 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
%15 = call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %6
%17 = load i8*, i8** %6
%18 = load i8*, i8** %3
%19 = load i32, i32* %5
%20 = call i32 @memcpy(i8* %17, i8* %18, i32 %19)
%21 = load i8*, i8** %6
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 0, i8* %24
%25 = load i8*, i8** %6
ret i8* %25
}

LLVM IR (-O2):
define i8* @pv_dup(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = add nsw i32 %6, 1
%8 = tail call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
%10 = tail call i32 @memcpy(i8* %9, i8* %0, i32 %6)
%11 = shl i64 %5, 32
%12 = ashr exact i64 %11, 32
%13 = getelementptr inbounds i8, i8* %9, i64 %12
store i8 0, i8* %13
ret i8* %9
}
/* Type definitions */
struct sgttyb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int stty(int fd, const struct sgttyb *params) {
  if (params == NULL) {
    __set_errno(EINVAL);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<stty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <stty+0x34>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <stty+0x49>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stty>:
push   %rax
test   %rsi,%rsi
jne    111f <stty+0xf>
mov    0x2ebb(%rip),%rax
jmp    1126 <stty+0x16>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sgttyb = type { i32 }
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @stty(i32 %0, %struct.sgttyb* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sgttyb*
store i32 %0, i32* %4
store %struct.sgttyb* %1, %struct.sgttyb** %5
%6 = load %struct.sgttyb*, %struct.sgttyb** %5
%7 = icmp eq %struct.sgttyb* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @EINVAL
%10 = call i32 @__set_errno(i32 %9)
store i32 -1, i32* %3
br label %14
11: ; preds = %2
%12 = load i32, i32* @ENOSYS
%13 = call i32 @__set_errno(i32 %12)
store i32 -1, i32* %3
br label %14
14: ; preds = %11, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.sgttyb = type { i32 }
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @stty(i32 %0, %struct.sgttyb* readnone %1) {
%3 = icmp eq %struct.sgttyb* %1, null
%4 = load i32, i32* @EINVAL
%5 = load i32, i32* @ENOSYS
%6 = select i1 %3, i32 %4, i32 %5
%7 = tail call i32 @__set_errno(i32 %6)
ret i32 -1
}
/* Variables and functions */
int plugFindUsage(char *, int, int);
int plugFindDayUsage(char *mac, int now) {
  return (plugFindUsage(mac, now, 24 * 60));
}


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

x86 assembly (clang, -O2):
<plugFindDayUsage>:
mov    $0x5a0,%edx
jmp    1030 <plugFindUsage@plt>

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

LLVM IR (-O2):
define i32 @plugFindDayUsage(i8* %0, i32 %1) {
%3 = tail call i32 @plugFindUsage(i8* %0, i32 %1, i32 1440)
ret i32 %3
}
const char *hxd_help(struct hexdump *X) {
  (void)X;
  return "helps";
}


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

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

LLVM IR (-O0):
%struct.hexdump = type opaque
@.str = [6 x i8] c"helps\00"
define i8* @hxd_help(%struct.hexdump* %0) {
%2 = alloca %struct.hexdump*
store %struct.hexdump* %0, %struct.hexdump** %2
%3 = load %struct.hexdump*, %struct.hexdump** %2
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.hexdump = type opaque
@.str = [6 x i8] c"helps\00"
define i8* @hxd_help(%struct.hexdump* nocapture readnone %0) {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct termios {
  int /*<<< orphan*/ c_ospeed;
};
typedef int /*<<< orphan*/ speed_t;

/* Variables and functions */
speed_t cfgetospeed(const struct termios *termios_p) {
  return termios_p->c_ospeed;
}


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

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

LLVM IR (-O0):
%struct.termios = type { i32 }
define i32 @cfgetospeed(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load %struct.termios*, %struct.termios** %2
%4 = getelementptr inbounds %struct.termios, %struct.termios* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @cfgetospeed(%struct.termios* nocapture %0) {
%2 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
int JsVersion() { return 1; }


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

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

LLVM IR (-O0):
define i32 @JsVersion() {
ret i32 1
}

LLVM IR (-O2):
define i32 @JsVersion() {
ret i32 1
}
void hs01(double *p, double *x, int m, int n, void *data) {
  double t;
  t = p[0] * p[0];
  x[0] = 10.0 * (p[1] - t);
  x[1] = 1.0 - p[0];
}


x86 assembly (clang, -O0):
<hs01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
subsd  -0x28(%rbp),%xmm1
movsd  0xec7(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0xea7(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<hs01>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  %xmm0,%xmm0
subsd  %xmm0,%xmm1
mulsd  0xee7(%rip),%xmm1
movsd  %xmm1,(%rsi)
movsd  0xee3(%rip),%xmm0
subsd  (%rdi),%xmm0
movsd  %xmm0,0x8(%rsi)
ret

LLVM IR (-O0):
define void @hs01(double* %0, double* %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca double
store double* %0, double** %6
store double* %1, double** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%12 = load double*, double** %6
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = load double*, double** %6
%16 = getelementptr inbounds double, double* %15, i64 0
%17 = load double, double* %16
%18 = fmul double %14, %17
store double %18, double* %11
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = load double, double* %11
%23 = fsub double %21, %22
%24 = fmul double 1.000000e+01, %23
%25 = load double*, double** %7
%26 = getelementptr inbounds double, double* %25, i64 0
store double %24, double* %26
%27 = load double*, double** %6
%28 = getelementptr inbounds double, double* %27, i64 0
%29 = load double, double* %28
%30 = fsub double 1.000000e+00, %29
%31 = load double*, double** %7
%32 = getelementptr inbounds double, double* %31, i64 1
store double %30, double* %32
ret void
}

LLVM IR (-O2):
define void @hs01(double* nocapture %0, double* nocapture writeonly %1, i32 %2, i32 %3, i8* nocapture readnone %4) {
%6 = load double, double* %0
%7 = fmul double %6, %6
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = fsub double %9, %7
%11 = fmul double %10, 1.000000e+01
store double %11, double* %1
%12 = load double, double* %0
%13 = fsub double 1.000000e+00, %12
%14 = getelementptr inbounds double, double* %1, i64 1
store double %13, double* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void setFgColour(int code) {
  printf("\033[22;%dm", (code % 8) + 30);
  if ((code % 16) >= 8)
    printf("\033[1m");
}


x86 assembly (clang, -O0):
<setFgColour>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x8,%edx
jl     115b <setFgColour+0x4b>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setFgColour>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x7(%rbx),%eax
lea    0xf(%rbx),%ebp
test   %edi,%edi
cmovns %edi,%eax
cmovns %edi,%ebp
and    $0xfffffff8,%eax
neg    %eax
lea    (%rbx,%rax,1),%esi
add    $0x1e,%esi
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
and    $0xfffffff0,%ebp
sub    %ebp,%ebx
cmp    $0x8,%ebx
jl     115a <setFgColour+0x4a>
lea    0xebc(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[22;%dm\00"
@.str.1 = [5 x i8] c"\1B[1m\00"
define void @setFgColour(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 8
%5 = add nsw i32 %4, 30
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = srem i32 %7, 16
%9 = icmp sge i32 %8, 8
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[22;%dm\00"
@.str.1 = [5 x i8] c"\1B[1m\00"
define void @setFgColour(i32 %0) {
%2 = srem i32 %0, 8
%3 = add nsw i32 %2, 30
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = srem i32 %0, 16
%6 = icmp sgt i32 %5, 7
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}
int func1(int a, int b) { return b ? a : a / b; }


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111f <func1+0x1f>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <func1+0x29>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @func1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32, i32* %3
br label %13
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sdiv i32 %10, %11
br label %13
13: ; preds = %9, %7
%14 = phi i32 [ %8, %7 ], [ %12, %9 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @func1(i32 returned %0, i32 %1) {
ret i32 %0
}
int computed_goto(int x) {
start:
  x = x << 1;
  void *location = &&start;
  if (x > 17)
    location = &&done;
  while (x > 12) {
    --x;
    if (x == 15)
      goto *location;
  }
done:
  return 5;
}


x86 assembly (clang, -O0):
<computed_goto>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    %eax,%eax
mov    %eax,-0x4(%rbp)
lea    -0xf(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x11,-0x4(%rbp)
jle    112f <computed_goto+0x2f>
lea    0x3d(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <computed_goto+0x34>
cmpl   $0xc,-0x4(%rbp)
jle    1163 <computed_goto+0x63>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xf,-0x4(%rbp)
jne    115e <computed_goto+0x5e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    116f <computed_goto+0x6f>
jmp    1134 <computed_goto+0x34>
jmp    1168 <computed_goto+0x68>
mov    $0x5,%eax
pop    %rbp
ret
mov    -0x18(%rbp),%rax
jmp    *%rax

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

LLVM IR (-O0):
define i32 @computed_goto(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
br label %4
4: ; preds = %24, %1
%5 = load i32, i32* %2
%6 = shl i32 %5, 1
store i32 %6, i32* %2
store i8* blockaddress(@computed_goto, %4), i8** %3
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 17
br i1 %8, label %9, label %10
9: ; preds = %4
store i8* blockaddress(@computed_goto, %23), i8** %3
br label %10
10: ; preds = %9, %4
br label %11
11: ; preds = %21, %10
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 12
br i1 %13, label %14, label %22
14: ; preds = %11
%15 = load i32, i32* %2
%16 = add nsw i32 %15, -1
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 15
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = load i8*, i8** %3
br label %24
21: ; preds = %14
br label %11
22: ; preds = %11
br label %23
23: ; preds = %22, %24
ret i32 5
24: ; preds = %19
%25 = phi i8* [ %20, %19 ]
indirectbr i8* %25, [label %4, label %23]
}

LLVM IR (-O2):
define i32 @computed_goto(i32 %0) {
%2 = shl i32 %0, 1
%3 = icmp sgt i32 %2, 17
%4 = call i32 @llvm.smin.i32(i32 %2, i32 12)
%5 = sub i32 %2, %4
%6 = add i32 %2, -16
%7 = icmp ule i32 %5, %6
%8 = or i1 %7, %3
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ cpuid(int, unsigned int *, unsigned int *, unsigned int *,
                         unsigned int *);
int have_clmul(void) {
  unsigned eax, ebx, ecx, edx;
  int has_pclmulqdq;
  int has_sse41;
  cpuid(1, &eax, &ebx, &ecx, &edx);
  has_pclmulqdq = ecx & 0x2;
  has_sse41 = ecx & 0x80000;
  return has_pclmulqdq && has_sse41;
}


x86 assembly (clang, -O0):
<have_clmul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x1,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0xc(%rbp),%eax
and    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
and    $0x80000,%eax
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x19(%rbp)
je     115f <have_clmul+0x4f>
cmpl   $0x0,-0x18(%rbp)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<have_clmul>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x1,%edi
call   1030 <cpuid@plt>
mov    0x8(%rsp),%ecx
not    %ecx
xor    %eax,%eax
test   $0x80002,%ecx
sete   %al
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @have_clmul() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = call i32 @cpuid(i32 1, i32* %1, i32* %2, i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = and i32 %8, 2
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = and i32 %10, 524288
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %0
%15 = load i32, i32* %6
%16 = icmp ne i32 %15, 0
br label %17
17: ; preds = %14, %0
%18 = phi i1 [ false, %0 ], [ %16, %14 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @have_clmul() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @cpuid(i32 1, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %3
%11 = and i32 %10, 524290
%12 = icmp eq i32 %11, 524290
%13 = zext i1 %12 to i32
ret i32 %13
}
unsigned int vadd2(unsigned int a, unsigned int b) {
  unsigned int s, t;
  s = a ^ b;
  t = a + b;
  s = s ^ t;
  s = s & 0x00010000;
  t = t - s;
  return t;
}


x86 assembly (clang, -O0):
<vadd2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x10000,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vadd2>:
lea    (%rsi,%rdi,1),%eax
mov    %esi,%ecx
xor    %edi,%ecx
xor    %eax,%ecx
and    $0x10000,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @vadd2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = xor i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = add i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = xor i32 %13, %14
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = and i32 %16, 65536
store i32 %17, i32* %5
%18 = load i32, i32* %6
%19 = load i32, i32* %5
%20 = sub i32 %18, %19
store i32 %20, i32* %6
%21 = load i32, i32* %6
ret i32 %21
}

LLVM IR (-O2):
define i32 @vadd2(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = add i32 %1, %0
%5 = xor i32 %3, %4
%6 = and i32 %5, 65536
%7 = sub i32 %4, %6
ret i32 %7
}
unsigned setbits(unsigned x, int p, int n, unsigned y) {
  return x & ~(~(~0 << n) << (p + 1 - n)) | (y & (~(~0 << n)) << (p + 1 - n));
}


x86 assembly (clang, -O0):
<setbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    -0x14(%rbp),%ecx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbits>:
mov    %ecx,%eax
mov    %edx,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
not    %edx
sub    %ecx,%esi
lea    0x1(%rsi),%ecx
shl    %cl,%edx
xor    %edi,%eax
and    %edx,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = shl i32 -1, %10
%12 = xor i32 %11, -1
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
%15 = load i32, i32* %7
%16 = sub nsw i32 %14, %15
%17 = shl i32 %12, %16
%18 = xor i32 %17, -1
%19 = and i32 %9, %18
%20 = load i32, i32* %8
%21 = load i32, i32* %7
%22 = shl i32 -1, %21
%23 = xor i32 %22, -1
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
%26 = load i32, i32* %7
%27 = sub nsw i32 %25, %26
%28 = shl i32 %23, %27
%29 = and i32 %20, %28
%30 = or i32 %19, %29
ret i32 %30
}

LLVM IR (-O2):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 -1, %2
%6 = xor i32 %5, -1
%7 = add nsw i32 %1, 1
%8 = sub i32 %7, %2
%9 = shl i32 %6, %8
%10 = xor i32 %9, -1
%11 = and i32 %10, %0
%12 = and i32 %9, %3
%13 = or i32 %11, %12
ret i32 %13
}
void finishup() {}


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

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

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

LLVM IR (-O2):
define void @finishup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char t = 'T';
  char p = 'P';
  char n = 'N';
  printf("\n");
  printf("%c, %c, %c\n", t, p, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x54,-0x5(%rbp)
movb   $0x50,-0x6(%rbp)
movb   $0x4e,-0x7(%rbp)
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x5(%rbp),%esi
movsbl -0x6(%rbp),%edx
movsbl -0x7(%rbp),%ecx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rdi
mov    $0x54,%esi
mov    $0x50,%edx
mov    $0x4e,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [12 x i8] c"%c, %c, %c\0A\00"
define i32 @main() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 84, i32 80, i32 78)
ret i32 0
}
unsigned long long sum_of_squares_efficient(int limit) {
  return (unsigned long long)(limit * (limit + 1) * (2 * limit + 1)) / 6;
}


x86 assembly (clang, -O0):
<sum_of_squares_efficient>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
imul   %ecx,%eax
cltq
mov    $0x6,%ecx
xor    %edx,%edx
div    %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_of_squares_efficient>:
lea    0x1(%rdi),%eax
imul   %edi,%eax
lea    (%rdi,%rdi,1),%ecx
add    $0x1,%ecx
imul   %eax,%ecx
movslq %ecx,%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
mov    %rdx,%rax
shr    $0x2,%rax
ret

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

LLVM IR (-O2):
define i64 @sum_of_squares_efficient(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = mul nsw i32 %2, %0
%4 = shl nsw i32 %0, 1
%5 = or i32 %4, 1
%6 = mul nsw i32 %3, %5
%7 = sext i32 %6 to i64
%8 = udiv i64 %7, 6
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char const *);
void pyi_path_archivefile(char *archivefile, const char *thisfile) {
  strcpy(archivefile, thisfile);
  strcat(archivefile, ".pkg");
}


x86 assembly (clang, -O0):
<pyi_path_archivefile>:
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 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pyi_path_archivefile>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strcpy@plt>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [5 x i8] c".pkg\00"
define void @pyi_path_archivefile(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 @strcpy(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c".pkg\00"
define void @pyi_path_archivefile(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* %1)
%4 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int main_pview(int, char **);
int main(int c, char **v) { return main_pview(c, v); }


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 <main_pview@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <main_pview@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 @main_pview(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @main_pview(i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
typedef int uint64_t;
struct pcg_state_64 {
  int dummy;
};

/* Variables and functions */
int pcg_oneseq_64_rxs_m_xs_64_random_r(struct pcg_state_64 *);
uint64_t pcg_oneseq_64_rxs_m_xs_64_boundedrand_r(struct pcg_state_64 *rng,
                                                 uint64_t bound) {
  uint64_t threshold = -bound % bound;
  for (;;) {
    uint64_t r = pcg_oneseq_64_rxs_m_xs_64_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_oneseq_64_rxs_m_xs_64_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_oneseq_64_rxs_m_xs_64_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_oneseq_64_rxs_m_xs_64_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_oneseq_64_rxs_m_xs_64_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_oneseq_64_rxs_m_xs_64_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_oneseq_64_rxs_m_xs_64_random_r@plt>
test   %eax,%eax
js     1120 <pcg_oneseq_64_rxs_m_xs_64_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pcg_state_64 = type { i32 }
define i32 @pcg_oneseq_64_rxs_m_xs_64_boundedrand_r(%struct.pcg_state_64* %0, i32 %1) {
%3 = alloca %struct.pcg_state_64*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.pcg_state_64* %0, %struct.pcg_state_64** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load %struct.pcg_state_64*, %struct.pcg_state_64** %3
%13 = call i32 @pcg_oneseq_64_rxs_m_xs_64_random_r(%struct.pcg_state_64* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
ret i32 %20
21: ; preds = %11
br label %11
}

LLVM IR (-O2):
%struct.pcg_state_64 = type { i32 }
define i32 @pcg_oneseq_64_rxs_m_xs_64_boundedrand_r(%struct.pcg_state_64* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_oneseq_64_rxs_m_xs_64_random_r(%struct.pcg_state_64* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XFocusInEvent;

/* Variables and functions */
void set_XFocusInEvent_type(void *_p, int _v) {
  ((XFocusInEvent *)_p)->type = (int)_v;
}


x86 assembly (clang, -O0):
<set_XFocusInEvent_type>:
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_XFocusInEvent_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XFocusInEvent_type(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_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XFocusInEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;
typedef int ssize_t;

/* Variables and functions */
int sendto(int, int /*<<< orphan*/ *, size_t, int /*<<< orphan*/,
           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ settimer(int);
ssize_t timerd_write(int s, u_char *buf, size_t len, int sec) {
  ssize_t r = -1;
  settimer(sec);
  r = sendto(s, buf, len, 0, 0, 0);
  settimer(0);
  return (r);
}


x86 assembly (clang, -O0):
<timerd_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0xffffffff,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <settimer@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <sendto@plt>
mov    %eax,-0x20(%rbp)
xor    %edi,%edi
call   1040 <settimer@plt>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timerd_write>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %ecx,%edi
call   1040 <settimer@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <sendto@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1040 <settimer@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @timerd_write(i32 %0, i32* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
store i32 -1, i32* %9
%10 = load i32, i32* %8
%11 = call i32 @settimer(i32 %10)
%12 = load i32, i32* %5
%13 = load i32*, i32** %6
%14 = load i64, i64* %7
%15 = call i32 @sendto(i32 %12, i32* %13, i64 %14, i32 0, i32 0, i32 0)
store i32 %15, i32* %9
%16 = call i32 @settimer(i32 0)
%17 = load i32, i32* %9
ret i32 %17
}

LLVM IR (-O2):
define i32 @timerd_write(i32 %0, i32* %1, i64 %2, i32 %3) {
%5 = tail call i32 @settimer(i32 %3)
%6 = tail call i32 @sendto(i32 %0, i32* %1, i64 %2, i32 0, i32 0, i32 0)
%7 = tail call i32 @settimer(i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void fatal(char *s) {
  printf("Fatal error: %s\n", s);
  exit(9);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x9,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x9,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Fatal error: %s\0A\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 9)
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"Fatal error: %s\0A\00"
define void @fatal(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 9)
unreachable
}
void ARGBCopyYToAlphaRow_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBCopyYToAlphaRow_AVX2() {
ret void
}
void __DELETE_org_apache_harmony_luni_util_FloatingPointParser(
    void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_org_apache_harmony_luni_util_FloatingPointParser(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int fun855() { return 855; }


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

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

LLVM IR (-O0):
define i32 @fun855() {
ret i32 855
}

LLVM IR (-O2):
define i32 @fun855() {
ret i32 855
}
/* Variables and functions */
int /*<<< orphan*/ send(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int strlen(char *);
void sendtext(int sd, char *text) {
  char buffer[8096];
  sprintf(buffer, "\x02%s", text);
  send(sd, buffer, strlen(buffer), 0);
  send(sd, "\x00", 1, 0);
}


x86 assembly (clang, -O0):
<sendtext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1fc0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1fb0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeac(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1fbc(%rbp)
lea    -0x1fb0(%rbp),%rax
mov    %rax,-0x1fb8(%rbp)
lea    -0x1fb0(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1fbc(%rbp),%edi
mov    -0x1fb8(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    -0x4(%rbp),%edi
lea    0xe68(%rip),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x1fc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendtext>:
push   %r14
push   %rbx
sub    $0x1fa8,%rsp
mov    %rsi,%rdx
mov    %edi,%ebx
lea    0xeba(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
lea    0xe96(%rip),%rsi
mov    %ebx,%edi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x1fa8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\02%s\00"
@.str.1 = [2 x i8] zeroinitializer
define void @sendtext(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [8096 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [8096 x i8], [8096 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* %3
%10 = getelementptr inbounds [8096 x i8], [8096 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [8096 x i8], [8096 x i8]* %5, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @send(i32 %9, i8* %10, i32 %12, i32 0)
%14 = load i32, i32* %3
%15 = call i32 @send(i32 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\02%s\00"
@.str.1 = [2 x i8] zeroinitializer
define void @sendtext(i32 %0, i8* %1) {
%3 = alloca [8096 x i8]
%4 = getelementptr inbounds [8096 x i8], [8096 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = call i32 @strlen(i8* %4)
%7 = call i32 @send(i32 %0, i8* %4, i32 %6, i32 0)
%8 = call i32 @send(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pA(char *);
void pop_stack_dummy(void) { pA("stack_head--;"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"stack_head--;\00"
define void @pop_stack_dummy() {
%1 = call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"stack_head--;\00"
define void @pop_stack_dummy() {
%1 = tail call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void erro(char *strerr) {
  fprintf(stderr, "erro: %s\n", strerr);
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"erro: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @erro(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"erro: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @erro(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int clock(int h, int m, int s) { return s + 60 * m + 3600 * h; }


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

x86 assembly (clang, -O2):
<clock>:
imul   $0x3c,%esi,%ecx
imul   $0xe10,%edi,%eax
add    %edx,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @clock(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, 60
%5 = mul nsw i32 %0, 3600
%6 = add i32 %5, %2
%7 = add i32 %6, %4
ret i32 %7
}
int cdrom_volume_close(struct fs_volume *v) { return 0; }


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

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

LLVM IR (-O0):
%struct.fs_volume = type opaque
define i32 @cdrom_volume_close(%struct.fs_volume* %0) {
%2 = alloca %struct.fs_volume*
store %struct.fs_volume* %0, %struct.fs_volume** %2
ret i32 0
}

LLVM IR (-O2):
%struct.fs_volume = type opaque
define i32 @cdrom_volume_close(%struct.fs_volume* nocapture readnone %0) {
ret i32 0
}
void return0() { return; }


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

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

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

LLVM IR (-O2):
define void @return0() {
ret void
}
void delay() {
  int time;
  for (time = 0; time < 100000; time++)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x186a0,-0x4(%rbp)
jge    112b <delay+0x2b>
jmp    111d <delay+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <delay+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __CrestInit();
void __globinit_prime(void) {
  { __CrestInit(); }
}


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

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

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

LLVM IR (-O2):
define void @__globinit_prime() {
%1 = tail call i32 (...) @__CrestInit()
ret void
}