xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int config_setvalue_byname(FILE *fp, char *name, char *value) { return 0; }


x86 assembly (clang, -O0):
<config_setvalue_byname>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @config_setvalue_byname(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @config_setvalue_byname(i32* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
struct timespec {
  int tv_sec;
  double tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t get_timestamp_ms(void) {
  struct timespec ts;
  uint64_t ms;
  clock_gettime(0, &ts);
  ms = ts.tv_sec * 1000 + ts.tv_nsec / 1.0e6;
  return ms;
}


x86 assembly (clang, -O0):
<get_timestamp_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %edi,%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,-0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xec5(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_timestamp_ms>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
xor    %edi,%edi
call   1030 <clock_gettime@plt>
imul   $0x3e8,0x8(%rsp),%eax
cvtsi2sd %eax,%xmm0
movsd  0x10(%rsp),%xmm1
divsd  0xec6(%rip),%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, double }
define i32 @get_timestamp_ms() {
%1 = alloca %struct.timespec
%2 = alloca i32
%3 = call i32 @clock_gettime(i32 0, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%9 = load double, double* %8
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %7, %10
%12 = fptosi double %11 to i32
store i32 %12, i32* %2
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.timespec = type { i32, double }
define i32 @get_timestamp_ms() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = call i32 @clock_gettime(i32 0, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load double, double* %8
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %7
%12 = fptosi double %11 to i32
ret i32 %12
}
void RTTimeDbgExpired(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTimeDbgExpired() {
ret void
}
void g_timer_start() {}


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

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

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

LLVM IR (-O2):
define void @g_timer_start() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x22() {
  Assert_real((iscntrl(34) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              175, ("iscntrl should be 0 for 0x22"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x22>:
push   %rbp
mov    %rsp,%rbp
mov    $0x22,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0xaf,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x22>:
push   %rax
mov    $0x22,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xaf,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x22\00"
define void @t_iscntrl_0x22() {
%1 = call i64 @iscntrl(i32 34)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 175, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x22\00"
define void @t_iscntrl_0x22() {
%1 = tail call i64 @iscntrl(i32 34)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 175, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
float sin_approx(float);
float cos_approx(float x) {
  return sin_approx(x + (0.5f * 3.14159265358979323846f));
}


x86 assembly (clang, -O0):
<cos_approx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
call   1030 <sin_approx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos_approx>:
addss  0xee8(%rip),%xmm0
jmp    1030 <sin_approx@plt>

LLVM IR (-O0):
define float @cos_approx(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fadd float %3, 0x3FF921FB60000000
%5 = call float @sin_approx(float %4)
ret float %5
}

LLVM IR (-O2):
define float @cos_approx(float %0) {
%2 = fadd float %0, 0x3FF921FB60000000
%3 = tail call float @sin_approx(float %2)
ret float %3
}
/* Variables and functions */
size_t ssize(const char *str) {
  size_t size = 0;
  while ('\0' != str[size])
    ++size;
  return size;
}


x86 assembly (clang, -O0):
<ssize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1137 <ssize+0x37>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ssize+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssize>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <ssize+0x10>
ret

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

LLVM IR (-O2):
define i64 @ssize(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
void glNormalPointer(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glNormalPointer() {
ret void
}
/* Variables and functions */
int PAPI_flips(float *, float *, long long *, float *);
void papif_flips_(float *real_time, float *proc_time, long long *flpins,
                  float *mflips, int *check) {
  *check = PAPI_flips(real_time, proc_time, flpins, mflips);
}


x86 assembly (clang, -O0):
<papif_flips_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <PAPI_flips@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_flips_>:
push   %rbx
mov    %r8,%rbx
call   1030 <PAPI_flips@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_flips_(float* %0, float* %1, i64* %2, float* %3, i32* %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca i64*
%9 = alloca float*
%10 = alloca i32*
store float* %0, float** %6
store float* %1, float** %7
store i64* %2, i64** %8
store float* %3, float** %9
store i32* %4, i32** %10
%11 = load float*, float** %6
%12 = load float*, float** %7
%13 = load i64*, i64** %8
%14 = load float*, float** %9
%15 = call i32 @PAPI_flips(float* %11, float* %12, i64* %13, float* %14)
%16 = load i32*, i32** %10
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @papif_flips_(float* %0, float* %1, i64* %2, float* %3, i32* nocapture writeonly %4) {
%6 = tail call i32 @PAPI_flips(float* %0, float* %1, i64* %2, float* %3)
store i32 %6, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ pthread_self();
void task2() { printf("Thread #%u working on task2\n", (int)pthread_self()); }


x86 assembly (clang, -O0):
<task2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<task2>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Thread #%u working on task2\0A\00"
define void @task2() {
%1 = call i64 (...) @pthread_self()
%2 = trunc i64 %1 to i32
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Thread #%u working on task2\0A\00"
define void @task2() {
%1 = tail call i64 (...) @pthread_self()
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vdprintf_help(char);
char xputs(char *s) {
  for (; *s; s++)
    vdprintf_help(*s);
}


x86 assembly (clang, -O0):
<xputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <xputs+0x36>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <vdprintf_help@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <xputs+0xc>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @xputs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @vdprintf_help(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8 undef
}
void via_set_null(int level) {}


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

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

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

LLVM IR (-O2):
define void @via_set_null(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mbstate_t;
typedef int /*<<< orphan*/ char16_t;

/* Variables and functions */
size_t wcrtomb(char *, int /*<<< orphan*/, int /*<<< orphan*/ *);
size_t c16rtomb(char *__restrict__ s, char16_t c16,
                mbstate_t *__restrict__ state) {
  return wcrtomb(s, c16, state);
}


x86 assembly (clang, -O0):
<c16rtomb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <wcrtomb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c16rtomb>:
jmp    1030 <wcrtomb@plt>

LLVM IR (-O0):
define i64 @c16rtomb(i8* noalias %0, i32 %1, i32* noalias %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i64 @wcrtomb(i8* %7, i32 %8, i32* %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @c16rtomb(i8* noalias %0, i32 %1, i32* noalias %2) {
%4 = tail call i64 @wcrtomb(i8* %0, i32 %1, i32* %2)
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t *u8(const unsigned char *buffer, unsigned address) {
  return (uint8_t *)(buffer + (address ^ 3));
}


x86 assembly (clang, -O0):
<u8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
xor    $0x3,%ecx
mov    %ecx,%ecx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8>:
xor    $0x3,%esi
lea    (%rsi,%rdi,1),%rax
ret

LLVM IR (-O0):
define i32* @u8(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 = xor i32 %6, 3
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = bitcast i8* %9 to i32*
ret i32* %10
}

LLVM IR (-O2):
define i32* @u8(i8* readnone %0, i32 %1) {
%3 = xor i32 %1, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = bitcast i8* %5 to i32*
ret i32* %6
}
/* Variables and functions */
scalar_t__ isspace(char const);
void skip_spaces(const char **pp) {
  const char *p = *pp;
  while (*p && isspace(*p))
    p++;
  *pp = p;
}


x86 assembly (clang, -O0):
<skip_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1152 <skip_spaces+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1162 <skip_spaces+0x52>
jmp    1173 <skip_spaces+0x63>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <skip_spaces+0x17>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_spaces>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
mov    (%rbx),%al
test   %al,%al
je     1139 <skip_spaces+0x29>
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <skip_spaces+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skip_spaces+0x10>
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @skip_spaces(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %10
%6 = phi i8 [ %12, %10 ], [ %3, %1 ]
%7 = phi i8* [ %11, %10 ], [ %2, %1 ]
%8 = tail call i64 @isspace(i8 signext %6)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %1
%15 = phi i8* [ %2, %1 ], [ %11, %10 ], [ %7, %5 ]
store i8* %15, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ const2(int /*<<< orphan*/);
void convUint2long(void) { const2(0); }


x86 assembly (clang, -O0):
<convUint2long>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <const2@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @convUint2long() {
%1 = call i32 @const2(i32 0)
ret void
}

LLVM IR (-O2):
define void @convUint2long() {
%1 = tail call i32 @const2(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ init_test();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_4Bytes_to_500MBytes();
int main(void) {
  if (init_test() != 0) {
    printf("FAILURE init_test");
    exit(EXIT_FAILURE);
  }
  test_4Bytes_to_500MBytes();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <init_test@plt>
cmp    $0x0,%rax
je     117a <main+0x3a>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    $0x0,%al
call   1040 <test_4Bytes_to_500MBytes@plt>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <init_test@plt>
test   %rax,%rax
jne    1162 <main+0x22>
xor    %eax,%eax
call   1040 <test_4Bytes_to_500MBytes@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"FAILURE init_test\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @init_test()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
8: ; preds = %0
%9 = call i32 (...) @test_4Bytes_to_500MBytes()
%10 = load i32, i32* @EXIT_SUCCESS
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"FAILURE init_test\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i64 (...) @init_test()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %0
%8 = tail call i32 (...) @test_4Bytes_to_500MBytes()
%9 = load i32, i32* @EXIT_SUCCESS
%10 = tail call i32 @exit(i32 %9)
unreachable
}
void __attribute__((weak)) dma2_stream1_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<dma2_stream1_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dma2_stream1_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.dma2_stream1_isr = [17 x i8] c"dma2_stream1_isr\00"
define weak void @dma2_stream1_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__FUNCTION__.dma2_stream1_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.dma2_stream1_isr = [17 x i8] c"dma2_stream1_isr\00"
define weak void @dma2_stream1_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__FUNCTION__.dma2_stream1_isr, i64 0, i64 0))
ret void
}
void vec3_sub(const float v0[3], const float v1[3], float v[3]) {
  v[0] = v0[0] - v1[0];
  v[1] = v0[1] - v1[1];
  v[2] = v0[2] - v1[2];
}


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

x86 assembly (clang, -O2):
<vec3_sub>:
movss  (%rdi),%xmm0
subss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
movss  0x4(%rdi),%xmm0
subss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdx)
movss  0x8(%rdi),%xmm0
subss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @vec3_sub(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fsub float %9, %12
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %5
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fsub float %18, %21
%23 = load float*, float** %6
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %4
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %5
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fsub float %27, %30
%32 = load float*, float** %6
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @vec3_sub(float* nocapture %0, float* nocapture %1, float* nocapture writeonly %2) {
%4 = load float, float* %0
%5 = load float, float* %1
%6 = fsub float %4, %5
store float %6, float* %2
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 1
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = getelementptr inbounds float, float* %2, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %1, i64 2
%16 = load float, float* %15
%17 = fsub float %14, %16
%18 = getelementptr inbounds float, float* %2, i64 2
store float %17, float* %18
ret void
}
/* Type definitions */
struct pri {
  int dummy;
};

/* Variables and functions */
int asn1_dumprecursive(struct pri *, void *, int, int /*<<< orphan*/);
int asn1_dump(struct pri *pri, void *comp, int len) {
  return asn1_dumprecursive(pri, comp, len, 0);
}


x86 assembly (clang, -O0):
<asn1_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <asn1_dumprecursive@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asn1_dump>:
xor    %ecx,%ecx
jmp    1030 <asn1_dumprecursive@plt>

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

LLVM IR (-O2):
%struct.pri = type { i32 }
define i32 @asn1_dump(%struct.pri* %0, i8* %1, i32 %2) {
%4 = tail call i32 @asn1_dumprecursive(%struct.pri* %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
void cafebabe_constant_info_method_ref_deinit(
    struct cafebabe_constant_info_method_ref *r) {}


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

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

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

LLVM IR (-O2):
%struct.cafebabe_constant_info_method_ref = type opaque
define void @cafebabe_constant_info_method_ref_deinit(%struct.cafebabe_constant_info_method_ref* nocapture %0) {
ret void
}
int shiftPtr(int ptr, int s) { return ptr += s * sizeof(char); }


x86 assembly (clang, -O0):
<shiftPtr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x8(%rbp),%rcx
shl    $0x0,%rcx
movslq -0x4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<shiftPtr>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @shiftPtr(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 = sext i32 %5 to i64
%7 = mul i64 %6, 1
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = add i64 %9, %7
%11 = trunc i64 %10 to i32
store i32 %11, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @shiftPtr(i32 %0, i32 %1) {
%3 = add i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ stderr;
int waitpid(int, int *, int);
pid_t waitpid_safe(pid_t pid, int *status, int options, int id) {
  pid_t p;
  p = waitpid(pid, status, options);
  if (p == -1)
    fprintf(stderr, "waitpid pid=%d id=%d %m\n", pid, id);
  return p;
}


x86 assembly (clang, -O0):
<waitpid_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <waitpid@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    116c <waitpid_safe+0x4c>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitpid_safe>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edi,%ebp
call   1040 <waitpid@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    114f <waitpid_safe+0x2f>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"waitpid pid=%d id=%d %m\0A\00"
define i32 @waitpid_safe(i32 %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = call i32 @waitpid(i32 %10, i32* %11, i32 %12)
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %21
16: ; preds = %4
%17 = load i32, i32* @stderr
%18 = load i32, i32* %5
%19 = load i32, i32* %8
%20 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %19)
br label %21
21: ; preds = %16, %4
%22 = load i32, i32* %9
ret i32 %22
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"waitpid pid=%d id=%d %m\0A\00"
define i32 @waitpid_safe(i32 %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @waitpid(i32 %0, i32* %1, i32 %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %3)
br label %10
10: ; preds = %7, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ trunk();
void Cheetah() { trunk(); }


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

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

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

LLVM IR (-O2):
define void @Cheetah() {
%1 = tail call i32 (...) @trunk()
ret void
}
void *pmmp(const void *mtx1, const void *mtx2, unsigned int n, unsigned int t) {
}


x86 assembly (clang, -O0):
<pmmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @pmmp(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i8*, i8** %5
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @pmmp(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
ret i8* undef
}
extern void outsw(unsigned short port, const void *addr, unsigned long count) {
  __asm__ __volatile__("cld ; rep ; outs"
                       "w"
                       : "=S"(addr), "=c"(count)
                       : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<outsw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
cld
rep outsw %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsw>:
mov    %rdx,%rcx
mov    %edi,%edx
cld
rep outsw %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsw(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call { i8*, i64 } asm sideeffect "cld ; rep ; outsw", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %7, i8* %8, i64 %9)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @outsw(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "cld ; rep ; outsw", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t mp2vseq_get_vbvbuffer(const uint8_t *p_mp2vseq) {
  return ((p_mp2vseq[10] & 0x1f) << 5) | (p_mp2vseq[11] >> 3);
}


x86 assembly (clang, -O0):
<mp2vseq_get_vbvbuffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%eax
and    $0x1f,%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%rcx
mov    0x2c(%rcx),%ecx
sar    $0x3,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseq_get_vbvbuffer>:
mov    0x28(%rdi),%ecx
mov    0x2c(%rdi),%eax
and    $0x1f,%ecx
shl    $0x5,%ecx
sar    $0x3,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mp2vseq_get_vbvbuffer(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 10
%5 = load i32, i32* %4
%6 = and i32 %5, 31
%7 = shl i32 %6, 5
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 11
%10 = load i32, i32* %9
%11 = ashr i32 %10, 3
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @mp2vseq_get_vbvbuffer(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 10
%3 = load i32, i32* %2
%4 = shl i32 %3, 5
%5 = and i32 %4, 992
%6 = getelementptr inbounds i32, i32* %0, i64 11
%7 = load i32, i32* %6
%8 = ashr i32 %7, 3
%9 = or i32 %5, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int MakeIndex(const int iFace, const int iVert) {
  assert(iVert >= 0 && iVert < 4 && iFace >= 0);
  return (iFace << 2) | (iVert & 0x3);
}


x86 assembly (clang, -O0):
<MakeIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     1146 <MakeIndex+0x36>
xor    %eax,%eax
cmpl   $0x4,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jge    1146 <MakeIndex+0x36>
cmpl   $0x0,-0x4(%rbp)
setge  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    -0x8(%rbp),%ecx
and    $0x3,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MakeIndex>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
mov    %edi,%eax
not    %eax
shr    $0x1f,%eax
xor    %edi,%edi
cmp    $0x4,%esi
cmovb  %eax,%edi
call   1030 <assert@plt>
and    $0x3,%ebx
lea    (%rbx,%r14,4),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @MakeIndex(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 sge i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 4
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp sge i32 %11, 0
br label %13
13: ; preds = %10, %7, %2
%14 = phi i1 [ false, %7 ], [ false, %2 ], [ %12, %10 ]
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i32, i32* %3
%18 = shl i32 %17, 2
%19 = load i32, i32* %4
%20 = and i32 %19, 3
%21 = or i32 %18, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @MakeIndex(i32 %0, i32 %1) {
%3 = icmp ult i32 %1, 4
%4 = xor i32 %0, -1
%5 = lshr i32 %4, 31
%6 = select i1 %3, i32 %5, i32 0
%7 = tail call i32 @assert(i32 %6)
%8 = shl i32 %0, 2
%9 = and i32 %1, 3
%10 = or i32 %9, %8
ret i32 %10
}
int distance(y1, x1, y2, x2)
int y1, x1, y2, x2;
{
  register int dy, dx;
  dy = y1 - y2;
  if (dy < 0)
    dy = -dy;
  dx = x1 - x2;
  if (dx < 0)
    dx = -dx;
  return ((((dy + dx) << 1) - (dy > dx ? dx : dy)) >> 1);
}


x86 assembly (clang, -O0):
<distance>:
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
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    112b <distance+0x2b>
xor    %eax,%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1146 <distance+0x46>
xor    %eax,%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    1169 <distance+0x69>
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    116f <distance+0x6f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x20(%rbp),%ecx
sub    %ecx,%eax
sar    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
sub    %edx,%edi
mov    %edi,%edx
neg    %edx
cmovs  %edi,%edx
sub    %ecx,%esi
mov    %esi,%ecx
neg    %ecx
cmovs  %esi,%ecx
lea    (%rcx,%rdx,1),%eax
add    %eax,%eax
cmp    %ecx,%edx
cmovbe %edx,%ecx
sub    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @distance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %4
%17 = load i32, i32* %9
%18 = sub nsw i32 0, %17
store i32 %18, i32* %9
br label %19
19: ; preds = %16, %4
%20 = load i32, i32* %6
%21 = load i32, i32* %8
%22 = sub nsw i32 %20, %21
store i32 %22, i32* %10
%23 = load i32, i32* %10
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %19
%26 = load i32, i32* %10
%27 = sub nsw i32 0, %26
store i32 %27, i32* %10
br label %28
28: ; preds = %25, %19
%29 = load i32, i32* %9
%30 = load i32, i32* %10
%31 = add nsw i32 %29, %30
%32 = shl i32 %31, 1
%33 = load i32, i32* %9
%34 = load i32, i32* %10
%35 = icmp sgt i32 %33, %34
br i1 %35, label %36, label %38
36: ; preds = %28
%37 = load i32, i32* %10
br label %40
38: ; preds = %28
%39 = load i32, i32* %9
br label %40
40: ; preds = %38, %36
%41 = phi i32 [ %37, %36 ], [ %39, %38 ]
%42 = sub nsw i32 %32, %41
%43 = ashr i32 %42, 1
ret i32 %43
}

LLVM IR (-O2):
define i32 @distance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = tail call i32 @llvm.abs.i32(i32 %5, i1 true)
%7 = sub nsw i32 %1, %3
%8 = tail call i32 @llvm.abs.i32(i32 %7, i1 true)
%9 = add nuw nsw i32 %8, %6
%10 = shl nuw i32 %9, 1
%11 = icmp ugt i32 %6, %8
%12 = select i1 %11, i32 %8, i32 %6
%13 = sub nsw i32 %10, %12
%14 = ashr i32 %13, 1
ret i32 %14
}
/* Variables and functions */
double AT_histoOld_log_bin_width(long const, double const *);
double exp(scalar_t__);
scalar_t__ log(double const);
double AT_histoOld_upper_bin_limit(const long number_of_bins,
                                   const double bin_centers[],
                                   const long bin_no) {
  return (exp(log(bin_centers[bin_no]) +
              0.5 * AT_histoOld_log_bin_width(number_of_bins, bin_centers)));
}


x86 assembly (clang, -O0):
<AT_histoOld_upper_bin_limit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1040 <log@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <AT_histoOld_log_bin_width@plt>
movsd  -0x20(%rbp),%xmm1
movsd  0xe86(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AT_histoOld_upper_bin_limit>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movsd  (%rsi,%rdx,8),%xmm0
call   1040 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <AT_histoOld_log_bin_width@plt>
mulsd  0xe9c(%rip),%xmm0
addsd  (%rsp),%xmm0
cvttsd2si %xmm0,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @AT_histoOld_upper_bin_limit(i64 %0, double* %1, i64 %2) {
%4 = alloca i64
%5 = alloca double*
%6 = alloca i64
store i64 %0, i64* %4
store double* %1, double** %5
store i64 %2, i64* %6
%7 = load double*, double** %5
%8 = load i64, i64* %6
%9 = getelementptr inbounds double, double* %7, i64 %8
%10 = load double, double* %9
%11 = call i64 @log(double %10)
%12 = sitofp i64 %11 to double
%13 = load i64, i64* %4
%14 = load double*, double** %5
%15 = call double @AT_histoOld_log_bin_width(i64 %13, double* %14)
%16 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %15, double %12)
%17 = fptosi double %16 to i64
%18 = call double @exp(i64 %17)
ret double %18
}

LLVM IR (-O2):
define double @AT_histoOld_upper_bin_limit(i64 %0, double* %1, i64 %2) {
%4 = getelementptr inbounds double, double* %1, i64 %2
%5 = load double, double* %4
%6 = tail call i64 @log(double %5)
%7 = sitofp i64 %6 to double
%8 = tail call double @AT_histoOld_log_bin_width(i64 %0, double* %1)
%9 = tail call double @llvm.fmuladd.f64(double %8, double 5.000000e-01, double %7)
%10 = fptosi double %9 to i64
%11 = tail call double @exp(i64 %10)
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void display_status(int *x) { printf("*x == %d\n", *x); }


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

x86 assembly (clang, -O2):
<display_status>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"*x == %d\0A\00"
define void @display_status(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ printf(char *, int);
void sigalrm_fn(int sig) {
  static int i = 0;
  printf("alarm! i=%d\n", i);
  alarm(2);
  i++;
  return;
}


x86 assembly (clang, -O0):
<sigalrm_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2f03(%rip),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <alarm@plt>
mov    0x2ee7(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ede(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigalrm_fn>:
push   %rax
mov    0x2f0d(%rip),%esi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <alarm@plt>
addl   $0x1,0x2ef0(%rip)
pop    %rax
ret

LLVM IR (-O0):
@sigalrm_fn.i = internal global i32 0
@.str = [13 x i8] c"alarm! i=%d\0A\00"
define void @sigalrm_fn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @sigalrm_fn.i
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @alarm(i32 2)
%6 = load i32, i32* @sigalrm_fn.i
%7 = add nsw i32 %6, 1
store i32 %7, i32* @sigalrm_fn.i
ret void
}

LLVM IR (-O2):
@sigalrm_fn.i = internal unnamed_addr global i32 0
@.str = [13 x i8] c"alarm! i=%d\0A\00"
define void @sigalrm_fn(i32 %0) {
%2 = load i32, i32* @sigalrm_fn.i
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @alarm(i32 2)
%5 = load i32, i32* @sigalrm_fn.i
%6 = add nsw i32 %5, 1
store i32 %6, i32* @sigalrm_fn.i
ret void
}
/* Variables and functions */
int fabs(int);
double hat(double x) {
  double z = 1. - fabs(2. * x - 1.);
  return z > 0.0 ? z : 0.0;
}


x86 assembly (clang, -O0):
<hat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xeda(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xeb9(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1171 <hat+0x61>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    117e <hat+0x6e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    117e <hat+0x6e>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hat>:
push   %rax
addsd  %xmm0,%xmm0
addsd  0xee3(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xed6(%rip),%xmm0
subsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
maxsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @hat(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %4, double -1.000000e+00)
%6 = fptosi double %5 to i32
%7 = call i32 @fabs(i32 %6)
%8 = sitofp i32 %7 to double
%9 = fsub double 1.000000e+00, %8
store double %9, double* %3
%10 = load double, double* %3
%11 = fcmp ogt double %10, 0.000000e+00
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = load double, double* %3
br label %15
14: ; preds = %1
br label %15
15: ; preds = %14, %12
%16 = phi double [ %13, %12 ], [ 0.000000e+00, %14 ]
ret double %16
}

LLVM IR (-O2):
define double @hat(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double -1.000000e+00)
%3 = fptosi double %2 to i32
%4 = tail call i32 @fabs(i32 %3)
%5 = sitofp i32 %4 to double
%6 = fsub double 1.000000e+00, %5
%7 = fcmp ogt double %6, 0.000000e+00
%8 = select i1 %7, double %6, double 0.000000e+00
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void flag_test(void) { printf("flagtest included\n"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"flagtest included\0A\00"
define void @flag_test() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"flagtest included\00"
define void @flag_test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}