xunge/DecIR huggingface dataset:
double scale_dh13(double x, double y, double z) { return 0.0; }


x86 assembly (clang, -O0):
<scale_dh13>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_dh13>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @scale_dh13(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @scale_dh13(double %0, double %1, double %2) {
ret double 0.000000e+00
}
int test_imm_91uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x91 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_91uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x91,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_91uint64_midword_reg>:
test   $0x910000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_91uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 9502720
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
void *scribble_get(int);
int /*<<< orphan*/ stderr;
void *xscribble_get(ssize_t sz) {
  void *p = scribble_get(sz);
  if (p == NULL) {
    fprintf(stderr, "could not allocate %u bytes of scribble space", sz);
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<xscribble_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <scribble_get@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1178 <xscribble_get+0x48>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe9b(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xscribble_get>:
push   %rbx
mov    %edi,%ebx
call   1030 <scribble_get@plt>
test   %rax,%rax
je     113f <xscribble_get+0xf>
pop    %rbx
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
mov    %ebx,%edx
call   1040 <fprintf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"could not allocate %u bytes of scribble space\00"
@EXIT_FAILURE = global i32 0
define i8* @xscribble_get(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @scribble_get(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"could not allocate %u bytes of scribble space\00"
@EXIT_FAILURE = global i32 0
define i8* @xscribble_get(i32 %0) {
%2 = tail call i8* @scribble_get(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
unsigned short from32to16(unsigned long x) {
  x = (x & 0xffff) + (x >> 16);
  x = (x & 0xffff) + (x >> 16);
  return x;
}


x86 assembly (clang, -O0):
<from32to16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffff,%rax
mov    -0x8(%rbp),%rcx
shr    $0x10,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffff,%rax
mov    -0x8(%rbp),%rcx
shr    $0x10,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<from32to16>:
movzwl %di,%ecx
shr    $0x10,%rdi
add    %edi,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @from32to16(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 65535
%5 = load i64, i64* %2
%6 = lshr i64 %5, 16
%7 = add i64 %4, %6
store i64 %7, i64* %2
%8 = load i64, i64* %2
%9 = and i64 %8, 65535
%10 = load i64, i64* %2
%11 = lshr i64 %10, 16
%12 = add i64 %9, %11
store i64 %12, i64* %2
%13 = load i64, i64* %2
%14 = trunc i64 %13 to i16
ret i16 %14
}

LLVM IR (-O2):
define zeroext i16 @from32to16(i64 %0) {
%2 = and i64 %0, 65535
%3 = lshr i64 %0, 16
%4 = add nuw nsw i64 %2, %3
%5 = lshr i64 %4, 16
%6 = add nuw nsw i64 %5, %4
%7 = trunc i64 %6 to i16
ret i16 %7
}
double ne_double(double a, double b) { return a != b; }


x86 assembly (clang, -O0):
<ne_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne_double>:
cmpneqsd %xmm1,%xmm0
movsd  0xef3(%rip),%xmm1
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ne_double(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp une double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @ne_double(double %0, double %1) {
%3 = fcmp une double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr(char const *);
void ft_putstr_succ(char const *s) {
  ft_putstr("\x1B[32m");
  ft_putstr(s);
  ft_putstr("\x1B[0m");
}


x86 assembly (clang, -O0):
<ft_putstr_succ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <ft_putstr@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ft_putstr@plt>
lea    0xece(%rip),%rdi
call   1030 <ft_putstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_succ>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <ft_putstr@plt>
mov    %rbx,%rdi
call   1030 <ft_putstr@plt>
lea    0xed7(%rip),%rdi
pop    %rbx
jmp    1030 <ft_putstr@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[32m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @ft_putstr_succ(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @ft_putstr(i8* %4)
%6 = call i32 @ft_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[32m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @ft_putstr_succ(i8* %0) {
%2 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @ft_putstr(i8* %0)
%4 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
void ntstring(char *dest, const char *src, size_t len) {
  memcpy(dest, src, len);
  dest[len] = '\0';
}


x86 assembly (clang, -O0):
<ntstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntstring>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <memcpy@plt>
movb   $0x0,(%rbx,%r14,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ntstring(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcpy(i8* %7, i8* %8, i64 %9)
%11 = load i8*, i8** %4
%12 = load i64, i64* %6
%13 = getelementptr inbounds i8, i8* %11, i64 %12
store i8 0, i8* %13
ret void
}

LLVM IR (-O2):
define void @ntstring(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
%5 = getelementptr inbounds i8, i8* %0, i64 %2
store i8 0, i8* %5
ret void
}
/* Variables and functions */
int *realloc(int *, int);
int reserve_int(int n, int **arr) {
  int ok = 0;
  int *newArr = realloc(*arr, n * sizeof(int));
  if (newArr) {
    *arr = newArr;
    ok = 1;
  }
  return ok;
}


x86 assembly (clang, -O0):
<reserve_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%esi
call   1030 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115d <reserve_int+0x4d>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reserve_int>:
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%rax
lea    0x0(,%rdi,4),%esi
mov    %rax,%rdi
call   1030 <realloc@plt>
test   %rax,%rax
je     1135 <reserve_int+0x25>
mov    %rax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @reserve_int(i32 %0, i32** nocapture %1) {
%3 = load i32*, i32** %1
%4 = shl i32 %0, 2
%5 = tail call i32* @realloc(i32* %3, i32 %4)
%6 = icmp eq i32* %5, null
br i1 %6, label %8, label %7
7: ; preds = %2
store i32* %5, i32** %1
br label %8
8: ; preds = %7, %2
%9 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void malloc_error() {
  fprintf(stderr, "Couldn't allocate memory\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Couldn't allocate memory\0A\00"
define void @malloc_error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Couldn't allocate memory\0A\00"
define void @malloc_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int uint32_t;

/* Variables and functions */
void llvm_gcda_increment_indirect_counter(uint32_t *predecessor,
                                          uint64_t **counters) {
  uint64_t *counter;
  uint32_t pred;
  pred = *predecessor;
  if (pred == 0xffffffff)
    return;
  counter = counters[pred];
  if (counter)
    ++*counter;
}


x86 assembly (clang, -O0):
<llvm_gcda_increment_indirect_counter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    1124 <llvm_gcda_increment_indirect_counter+0x24>
jmp    114a <llvm_gcda_increment_indirect_counter+0x4a>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <llvm_gcda_increment_indirect_counter+0x4a>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<llvm_gcda_increment_indirect_counter>:
movslq (%rdi),%rax
cmp    $0xffffffffffffffff,%rax
je     1115 <llvm_gcda_increment_indirect_counter+0x15>
mov    (%rsi,%rax,8),%rax
test   %rax,%rax
je     1115 <llvm_gcda_increment_indirect_counter+0x15>
addl   $0x1,(%rax)
ret

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

LLVM IR (-O2):
define void @llvm_gcda_increment_indirect_counter(i32* nocapture %0, i32** nocapture %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, -1
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds i32*, i32** %1, i64 %6
%8 = load i32*, i32** %7
%9 = icmp eq i32* %8, null
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = load i32, i32* %8
%12 = add nsw i32 %11, 1
store i32 %12, i32* %8
br label %13
13: ; preds = %5, %10, %2
ret void
}
void SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter(
    void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter = [70 x i8] c"SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter\00"
define void @SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([70 x i8], [70 x i8]* @__func__.SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter = [70 x i8] c"SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter\00"
define void @SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([70 x i8], [70 x i8]* @__func__.SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void int_handler(int sig_num) {
  printf("\nExiting...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<int_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<int_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"\0AExiting...\0A\00"
define void @int_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [12 x i8] c"\0AExiting...\00"
define void @int_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int i, s1 = 0, s2 = 0;
  for (i = 1; i <= 100; i++) {
    s1 += i * i;
    s2 += i;
  }
  s2 *= s2;
  printf("%d\n", s2 - s1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jg     1169 <main+0x59>
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113b <main+0x2b>
mov    -0x1c(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
sub    -0x18(%rbp),%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 0, i32* %8
store i32 1, i32* %6
br label %9
9: ; preds = %21, %2
%10 = load i32, i32* %6
%11 = icmp sle i32 %10, 100
br i1 %11, label %12, label %24
12: ; preds = %9
%13 = load i32, i32* %6
%14 = load i32, i32* %6
%15 = mul nsw i32 %13, %14
%16 = load i32, i32* %7
%17 = add nsw i32 %16, %15
store i32 %17, i32* %7
%18 = load i32, i32* %6
%19 = load i32, i32* %8
%20 = add nsw i32 %19, %18
store i32 %20, i32* %8
br label %21
21: ; preds = %12
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %9
24: ; preds = %9
%25 = load i32, i32* %8
%26 = load i32, i32* %8
%27 = mul nsw i32 %26, %25
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %7
%30 = sub nsw i32 %28, %29
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 25164150)
ret i32 0
}
/* Type definitions */
struct evbuffer {
  int dummy;
};

/* Variables and functions */
struct evbuffer *socks5_mkmethods_plain(int);
struct evbuffer *socks5_mkmethods_plain_wrapper(void *p) {
  int *do_password = p;
  return socks5_mkmethods_plain(*do_password);
}


x86 assembly (clang, -O0):
<socks5_mkmethods_plain_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <socks5_mkmethods_plain@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socks5_mkmethods_plain_wrapper>:
mov    (%rdi),%edi
jmp    1030 <socks5_mkmethods_plain@plt>

LLVM IR (-O0):
%struct.evbuffer = type { i32 }
define %struct.evbuffer* @socks5_mkmethods_plain_wrapper(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = call %struct.evbuffer* @socks5_mkmethods_plain(i32 %7)
ret %struct.evbuffer* %8
}

LLVM IR (-O2):
%struct.evbuffer = type { i32 }
define %struct.evbuffer* @socks5_mkmethods_plain_wrapper(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call %struct.evbuffer* @socks5_mkmethods_plain(i32 %3)
ret %struct.evbuffer* %4
}
unsigned long hash(unsigned char *str) {
  int i = 1;
  unsigned long hash = 42;
  int c;
  while (c = *str++) {
    hash = hash + c * i;
    i++;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movq   $0x2a,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1158 <hash+0x58>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   -0xc(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <hash+0x17>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%dl
mov    $0x2a,%eax
test   %dl,%dl
je     1125 <hash+0x25>
mov    $0x1,%ecx
movzbl %dl,%edx
imul   %ecx,%edx
add    %rdx,%rax
movzbl (%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <hash+0x10>
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %15, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i64 [ %13, %4 ], [ 42, %1 ]
%8 = phi i32 [ %14, %4 ], [ 1, %1 ]
%9 = zext i8 %5 to i32
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = mul nsw i32 %8, %9
%12 = zext i32 %11 to i64
%13 = add i64 %7, %12
%14 = add nuw nsw i32 %8, 1
%15 = load i8, i8* %10
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %4, %1
%18 = phi i64 [ 42, %1 ], [ %13, %4 ]
ret i64 %18
}
/* Variables and functions */
scalar_t__ eval_boolean(char *);
int /*<<< orphan*/ exit(int);
void cmd_fail_if(const char *assign_to, char *arg) {
  (void)assign_to;
  if (eval_boolean(arg))
    exit(1);
}


x86 assembly (clang, -O0):
<cmd_fail_if>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <eval_boolean@plt>
cmp    $0x0,%rax
je     114d <cmd_fail_if+0x2d>
mov    $0x1,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_fail_if>:
push   %rax
mov    %rsi,%rdi
call   1040 <eval_boolean@plt>
test   %rax,%rax
jne    1130 <cmd_fail_if+0x10>
pop    %rax
ret
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @cmd_fail_if(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @eval_boolean(i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @cmd_fail_if(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i64 @eval_boolean(i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
ret void
}
unsigned kol_system_time_get() { asm volatile("int $0x40" ::"a"(3)); }


x86 assembly (clang, -O0):
<kol_system_time_get>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%eax
int    $0x40
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_system_time_get>:
mov    $0x3,%eax
int    $0x40
ret

LLVM IR (-O0):
define i32 @kol_system_time_get() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @kol_system_time_get() {
tail call void asm sideeffect "int $$0x40", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 3)
ret i32 undef
}
void UARTEnableLIN(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000010))) &=
      ~(0x00000800 | 0x00003000);
  (*((volatile unsigned long *)(ulBase + 0x00000014))) &=
      ~(0x00000008 | 0x00000020 | 0x00000002);
  (*((volatile unsigned long *)(ulBase + 0x00000010))) |= (0x00004000);
}


x86 assembly (clang, -O0):
<UARTEnableLIN>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rcx
and    $0xffffffffffffc7ff,%rcx
mov    %rcx,0x10(%rax)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%rcx
and    $0xffffffffffffffd5,%rcx
mov    %rcx,0x14(%rax)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rcx
or     $0x4000,%rcx
mov    %rcx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTEnableLIN>:
andq   $0xffffffffffffc7ff,0x10(%rdi)
ff
andq   $0xffffffffffffffd5,0x14(%rdi)
orq    $0x4000,0x10(%rdi)
ret

LLVM IR (-O0):
define void @UARTEnableLIN(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 16
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -14337
store volatile i64 %7, i64* %5
%8 = load i64, i64* %2
%9 = add i64 %8, 20
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = and i64 %11, -43
store volatile i64 %12, i64* %10
%13 = load i64, i64* %2
%14 = add i64 %13, 16
%15 = inttoptr i64 %14 to i64*
%16 = load volatile i64, i64* %15
%17 = or i64 %16, 16384
store volatile i64 %17, i64* %15
ret void
}

LLVM IR (-O2):
define void @UARTEnableLIN(i64 %0) {
%2 = add i64 %0, 16
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -14337
store volatile i64 %5, i64* %3
%6 = add i64 %0, 20
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, -43
store volatile i64 %9, i64* %7
%10 = load volatile i64, i64* %3
%11 = or i64 %10, 16384
store volatile i64 %11, i64* %3
ret void
}
/* Variables and functions */
int rand();
double rand_wrapper(double *arg_list) {
  double l;
  l = (double)((rand()) % ((int)arg_list[0]));
  return l;
}


x86 assembly (clang, -O0):
<rand_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%rcx
cvttsd2si (%rcx),%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_wrapper>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
cvttsd2si (%rbx),%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @rand_wrapper(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
%4 = call i32 (...) @rand()
%5 = load double*, double** %2
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = fptosi double %7 to i32
%9 = srem i32 %4, %8
%10 = sitofp i32 %9 to double
store double %10, double* %3
%11 = load double, double* %3
ret double %11
}

LLVM IR (-O2):
define double @rand_wrapper(double* nocapture %0) {
%2 = tail call i32 (...) @rand()
%3 = load double, double* %0
%4 = fptosi double %3 to i32
%5 = srem i32 %2, %4
%6 = sitofp i32 %5 to double
ret double %6
}
float affine(float inMin, float val, float inMax, float outMin, float outMax) {
  return (((val - inMin) / (inMax - inMin)) * (outMax - outMin)) + outMin;
}


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

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

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

LLVM IR (-O2):
define float @affine(float %0, float %1, float %2, float %3, float %4) {
%6 = fsub float %1, %0
%7 = fsub float %2, %0
%8 = fdiv float %6, %7
%9 = fsub float %4, %3
%10 = tail call float @llvm.fmuladd.f32(float %8, float %9, float %3)
ret float %10
}
unsigned int _unpack_word(unsigned char *buf) {
  return ((unsigned int)buf[0]) | ((unsigned int)buf[1] << 8) |
         ((unsigned int)buf[2] << 16) | ((unsigned int)buf[3] << 24);
}


x86 assembly (clang, -O0):
<_unpack_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_unpack_word(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Type definitions */
struct can_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cdrv_free(struct can_dev *);
void free_devstruct(struct can_dev *chip) {
  if (chip)
    cdrv_free(chip);
  return;
}


x86 assembly (clang, -O0):
<free_devstruct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <free_devstruct+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <cdrv_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_devstruct>:
test   %rdi,%rdi
je     111a <free_devstruct+0xa>
jmp    1030 <cdrv_free@plt>
ret

LLVM IR (-O0):
%struct.can_dev = type { i32 }
define void @free_devstruct(%struct.can_dev* %0) {
%2 = alloca %struct.can_dev*
store %struct.can_dev* %0, %struct.can_dev** %2
%3 = load %struct.can_dev*, %struct.can_dev** %2
%4 = icmp ne %struct.can_dev* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.can_dev*, %struct.can_dev** %2
%7 = call i32 @cdrv_free(%struct.can_dev* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.can_dev = type { i32 }
define void @free_devstruct(%struct.can_dev* %0) {
%2 = icmp eq %struct.can_dev* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cdrv_free(%struct.can_dev* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kprint(char *);
void empty_command(char *arg) {
  kprint("Im sorry, I don't know what you mean.\n");
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"Im sorry, I don't know what you mean.\0A\00"
define void @empty_command(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @kprint(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Im sorry, I don't know what you mean.\0A\00"
define void @empty_command(i8* nocapture readnone %0) {
%2 = tail call i32 @kprint(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ fmax(double, double);
long double fmaxl(long double x, long double y) {
  return (long double)fmax((double)x, (double)y);
}


x86 assembly (clang, -O0):
<fmaxl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
fldt   -0x20(%rbp)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
call   1030 <fmax@plt>
mov    %rax,-0x28(%rbp)
fildll -0x28(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmaxl>:
sub    $0x18,%rsp
fldt   0x30(%rsp)
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
fstpl  (%rsp)
movsd  (%rsp),%xmm1
call   1030 <fmax@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @fmaxl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = fptrunc x86_fp80 %5 to double
%7 = load x86_fp80, x86_fp80* %4
%8 = fptrunc x86_fp80 %7 to double
%9 = call i64 @fmax(double %6, double %8)
%10 = sitofp i64 %9 to x86_fp80
ret x86_fp80 %10
}

LLVM IR (-O2):
define x86_fp80 @fmaxl(x86_fp80 %0, x86_fp80 %1) {
%3 = fptrunc x86_fp80 %0 to double
%4 = fptrunc x86_fp80 %1 to double
%5 = tail call i64 @fmax(double %3, double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}
/* Variables and functions */
unsigned int strtoul(char const *, int /*<<< orphan*/ *, int);
unsigned int atoh(const char *s) { return (strtoul(s, NULL, 16)); }


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

x86 assembly (clang, -O2):
<atoh>:
xor    %esi,%esi
mov    $0x10,%edx
jmp    1030 <strtoul@plt>

LLVM IR (-O0):
define i32 @atoh(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strtoul(i8* %3, i32* null, i32 16)
ret i32 %4
}

LLVM IR (-O2):
define i32 @atoh(i8* nocapture %0) {
%2 = tail call i32 @strtoul(i8* nocapture %0, i32* null, i32 16)
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ rbearing;
};
struct TYPE_4__ {
  TYPE_1__ max_bounds;
};
typedef TYPE_2__ XFontStruct;

/* Variables and functions */
short get_XFontStruct_max_bounds_rbearing(void *_p) {
  return (short)((XFontStruct *)_p)->max_bounds.rbearing;
}


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

x86 assembly (clang, -O2):
<get_XFontStruct_max_bounds_rbearing>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define signext i16 @get_XFontStruct_max_bounds_rbearing(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i16
ret i16 %8
}

LLVM IR (-O2):
define signext i16 @get_XFontStruct_max_bounds_rbearing(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}
/* Variables and functions */
int circlemod2();
int circlemod1(void) { return circlemod2(); }


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

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

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

LLVM IR (-O2):
define i32 @circlemod1() {
%1 = tail call i32 (...) @circlemod2()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char a, b;
  scanf("%c", &a);
  b = 'z' - (a - 'a');
  printf("%c", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%ecx
sub    $0x61,%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
mov    %al,-0x6(%rbp)
lea    0xea9(%rip),%rdi
movsbl -0x6(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    $0xdb,%al
sub    0xf(%rsp),%al
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sub i8 -37, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ls1c_spi_clear(void *);
int /*<<< orphan*/ ls1c_spi_wait_txrx_done(void *);
unsigned char reg_read_8(void *);
int /*<<< orphan*/ reg_write_8(unsigned char, void *);
unsigned char ls1c_spi_txrx_byte(void *spi_base, unsigned char tx_ch) {
  unsigned char rx_ch = 0;
  reg_write_8(tx_ch, spi_base + (2));
  ls1c_spi_wait_txrx_done(spi_base);
  rx_ch = reg_read_8(spi_base + (2));
  ls1c_spi_clear(spi_base);
  return rx_ch;
}


x86 assembly (clang, -O0):
<ls1c_spi_txrx_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movb   $0x0,-0xa(%rbp)
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rsi
add    $0x2,%rsi
movzbl %al,%edi
call   1060 <reg_write_8@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ls1c_spi_wait_txrx_done@plt>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1050 <reg_read_8@plt>
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ls1c_spi_clear@plt>
movzbl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls1c_spi_txrx_byte>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0x2(%rdi),%r14
mov    %esi,%edi
mov    %r14,%rsi
call   1060 <reg_write_8@plt>
mov    %rbx,%rdi
call   1030 <ls1c_spi_wait_txrx_done@plt>
mov    %r14,%rdi
call   1050 <reg_read_8@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <ls1c_spi_clear@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @ls1c_spi_txrx_byte(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
store i8 0, i8* %5
%6 = load i8, i8* %4
%7 = load i8*, i8** %3
%8 = getelementptr i8, i8* %7, i64 2
%9 = call i32 @reg_write_8(i8 zeroext %6, i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @ls1c_spi_wait_txrx_done(i8* %10)
%12 = load i8*, i8** %3
%13 = getelementptr i8, i8* %12, i64 2
%14 = call zeroext i8 @reg_read_8(i8* %13)
store i8 %14, i8* %5
%15 = load i8*, i8** %3
%16 = call i32 @ls1c_spi_clear(i8* %15)
%17 = load i8, i8* %5
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @ls1c_spi_txrx_byte(i8* %0, i8 zeroext %1) {
%3 = getelementptr i8, i8* %0, i64 2
%4 = tail call i32 @reg_write_8(i8 zeroext %1, i8* %3)
%5 = tail call i32 @ls1c_spi_wait_txrx_done(i8* %0)
%6 = tail call zeroext i8 @reg_read_8(i8* %3)
%7 = tail call i32 @ls1c_spi_clear(i8* %0)
ret i8 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ *foo(int /*<<< orphan*/ *);
int bar(uint64_t *x) { return (foo(x) == x); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <foo@plt>
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
mov    %rdi,%rbx
call   1030 <foo@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bar(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32* @foo(i32* %3)
%5 = load i32*, i32** %2
%6 = icmp eq i32* %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @bar(i32* %0) {
%2 = tail call i32* @foo(i32* %0)
%3 = icmp eq i32* %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ recv(int, void *, size_t, int /*<<< orphan*/);
ssize_t _tcpc_rx_handler(int sock, void *buf, size_t len) {
  return recv(sock, buf, len, 0);
}


x86 assembly (clang, -O0):
<_tcpc_rx_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_tcpc_rx_handler(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i64 %2, i32 0)
ret i32 %4
}
int fun772() { return 772; }


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

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

LLVM IR (-O0):
define i32 @fun772() {
ret i32 772
}

LLVM IR (-O2):
define i32 @fun772() {
ret i32 772
}
void fsp(short *s) {}


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

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

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

LLVM IR (-O2):
define void @fsp(i16* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep_us(int);
void long_delay(void) { sleep_us(500000); }


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

x86 assembly (clang, -O2):
<long_delay>:
mov    $0x7a120,%edi
jmp    1030 <sleep_us@plt>

LLVM IR (-O0):
define void @long_delay() {
%1 = call i32 @sleep_us(i32 500000)
ret void
}

LLVM IR (-O2):
define void @long_delay() {
%1 = tail call i32 @sleep_us(i32 500000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clrtoeol();
int /*<<< orphan*/ move(int, int /*<<< orphan*/);
int /*<<< orphan*/ printw(char *, char const *);
int /*<<< orphan*/ refresh();
void prompt(int n, char *f, const char *s) {
  (void)move(21 + n, 0);
  (void)clrtoeol();
  (void)printw(f, s);
  (void)refresh();
}


x86 assembly (clang, -O0):
<prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
add    $0x15,%edi
xor    %esi,%esi
call   1060 <move@plt>
mov    $0x0,%al
call   1050 <clrtoeol@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <printw@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
add    $0x15,%edi
xor    %esi,%esi
call   1060 <move@plt>
xor    %eax,%eax
call   1050 <clrtoeol@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printw@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <refresh@plt>

LLVM IR (-O0):
define void @prompt(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
%7 = load i32, i32* %4
%8 = add nsw i32 21, %7
%9 = call i32 @move(i32 %8, i32 0)
%10 = call i32 (...) @clrtoeol()
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = call i32 @printw(i8* %11, i8* %12)
%14 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
define void @prompt(i32 %0, i8* %1, i8* %2) {
%4 = add nsw i32 %0, 21
%5 = tail call i32 @move(i32 %4, i32 0)
%6 = tail call i32 (...) @clrtoeol()
%7 = tail call i32 @printw(i8* %1, i8* %2)
%8 = tail call i32 (...) @refresh()
ret void
}