xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
long strtol(char *, char **, int);
void test1(char *array, char *endptr) {
  long r = strtol(array, &endptr, 3);
  assert(array + 2 == endptr);
  assert(r == 5);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1040 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x5,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsi,(%rsp)
mov    %rsp,%rsi
mov    $0x3,%edx
call   1040 <strtol@plt>
mov    %rax,%r14
add    $0x2,%rbx
xor    %edi,%edi
cmp    (%rsp),%rbx
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x5,%r14
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @test1(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strtol(i8* %6, i8** %4, i32 3)
store i64 %7, i64* %5
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 2
%10 = load i8*, i8** %4
%11 = icmp eq i8* %9, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i64, i64* %5
%15 = icmp eq i64 %14, 5
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret void
}

LLVM IR (-O2):
define void @test1(i8* %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = call i64 @strtol(i8* %0, i8** %3, i32 3)
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8*, i8** %3
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = icmp eq i64 %4, 5
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret void
}
__attribute__((no)) int f4(int k) {
  int a[2] = {k, k};
  asm("" : "+r"(a[0]));
  a[1]++;
  bar(a[0]);
  bar(a[1]);
  return a[0] + a[1];
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
mov    %edi,%ebx
lea    0x1(%r14),%ebp
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <bar@plt>
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <bar@plt>
lea    (%rbx,%r14,1),%eax
add    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @f4(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i32]
store i32 %0, i32* %2
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%5 = load i32, i32* %2
store i32 %5, i32* %4
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = load i32, i32* %2
store i32 %7, i32* %6
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%9 = load i32, i32* %8
%10 = call i32 asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %9)
store i32 %10, i32* %8
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 1
store i32 %13, i32* %11
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%15 = load i32, i32* %14
%16 = call i32 (i32, ...) bitcast (i32 (...)* @bar to i32 (i32, ...)*)(i32 %15)
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%18 = load i32, i32* %17
%19 = call i32 (i32, ...) bitcast (i32 (...)* @bar to i32 (i32, ...)*)(i32 %18)
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%21 = load i32, i32* %20
%22 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%23 = load i32, i32* %22
%24 = add nsw i32 %21, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @f4(i32 %0) {
%2 = tail call i32 asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = add nsw i32 %0, 1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @bar to i32 (i32, ...)*)(i32 %2)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @bar to i32 (i32, ...)*)(i32 %3)
%6 = add nsw i32 %2, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ BROTLI_UNUSED(void *);
void *malloc(size_t);
void *DefaultAllocFunc(void *opaque, size_t size) {
  BROTLI_UNUSED(opaque);
  return malloc(size);
}


x86 assembly (clang, -O0):
<DefaultAllocFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <BROTLI_UNUSED@plt>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DefaultAllocFunc>:
push   %rbx
mov    %rsi,%rbx
call   1030 <BROTLI_UNUSED@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @DefaultAllocFunc(i8* %0, i64 %1) {
%3 = tail call i32 @BROTLI_UNUSED(i8* %0)
%4 = tail call i8* @malloc(i64 %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ cxx_invoke_destructors();
void cxx_app_termination(void) { cxx_invoke_destructors(); }


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

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

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

LLVM IR (-O2):
define void @cxx_app_termination() {
%1 = tail call i32 (...) @cxx_invoke_destructors()
ret void
}
float __attribute__((__always___, __gnu___, __const__, __artificial__))
distance_squared_s(const float vx, const float vy, const float wx,
                   const float wy) {
  const float a = vx - wx;
  const float b = vy - wy;
  return (a * a + b * b);
}


x86 assembly (clang, -O0):
<distance_squared_s>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance_squared_s>:
subss  %xmm2,%xmm0
subss  %xmm3,%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @distance_squared_s(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%11 = load float, float* %5
%12 = load float, float* %7
%13 = fsub float %11, %12
store float %13, float* %9
%14 = load float, float* %6
%15 = load float, float* %8
%16 = fsub float %14, %15
store float %16, float* %10
%17 = load float, float* %9
%18 = load float, float* %9
%19 = load float, float* %10
%20 = load float, float* %10
%21 = fmul float %19, %20
%22 = call float @llvm.fmuladd.f32(float %17, float %18, float %21)
ret float %22
}

LLVM IR (-O2):
define float @distance_squared_s(float %0, float %1, float %2, float %3) {
%5 = fsub float %0, %2
%6 = fsub float %1, %3
%7 = fmul float %6, %6
%8 = tail call float @llvm.fmuladd.f32(float %5, float %5, float %7)
ret float %8
}
/* Variables and functions */
bool nrf91_errata_14(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf91_errata_14() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf91_errata_14() {
ret i32 0
}
double div_precise(double x, double y) {
  if (y == 0) {
    return y;
  } else {
    return (x / y);
  }
}


x86 assembly (clang, -O0):
<div_precise>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1135 <div_precise+0x35>
jp     1135 <div_precise+0x35>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1144 <div_precise+0x44>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_precise>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jne    1111 <div_precise+0x11>
jp     1111 <div_precise+0x11>
movapd %xmm1,%xmm0
ret
divsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @div_precise(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = fcmp oeq double %6, 0.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %5
store double %9, double* %3
br label %14
10: ; preds = %2
%11 = load double, double* %4
%12 = load double, double* %5
%13 = fdiv double %11, %12
store double %13, double* %3
br label %14
14: ; preds = %10, %8
%15 = load double, double* %3
ret double %15
}

LLVM IR (-O2):
define double @div_precise(double %0, double %1) {
%3 = fcmp oeq double %1, 0.000000e+00
%4 = fdiv double %0, %1
%5 = select i1 %3, double %1, double %4
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void rearm_timer(FILE *fd, int debug) {
  if (!debug)
    fputc(' ', fd);
}


x86 assembly (clang, -O0):
<rearm_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1137 <rearm_timer+0x27>
mov    -0x8(%rbp),%rsi
mov    $0x20,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rearm_timer>:
test   %esi,%esi
je     1115 <rearm_timer+0x5>
ret
mov    %rdi,%rax
mov    $0x20,%edi
mov    %rax,%rsi
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @rearm_timer(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 %10, label %7
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = call i32 @fputc(i8 signext 32, i32* %8)
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @rearm_timer(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @fputc(i8 signext 32, i32* %0)
br label %6
6: ; preds = %4, %2
ret void
}
unsigned int foo(unsigned long port) {
  unsigned int v;
  __asm__ __volatile__("" : "=S"(v) : "Nd"(port));
  return v;
}


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

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

LLVM IR (-O0):
define i32 @foo(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i32 asm sideeffect "", "={si},N{dx},~{dirflag},~{fpsr},~{flags}"(i64 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo(i64 %0) {
%2 = tail call i32 asm sideeffect "", "={si},N{dx},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ socket_write(int, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strlen(char const *);
void client_connect_cb(int fd) {
  const char message[] = "ping";
  fprintf(stderr, "client::%s\n", message);
  socket_write(fd, message, strlen(message));
}


x86 assembly (clang, -O0):
<client_connect_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xeba(%rip),%al
mov    %al,-0x5(%rbp)
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    -0x9(%rbp),%rdx
lea    0xea4(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x9(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x9(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <socket_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<client_connect_cb>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
movb   $0x0,0x4(%rsp)
movl   $0x676e6970,(%rsp)
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdx
call   1050 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <socket_write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.client_connect_cb.message = [5 x i8] c"ping\00"
@stderr = global i32 0
@.str = [12 x i8] c"client::%s\0A\00"
define void @client_connect_cb(i32 %0) {
%2 = alloca i32
%3 = alloca [5 x i8]
store i32 %0, i32* %2
%4 = bitcast [5 x i8]* %3 to i8*
%5 = load i32, i32* @stderr
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %2
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @socket_write(i32 %8, i8* %9, i32 %11)
ret void
}

LLVM IR (-O2):
@__const.client_connect_cb.message = [5 x i8] c"ping\00"
@stderr = global i32 0
@.str = [12 x i8] c"client::%s\0A\00"
define void @client_connect_cb(i32 %0) {
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @strlen(i8* %3)
%7 = call i32 @socket_write(i32 %0, i8* %3, i32 %6)
ret void
}
void av_buffer_make_writable() {}


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

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

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

LLVM IR (-O2):
define void @av_buffer_make_writable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *strndup_chk(char *, size_t, char *);
int main() {
  char *dst, *src = "abcdefghijklmnopqrstuvwxyz";
  size_t len = 10;
  dst = strndup_chk(src, len, "strndup_chk unit test");
  printf("%s\n", dst);
  {
    free(dst);
    dst = NULL;
  };
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x18(%rbp)
movq   $0xa,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    0xeba(%rip),%rdx
call   1040 <strndup_chk@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x10(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xedc(%rip),%rdx
mov    $0xa,%esi
call   1040 <strndup_chk@plt>
mov    %rax,%rbx
lea    0xede(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
@.str.1 = [22 x i8] c"strndup_chk unit test\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i32 0, i32* %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8** %3
store i64 10, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @strndup_chk(i8* %5, i64 %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
store i8* %7, i8** %2
%8 = load i8*, i8** %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %2
%11 = call i32 @free(i8* %10)
store i8* null, i8** %2
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
@.str.1 = [22 x i8] c"strndup_chk unit test\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @strndup_chk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 10, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void check_for_null(void *ptr) {
  if (ptr == NULL) {
    fprintf(stderr, "Error: memory allocation failed! "
                    "Terminating program.\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check_for_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <check_for_null+0x36>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_for_null>:
test   %rdi,%rdi
je     1126 <check_for_null+0x6>
ret
push   %rax
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"Error: memory allocation failed! Terminating program.\0A\00"
define void @check_for_null(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"Error: memory allocation failed! Terminating program.\0A\00"
define void @check_for_null(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fnoreturn_alias();
int call_fnoreturn_alias(void) { fnoreturn_alias(); }


x86 assembly (clang, -O0):
<call_fnoreturn_alias>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <fnoreturn_alias@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @call_fnoreturn_alias() {
%1 = alloca i32
%2 = call i32 (...) @fnoreturn_alias()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @call_fnoreturn_alias() {
%1 = tail call i32 (...) @fnoreturn_alias()
ret i32 undef
}
/* Variables and functions */
char *strrchr(char *, char);
void path_basename(char *path, char **basename) {
  char *slash;
  slash = strrchr(path, '/');
  if (slash == NULL) {
    *basename = path;
  } else {
    *basename = slash + 1;
  }
}


x86 assembly (clang, -O0):
<path_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114d <path_basename+0x3d>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    115c <path_basename+0x4c>
mov    -0x18(%rbp),%rcx
add    $0x1,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_basename>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @path_basename(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i8*
store i8* %0, i8** %3
store i8** %1, i8*** %4
%6 = load i8*, i8** %3
%7 = call i8* @strrchr(i8* %6, i8 signext 47)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
br label %17
13: ; preds = %2
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8**, i8*** %4
store i8* %15, i8** %16
br label %17
17: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
define void @path_basename(i8* %0, i8** nocapture writeonly %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%4 = icmp eq i8* %3, null
%5 = getelementptr inbounds i8, i8* %3, i64 1
%6 = select i1 %4, i8* %0, i8* %5
store i8* %6, i8** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void pointFail() {
  int a = 12;
  int *pointer;
  pointer = &a;
  printf("Pointer ist: %d", *pointer);
  int *nullpointer = NULL;
  printf("NullPointer ist: %d", *nullpointer);
}


x86 assembly (clang, -O0):
<pointFail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xc,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pointFail>:
push   %rax
lea    0xeec(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Pointer ist: %d\00"
@.str.1 = [20 x i8] c"NullPointer ist: %d\00"
define void @pointFail() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 12, i32* %1
store i32* %1, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32* null, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Pointer ist: %d\00"
@.str.1 = [20 x i8] c"NullPointer ist: %d\00"
define void @pointFail() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 12)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_screen();
int /*<<< orphan*/ cursor(int, int);
int /*<<< orphan*/ cursor_off();
int /*<<< orphan*/ cursor_on();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *, char *);
void message(char *s) {
  cursor_off();
  clear_screen();
  cursor(10, 10);
  printf("%s", s);
  getch();
  cursor_on();
}


x86 assembly (clang, -O0):
<message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <cursor_off@plt>
mov    $0x0,%al
call   1080 <clear_screen@plt>
mov    $0xa,%esi
mov    %esi,%edi
call   1060 <cursor@plt>
mov    -0x8(%rbp),%rsi
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <getch@plt>
mov    $0x0,%al
call   1050 <cursor_on@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<message>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <cursor_off@plt>
xor    %eax,%eax
call   1080 <clear_screen@plt>
mov    $0xa,%edi
mov    $0xa,%esi
call   1060 <cursor@plt>
lea    0xe78(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <getch@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <cursor_on@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @message(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @cursor_off()
%4 = call i32 (...) @clear_screen()
%5 = call i32 @cursor(i32 10, i32 10)
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 (...) @getch()
%9 = call i32 (...) @cursor_on()
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @message(i8* %0) {
%2 = tail call i32 (...) @cursor_off()
%3 = tail call i32 (...) @clear_screen()
%4 = tail call i32 @cursor(i32 10, i32 10)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 (...) @getch()
%7 = tail call i32 (...) @cursor_on()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ plcvm_get_u16(scalar_t__);
scalar_t__ plcvm_lpm_u8();
int plcvm_pop();
int /*<<< orphan*/ plcvm_push(int /*<<< orphan*/);
void cb_ldm_u2_cs8(void) {
  plcvm_push(plcvm_get_u16(plcvm_pop() * 2 + plcvm_lpm_u8()));
}


x86 assembly (clang, -O0):
<cb_ldm_u2_cs8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <plcvm_pop@plt>
shl    $0x1,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <plcvm_lpm_u8@plt>
mov    -0x8(%rbp),%rdi
add    %rax,%rdi
call   1030 <plcvm_get_u16@plt>
mov    %eax,%edi
call   1050 <plcvm_push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_ldm_u2_cs8>:
push   %rbx
xor    %eax,%eax
call   1040 <plcvm_pop@plt>
add    %eax,%eax
movslq %eax,%rbx
xor    %eax,%eax
call   1060 <plcvm_lpm_u8@plt>
add    %rax,%rbx
mov    %rbx,%rdi
call   1030 <plcvm_get_u16@plt>
mov    %eax,%edi
pop    %rbx
jmp    1050 <plcvm_push@plt>

LLVM IR (-O0):
define void @cb_ldm_u2_cs8() {
%1 = call i32 (...) @plcvm_pop()
%2 = mul nsw i32 %1, 2
%3 = sext i32 %2 to i64
%4 = call i64 (...) @plcvm_lpm_u8()
%5 = add nsw i64 %3, %4
%6 = call i32 @plcvm_get_u16(i64 %5)
%7 = call i32 @plcvm_push(i32 %6)
ret void
}

LLVM IR (-O2):
define void @cb_ldm_u2_cs8() {
%1 = tail call i32 (...) @plcvm_pop()
%2 = shl nsw i32 %1, 1
%3 = sext i32 %2 to i64
%4 = tail call i64 (...) @plcvm_lpm_u8()
%5 = add nsw i64 %4, %3
%6 = tail call i32 @plcvm_get_u16(i64 %5)
%7 = tail call i32 @plcvm_push(i32 %6)
ret void
}
void huu() {}


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

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

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

LLVM IR (-O2):
define void @huu() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void sys_error(const char *msg) {
  perror(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<sys_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sys_error>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @sys_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @sys_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
size_t alignedNumber(size_t num, size_t alignment) {
  size_t ret = num / alignment;
  if (num % alignment > num / 2) {
    ret++;
  }
  ret = ret * alignment;
  return ret;
}


x86 assembly (clang, -O0):
<alignedNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
cmp    %rax,%rdx
jbe    1145 <alignedNumber+0x45>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alignedNumber>:
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1116 <alignedNumber+0x16>
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
jmp    111c <alignedNumber+0x1c>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
shr    %rdi
cmp    %rdx,%rdi
adc    $0x0,%rax
imul   %rsi,%rax
ret

LLVM IR (-O0):
define i64 @alignedNumber(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = udiv i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = urem i64 %9, %10
%12 = load i64, i64* %3
%13 = udiv i64 %12, 2
%14 = icmp ugt i64 %11, %13
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = load i64, i64* %5
%17 = add i64 %16, 1
store i64 %17, i64* %5
br label %18
18: ; preds = %15, %2
%19 = load i64, i64* %5
%20 = load i64, i64* %4
%21 = mul i64 %19, %20
store i64 %21, i64* %5
%22 = load i64, i64* %5
ret i64 %22
}

LLVM IR (-O2):
define i64 @alignedNumber(i64 %0, i64 %1) {
%3 = udiv i64 %0, %1
%4 = urem i64 %0, %1
%5 = lshr i64 %0, 1
%6 = icmp ugt i64 %4, %5
%7 = zext i1 %6 to i64
%8 = add i64 %3, %7
%9 = mul i64 %8, %1
ret i64 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
scalar_t__ errno;
int parse_status(char const *, char *, int *);
int /*<<< orphan*/ strtoul(char const *, char **, int /*<<< orphan*/);
int parse_u32(const char *optarg, uint32_t *val, int *cont) {
  char *end;
  errno = 0;
  *val = strtoul(optarg, &end, 0);
  return parse_status(optarg, end, cont);
}


x86 assembly (clang, -O0):
<parse_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea5(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
xor    %edx,%edx
call   1040 <strtoul@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <parse_status@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_u32>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    0x2ea7(%rip),%rax
movq   $0x0,(%rax)
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   1040 <strtoul@plt>
mov    %eax,(%r15)
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <parse_status@plt>

LLVM IR (-O0):
@errno = global i64 0
define i32 @parse_u32(i8* %0, i32* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
store i64 0, i64* @errno
%8 = load i8*, i8** %4
%9 = call i32 @strtoul(i8* %8, i8** %7, i32 0)
%10 = load i32*, i32** %5
store i32 %9, i32* %10
%11 = load i8*, i8** %4
%12 = load i8*, i8** %7
%13 = load i32*, i32** %6
%14 = call i32 @parse_status(i8* %11, i8* %12, i32* %13)
ret i32 %14
}

LLVM IR (-O2):
@errno = global i64 0
define i32 @parse_u32(i8* %0, i32* nocapture writeonly %1, i32* %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
store i64 0, i64* @errno
%6 = call i32 @strtoul(i8* %0, i8** %4, i32 0)
store i32 %6, i32* %1
%7 = load i8*, i8** %4
%8 = tail call i32 @parse_status(i8* %0, i8* %7, i32* %2)
ret i32 %8
}
unsigned long long int f2ull(float f) { return (unsigned long long int)f; }


x86 assembly (clang, -O0):
<f2ull>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm2
movaps %xmm0,%xmm1
subss  %xmm2,%xmm1
cvttss2si %xmm1,%rcx
cvttss2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2ull>:
cvttss2si %xmm0,%rcx
mov    %rcx,%rdx
sar    $0x3f,%rdx
subss  0xeec(%rip),%xmm0
cvttss2si %xmm0,%rax
and    %rdx,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @f2ull(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptoui float %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @f2ull(float %0) {
%2 = fptoui float %0 to i64
ret i64 %2
}
unsigned long long tmax(unsigned long long a, unsigned long long b) {
  if (a >= b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<tmax>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1127 <tmax+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <tmax+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmax>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmovb  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @tmax(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
/* Type definitions */
struct lh_ctx_t {
  int dummy;
};
struct lh_con_t {
  int dummy;
};

/* Variables and functions */
int httplib_printf(struct lh_ctx_t const *, struct lh_con_t *, char *);
int XX_httplib_send_no_cache_header(const struct lh_ctx_t *ctx,
                                    struct lh_con_t *conn) {
  return httplib_printf(ctx, conn,
                        "Cache-Control: no-cache, no-store, "
                        "must-revalidate, private, max-age=0\r\n"
                        "Pragma: no-cache\r\n"
                        "Expires: 0\r\n");
}


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

x86 assembly (clang, -O2):
<XX_httplib_send_no_cache_header>:
lea    0xee9(%rip),%rdx
jmp    1030 <httplib_printf@plt>

LLVM IR (-O0):
%struct.lh_ctx_t = type { i32 }
%struct.lh_con_t = type { i32 }
@.str = [103 x i8] c"Cache-Control: no-cache, no-store, must-revalidate, private, max-age=0\0D\0APragma: no-cache\0D\0AExpires: 0\0D\0A\00"
define i32 @XX_httplib_send_no_cache_header(%struct.lh_ctx_t* %0, %struct.lh_con_t* %1) {
%3 = alloca %struct.lh_ctx_t*
%4 = alloca %struct.lh_con_t*
store %struct.lh_ctx_t* %0, %struct.lh_ctx_t** %3
store %struct.lh_con_t* %1, %struct.lh_con_t** %4
%5 = load %struct.lh_ctx_t*, %struct.lh_ctx_t** %3
%6 = load %struct.lh_con_t*, %struct.lh_con_t** %4
%7 = call i32 @httplib_printf(%struct.lh_ctx_t* %5, %struct.lh_con_t* %6, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
%struct.lh_ctx_t = type { i32 }
%struct.lh_con_t = type { i32 }
@.str = [103 x i8] c"Cache-Control: no-cache, no-store, must-revalidate, private, max-age=0\0D\0APragma: no-cache\0D\0AExpires: 0\0D\0A\00"
define i32 @XX_httplib_send_no_cache_header(%struct.lh_ctx_t* %0, %struct.lh_con_t* %1) {
%3 = tail call i32 @httplib_printf(%struct.lh_ctx_t* %0, %struct.lh_con_t* %1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void output(int arr[], int num_of_elements) {
  int i;
  for (i = 0; i < num_of_elements; i++) {
    printf("arr[%d] = %d \n", i, arr[i]);
  }
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <output+0x4a>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <output+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <output+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <output+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [15 x i8] c"arr[%d] = %d \0A\00"
define void @output(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32, i32* %5
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"arr[%d] = %d \0A\00"
define void @output(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ dataInjectionMode;

/* Variables and functions */
int /*<<< orphan*/ FifoProtocol_memcpy(int /*<<< orphan*/ *, void const *, int);
uint16_t inv_fifo_protocol_helper_decode_datainjection(const void *in,
                                                       uint16_t len) {
  uint16_t dataInjectionMode;
  FifoProtocol_memcpy((&dataInjectionMode), (in), (sizeof(dataInjectionMode)));
  (void)len;
  return dataInjectionMode;
}


x86 assembly (clang, -O0):
<inv_fifo_protocol_helper_decode_datainjection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
mov    $0x4,%edx
call   1030 <FifoProtocol_memcpy@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_fifo_protocol_helper_decode_datainjection>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <FifoProtocol_memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @inv_fifo_protocol_helper_decode_datainjection(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @FifoProtocol_memcpy(i32* %3, i8* %0, i32 4)
%6 = load i32, i32* %3
ret i32 %6
}
int dllimport_fn_isoarg(int arg __attribute__((dllimport))) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dllimport_fn_isoarg(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
char *getTmpDir();
int test_getTmpDir(void) {
  const char *tmp_dir = getTmpDir();
  assert(tmp_dir);
  return 0;
}


x86 assembly (clang, -O0):
<test_getTmpDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getTmpDir@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_getTmpDir>:
push   %rax
xor    %eax,%eax
call   1040 <getTmpDir@plt>
mov    %rax,%rdi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_getTmpDir() {
%1 = alloca i8*
%2 = call i8* (...) @getTmpDir()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @assert(i8* %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @test_getTmpDir() {
%1 = tail call i8* (...) @getTmpDir()
%2 = tail call i32 @assert(i8* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct buffer_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ game_process_stream_ooo(int /*<<< orphan*/,
                                           int /*<<< orphan*/,
                                           struct buffer_t *);
void game_process_stream_untimed_ooo(uint32_t conn, uint32_t index,
                                     struct buffer_t *stream) {
  game_process_stream_ooo(conn, index, stream);
}


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

x86 assembly (clang, -O2):
<game_process_stream_untimed_ooo>:
jmp    1030 <game_process_stream_ooo@plt>

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

LLVM IR (-O2):
%struct.buffer_t = type { i32 }
define void @game_process_stream_untimed_ooo(i32 %0, i32 %1, %struct.buffer_t* %2) {
%4 = tail call i32 @game_process_stream_ooo(i32 %0, i32 %1, %struct.buffer_t* %2)
ret void
}
char *rewrite_url(char *url) {
  char *newUrl = "";
  int i = 0;
  while (url[i] != '\0' && url[i] != '?') {
    newUrl[i] = url[i];
  }
  return newUrl;
}


x86 assembly (clang, -O0):
<rewrite_url>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     1149 <rewrite_url+0x49>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3f,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1159 <rewrite_url+0x59>
jmp    1174 <rewrite_url+0x74>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    111a <rewrite_url+0x1a>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rewrite_url>:
mov    (%rdi),%al
test   %al,%al
je     110a <rewrite_url+0xa>
cmp    $0x3f,%al
jne    1120 <rewrite_url+0x20>
lea    0xeef(%rip),%rax
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1120 <rewrite_url+0x20>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @rewrite_url(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %23, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 63
br label %21
21: ; preds = %13, %5
%22 = phi i1 [ false, %5 ], [ %20, %13 ]
br i1 %22, label %23, label %33
23: ; preds = %21
%24 = load i8*, i8** %2
%25 = load i32, i32* %4
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
%28 = load i8, i8* %27
%29 = load i8*, i8** %3
%30 = load i32, i32* %4
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %29, i64 %31
store i8 %28, i8* %32
br label %5
33: ; preds = %21
%34 = load i8*, i8** %3
ret i8* %34
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @rewrite_url(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %3 [
i8 0, label %4
i8 63, label %4
]
3: ; preds = %1, %3
br label %3
4: ; preds = %1, %1
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}