xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test(int);
int main() {
  test(0xFFFFFFFF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 -1)
ret i32 0
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int dummy;
};

/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, struct timeval *, struct timezone *);
int shim_gettimeofday(struct timeval *tv, struct timezone *tz) {
  return (int)shim_enosys(0, tv, tz);
}


x86 assembly (clang, -O0):
<shim_gettimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_gettimeofday>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define i32 @shim_gettimeofday(%struct.timeval* %0, %struct.timezone* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timezone*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timezone* %1, %struct.timezone** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = load %struct.timezone*, %struct.timezone** %4
%7 = call i64 @shim_enosys(i32 0, %struct.timeval* %5, %struct.timezone* %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define i32 @shim_gettimeofday(%struct.timeval* %0, %struct.timezone* %1) {
%3 = tail call i64 @shim_enosys(i32 0, %struct.timeval* %0, %struct.timezone* %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int S(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ w();
U() {
  w();
  return S(0, 0);
}


x86 assembly (clang, -O0):
<U>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <w@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <S@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<U>:
push   %rax
xor    %eax,%eax
call   1040 <w@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <S@plt>

LLVM IR (-O0):
define i32 @U() {
%1 = call i32 (...) @w()
%2 = call i32 @S(i32 0, i32 0)
ret i32 %2
}

LLVM IR (-O2):
define i32 @U() {
%1 = tail call i32 (...) @w()
%2 = tail call i32 @S(i32 0, i32 0)
ret i32 %2
}
void execute_function(void (*function)(void *), void *context) {
  function(context);
}


x86 assembly (clang, -O0):
<execute_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute_function>:
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax

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

LLVM IR (-O2):
define void @execute_function(void (i8*)* nocapture %0, i8* %1) {
tail call void %0(i8* %1)
ret void
}
int sumDivisbleBy(int k, int limit) {
  int N = limit / k;
  return k * (N * (N + 1) / 2);
}


x86 assembly (clang, -O0):
<sumDivisbleBy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumDivisbleBy>:
mov    %esi,%eax
cltd
idiv   %edi
lea    0x1(%rax),%ecx
imul   %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
sar    %eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @sumDivisbleBy(i32 %0, i32 %1) {
%3 = sdiv i32 %1, %0
%4 = add nsw i32 %3, 1
%5 = mul nsw i32 %4, %3
%6 = sdiv i32 %5, 2
%7 = mul nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void so_fini3() {
  printf("so_fini3"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"so_fini3\00"
define void @so_fini3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
void test_100(unsigned short *x, unsigned int *y) { y[0] = x[1] >> 1; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl 0x2(%rax),%ecx
sar    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
movzwl 0x2(%rdi),%eax
shr    %eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @test_100(i16* %0, i32* %1) {
%3 = alloca i16*
%4 = alloca i32*
store i16* %0, i16** %3
store i32* %1, i32** %4
%5 = load i16*, i16** %3
%6 = getelementptr inbounds i16, i16* %5, i64 1
%7 = load i16, i16* %6
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 1
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @test_100(i16* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i16, i16* %0, i64 1
%4 = load i16, i16* %3
%5 = lshr i16 %4, 1
%6 = zext i16 %5 to i32
store i32 %6, i32* %1
ret void
}
char *FmtString(fmt, a, b, c)
char *fmt, *a, *b, *c;
{
  static char strBuf[1024];
  sprintf(strBuf, fmt, a, b, c);
  return strBuf;
}


x86 assembly (clang, -O0):
<FmtString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0x2f01(%rip),%rdi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    0x2ef3(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FmtString>:
push   %rbx
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0x2f1c(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@FmtString.strBuf = internal global [1024 x i8] zeroinitializer
define i8* @FmtString(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @FmtString.strBuf, i64 0, i64 0), i8* %9, i8* %10, i8* %11, i8* %12)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @FmtString.strBuf, i64 0, i64 0)
}

LLVM IR (-O2):
@FmtString.strBuf = internal global [1024 x i8] zeroinitializer
define i8* @FmtString(i8* nocapture %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([1024 x i8], [1024 x i8]* @FmtString.strBuf, i64 0, i64 0), i8* dereferenceable(1) %0, i8* %1, i8* %2, i8* %3)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @FmtString.strBuf, i64 0, i64 0)
}
__attribute__((no)) void *bar() { return (void *)0; }


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

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

LLVM IR (-O0):
define i8* @bar() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @bar() {
ret i8* null
}
/* Variables and functions */
int writeint(int);
int writemend();
int writemsg(int);
int writemint(int msg, int i) {
  int x;
  x = writemsg(msg);
  if (x == (1))
    x = writeint(i);
  if (x == (1))
    x = writemend();
  return (x);
}


x86 assembly (clang, -O0):
<writemint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <writemsg@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    115e <writemint+0x2e>
mov    -0x8(%rbp),%edi
call   1030 <writeint@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1172 <writemint+0x42>
mov    $0x0,%al
call   1040 <writemend@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writemint>:
push   %rbx
mov    %esi,%ebx
call   1050 <writemsg@plt>
cmp    $0x1,%eax
jne    1151 <writemint+0x21>
mov    %ebx,%edi
call   1030 <writeint@plt>
cmp    $0x1,%eax
jne    1151 <writemint+0x21>
xor    %eax,%eax
pop    %rbx
jmp    1040 <writemend@plt>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @writemint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @writemsg(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i32 @writeint(i32 %11)
store i32 %12, i32* %5
br label %13
13: ; preds = %10, %2
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 (...) @writemend()
store i32 %17, i32* %5
br label %18
18: ; preds = %16, %13
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @writemint(i32 %0, i32 %1) {
%3 = tail call i32 @writemsg(i32 %0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 @writeint(i32 %1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 (...) @writemend()
br label %10
10: ; preds = %2, %8, %5
%11 = phi i32 [ %9, %8 ], [ %6, %5 ], [ %3, %2 ]
ret i32 %11
}
int main() {
  int a, b;
  scanf("%d %d", &a, &b), f(&a, &b), printf("%d %d", a, b);
}


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

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%r14
lea    0xc(%rsp),%rbx
lea    0x8(%rsp),%r15
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <f@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%4 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @f to i32 (i32*, i32*, ...)*)(i32* %1, i32* %2)
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @f to i32 (i32*, i32*, ...)*)(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
int test_imm_1Cuint8_mem(unsigned char *val) {
  return ((*val) & (-0x1C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Cuint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffffe4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Cuint8_mem>:
testb  $0xe4,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Cuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -28
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_caption() {
  printf("\n%%CPU\twork quantum\tsleep quantum\tactive rate\n");
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"\0A%%CPU\09work quantum\09sleep quantum\09active rate\0A\00"
define void @print_caption() {
%1 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"\0A%%CPU\09work quantum\09sleep quantum\09active rate\0A\00"
define void @print_caption() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ options_get_int(char const *);
int /*<<< orphan*/ send_int_to_srv(int);
int /*<<< orphan*/ send_str_to_srv(char const *);
int /*<<< orphan*/ sync_int_option(char const *);
void toggle_option(const char *name) {
  send_int_to_srv(0x07);
  send_str_to_srv(name);
  send_int_to_srv(!options_get_int(name));
  sync_int_option(name);
}


x86 assembly (clang, -O0):
<toggle_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x7,%edi
call   1030 <send_int_to_srv@plt>
mov    -0x8(%rbp),%rdi
call   1060 <send_str_to_srv@plt>
mov    -0x8(%rbp),%rdi
call   1040 <options_get_int@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <send_int_to_srv@plt>
mov    -0x8(%rbp),%rdi
call   1050 <sync_int_option@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toggle_option>:
push   %rbx
mov    %rdi,%rbx
mov    $0x7,%edi
call   1030 <send_int_to_srv@plt>
mov    %rbx,%rdi
call   1060 <send_str_to_srv@plt>
mov    %rbx,%rdi
call   1040 <options_get_int@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <send_int_to_srv@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <sync_int_option@plt>

LLVM IR (-O0):
define void @toggle_option(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @send_int_to_srv(i32 7)
%4 = load i8*, i8** %2
%5 = call i32 @send_str_to_srv(i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @options_get_int(i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = call i32 @send_int_to_srv(i32 %10)
%12 = load i8*, i8** %2
%13 = call i32 @sync_int_option(i8* %12)
ret void
}

LLVM IR (-O2):
define void @toggle_option(i8* %0) {
%2 = tail call i32 @send_int_to_srv(i32 7)
%3 = tail call i32 @send_str_to_srv(i8* %0)
%4 = tail call i32 @options_get_int(i8* %0)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @send_int_to_srv(i32 %6)
%8 = tail call i32 @sync_int_option(i8* %0)
ret void
}
/* Variables and functions */
int core3_swap(char *, int);
int U_EMRSETTEXTALIGN_swap(char *record, int torev) {
  return (core3_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRSETTEXTALIGN_swap>:
jmp    1030 <core3_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRSETTEXTALIGN_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core3_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int _hex_to_int(char *);
int convert_to_min(char *data) { return _hex_to_int(data) / 60; }


x86 assembly (clang, -O0):
<convert_to_min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_hex_to_int@plt>
mov    $0x3c,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_to_min>:
push   %rax
call   1030 <_hex_to_int@plt>
cltq
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x5,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @convert_to_min(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @_hex_to_int(i8* %3)
%5 = sdiv i32 %4, 60
ret i32 %5
}

LLVM IR (-O2):
define i32 @convert_to_min(i8* %0) {
%2 = tail call i32 @_hex_to_int(i8* %0)
%3 = sdiv i32 %2, 60
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ echo(char *);
main() {
  echo(""
       "banana"
       "na"
       "nana");
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"bananananana\00"
define i32 @main() {
%1 = call i32 @echo(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"bananananana\00"
define i32 @main() {
%1 = tail call i32 @echo(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *);
int main() {
  double horas, KM;
  scanf(" %lf %lf", &horas, &KM);
  printf("%0.3lf\n", (horas * KM) / 12);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xeab(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xedd(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
divsd  0xeb2(%rip),%xmm0
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c" %lf %lf\00"
@.str.1 = [8 x i8] c"%0.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double* %2, double* %3)
%5 = load double, double* %2
%6 = load double, double* %3
%7 = fmul double %5, %6
%8 = fdiv double %7, 1.200000e+01
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c" %lf %lf\00"
@.str.1 = [8 x i8] c"%0.3lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%6 = load double, double* %1
%7 = load double, double* %2
%8 = fmul double %6, %7
%9 = fdiv double %8, 1.200000e+01
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %9)
ret i32 0
}
/* Type definitions */
union bpf_attr {
  int bpf_fd;
  int /*<<< orphan*/ pathname;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_OBJ_PIN;
int /*<<< orphan*/ ptr_to_u64(void *);
int syscall(int, int /*<<< orphan*/, union bpf_attr *, int);
int bpf_obj_pin(int fd, const char *pathname) {
  union bpf_attr attr;
  attr.pathname = ptr_to_u64((void *)pathname);
  attr.bpf_fd = fd;
  return syscall(321, BPF_OBJ_PIN, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_obj_pin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ptr_to_u64@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
mov    $0x141,%edi
lea    -0x18(%rbp),%rdx
mov    $0x4,%ecx
call   1040 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_obj_pin>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %rsi,%rdi
call   1030 <ptr_to_u64@plt>
mov    %ebx,0x8(%rsp)
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
mov    $0x141,%edi
mov    $0x4,%ecx
call   1040 <syscall@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_OBJ_PIN = global i32 0
define i32 @bpf_obj_pin(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %union.bpf_attr
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @ptr_to_u64(i8* %6)
%8 = bitcast %union.bpf_attr* %5 to i32*
store i32 %7, i32* %8
%9 = load i32, i32* %3
%10 = bitcast %union.bpf_attr* %5 to i32*
store i32 %9, i32* %10
%11 = load i32, i32* @BPF_OBJ_PIN
%12 = call i32 @syscall(i32 321, i32 %11, %union.bpf_attr* %5, i32 4)
ret i32 %12
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_OBJ_PIN = global i32 0
define i32 @bpf_obj_pin(i32 %0, i8* %1) {
%3 = alloca %union.bpf_attr
%4 = bitcast %union.bpf_attr* %3 to i8*
%5 = tail call i32 @ptr_to_u64(i8* %1)
%6 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %3, i64 0, i32 0
store i32 %0, i32* %6
%7 = load i32, i32* @BPF_OBJ_PIN
%8 = call i32 @syscall(i32 321, i32 %7, %union.bpf_attr* %3, i32 4)
ret i32 %8
}
void av_div_q() {}


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

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

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

LLVM IR (-O2):
define void @av_div_q() {
ret void
}
/* Variables and functions */
int prompt_error_msg_internal(char const *, char const *, int);
int prompt_error_msg(const char title[], const char message[]) {
  return prompt_error_msg_internal(title, message, 1);
}


x86 assembly (clang, -O0):
<prompt_error_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <prompt_error_msg_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt_error_msg>:
mov    $0x1,%edx
jmp    1030 <prompt_error_msg_internal@plt>

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

LLVM IR (-O2):
define i32 @prompt_error_msg(i8* %0, i8* %1) {
%3 = tail call i32 @prompt_error_msg_internal(i8* %0, i8* %1, i32 1)
ret i32 %3
}
long power(int iBase, int iPow) {
  int i = 0;
  long lProduct = 1;
  for (i = 1; i <= iPow; i++) {
    lProduct = lProduct * iBase;
  }
  return lProduct;
}


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

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

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

LLVM IR (-O2):
define i64 @power(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %34, label %4
4: ; preds = %2
%5 = sext i32 %0 to i64
%6 = add i32 %1, -1
%7 = and i32 %1, 7
%8 = icmp ult i32 %6, 7
br i1 %8, label %24, label %9
9: ; preds = %4
%10 = and i32 %1, -8
br label %11
11: ; preds = %11, %9
%12 = phi i64 [ 1, %9 ], [ %21, %11 ]
%13 = phi i32 [ 0, %9 ], [ %22, %11 ]
%14 = mul nsw i64 %12, %5
%15 = mul nsw i64 %14, %5
%16 = mul nsw i64 %15, %5
%17 = mul nsw i64 %16, %5
%18 = mul nsw i64 %17, %5
%19 = mul nsw i64 %18, %5
%20 = mul nsw i64 %19, %5
%21 = mul nsw i64 %20, %5
%22 = add i32 %13, 8
%23 = icmp eq i32 %22, %10
br i1 %23, label %24, label %11
24: ; preds = %11, %4
%25 = phi i64 [ undef, %4 ], [ %21, %11 ]
%26 = phi i64 [ 1, %4 ], [ %21, %11 ]
%27 = icmp eq i32 %7, 0
br i1 %27, label %34, label %28
28: ; preds = %24, %28
%29 = phi i64 [ %31, %28 ], [ %26, %24 ]
%30 = phi i32 [ %32, %28 ], [ 0, %24 ]
%31 = mul nsw i64 %29, %5
%32 = add i32 %30, 1
%33 = icmp eq i32 %32, %7
br i1 %33, label %34, label %28
34: ; preds = %24, %28, %2
%35 = phi i64 [ 1, %2 ], [ %25, %24 ], [ %31, %28 ]
ret i64 %35
}
int hash(name)
register char *name;
{
  register unsigned long h = 0;
  while (*name)
    h = (h << 5) + h + *name++;
  return (h % 199);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <hash+0x48>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash+0x10>
mov    -0x10(%rbp),%rax
mov    $0xc7,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%al
test   %al,%al
je     1157 <hash+0x57>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %rcx,%rdx
shl    $0x5,%rdx
add    %rcx,%rdx
movsbq %al,%rcx
add    %rdx,%rcx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash+0x10>
movabs $0x49539e3b2d066ea3,%rdx
9e 53 49
mov    %rcx,%rax
mul    %rdx
mov    %rcx,%rax
sub    %rdx,%rax
shr    %rax
add    %rdx,%rax
shr    $0x7,%rax
imul   $0xc7,%eax,%eax
sub    %eax,%ecx
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @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 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i64 %6, 33
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i64
%11 = add i64 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i64 %11, 199
%16 = trunc i64 %15 to i32
br label %17
17: ; preds = %14, %1
%18 = phi i32 [ 0, %1 ], [ %16, %14 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printBonjour();
int /*<<< orphan*/ printHelloWorld();
int /*<<< orphan*/ printKonichiwa();
int /*<<< orphan*/ printNiHao();
int main(int argc, char const *argv[]) {
  printHelloWorld();
  printNiHao();
  printKonichiwa();
  printBonjour();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <printHelloWorld@plt>
mov    $0x0,%al
call   1030 <printNiHao@plt>
mov    $0x0,%al
call   1050 <printKonichiwa@plt>
mov    $0x0,%al
call   1060 <printBonjour@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <printHelloWorld@plt>
xor    %eax,%eax
call   1030 <printNiHao@plt>
xor    %eax,%eax
call   1050 <printKonichiwa@plt>
xor    %eax,%eax
call   1060 <printBonjour@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @printHelloWorld()
%7 = call i32 (...) @printNiHao()
%8 = call i32 (...) @printKonichiwa()
%9 = call i32 (...) @printBonjour()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @printHelloWorld()
%4 = tail call i32 (...) @printNiHao()
%5 = tail call i32 (...) @printKonichiwa()
%6 = tail call i32 (...) @printBonjour()
ret i32 0
}
int foo(int x) { return (x & 0x123) << -3; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x123,%eax
mov    $0xfffffffd,%ecx
shl    %cl,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 291
%5 = shl i32 %4, -3
ret i32 %5
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 poison
}
void *tchk_noderefchook_copy(void *hook) { return hook; }


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

x86 assembly (clang, -O2):
<tchk_noderefchook_copy>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @tchk_noderefchook_copy(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
unsigned char VIM_USER_StartTimer(unsigned long);
unsigned char Avi_StartTimer(unsigned long Intervel) {
  unsigned char result = 0;
  result = VIM_USER_StartTimer(Intervel);
  return result;
}


x86 assembly (clang, -O0):
<Avi_StartTimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <VIM_USER_StartTimer@plt>
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Avi_StartTimer>:
jmp    1030 <VIM_USER_StartTimer@plt>

LLVM IR (-O0):
define zeroext i8 @Avi_StartTimer(i64 %0) {
%2 = alloca i64
%3 = alloca i8
store i64 %0, i64* %2
store i8 0, i8* %3
%4 = load i64, i64* %2
%5 = call zeroext i8 @VIM_USER_StartTimer(i64 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @Avi_StartTimer(i64 %0) {
%2 = tail call zeroext i8 @VIM_USER_StartTimer(i64 %0)
ret i8 %2
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR45_get(void) { return U_WMRCORENONE_get("U_WMR45"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR45\00"
define i32 @U_WMR45_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR45\00"
define i32 @U_WMR45_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void tintl_free(void *data) {
  if (data == NULL)
    return;
  const size_t offset = ((size_t *)data)[-1];
  free((char *)data - offset);
}


x86 assembly (clang, -O0):
<tintl_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <tintl_free+0x1c>
jmp    114a <tintl_free+0x3a>
mov    -0x8(%rbp),%rax
mov    -0x8(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
sub    -0x10(%rbp),%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tintl_free>:
test   %rdi,%rdi
je     111e <tintl_free+0xe>
sub    -0x8(%rdi),%rdi
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @tintl_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -8
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
%7 = sub i64 0, %6
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = tail call i32 @free(i8* %8)
br label %10
10: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ w5100_socket_cmd(unsigned int, int);
int /*<<< orphan*/ w5100_writeSnIR(unsigned int, int);
void socket_close(unsigned sock) {
  w5100_socket_cmd(sock, 0x10);
  w5100_writeSnIR(sock, 0xFF);
}


x86 assembly (clang, -O0):
<socket_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x10,%esi
call   1030 <w5100_socket_cmd@plt>
mov    -0x4(%rbp),%edi
mov    $0xff,%esi
call   1040 <w5100_writeSnIR@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_close>:
push   %rbx
mov    %edi,%ebx
mov    $0x10,%esi
call   1030 <w5100_socket_cmd@plt>
mov    %ebx,%edi
mov    $0xff,%esi
pop    %rbx
jmp    1040 <w5100_writeSnIR@plt>

LLVM IR (-O0):
define void @socket_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @w5100_socket_cmd(i32 %3, i32 16)
%5 = load i32, i32* %2
%6 = call i32 @w5100_writeSnIR(i32 %5, i32 255)
ret void
}

LLVM IR (-O2):
define void @socket_close(i32 %0) {
%2 = tail call i32 @w5100_socket_cmd(i32 %0, i32 16)
%3 = tail call i32 @w5100_writeSnIR(i32 %0, i32 255)
ret void
}
int test_imm_DFint16_reg(short val) {
  return ((val) & (0xDF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DFint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xdf,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DFint16_reg>:
test   $0xdf,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_DFint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 223
%6 = icmp ne i32 %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_DFint16_reg(i16 signext %0) {
%2 = and i16 %0, 223
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int drand48();
void get_bin_randoms(int *numbers2, int upper) {
  int i, where;
  for (i = -1; i < upper; i++) {
    where = 100 * drand48();
    ;
    numbers2[i] = where % 2;
  }
}


x86 assembly (clang, -O0):
<get_bin_randoms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1163 <get_bin_randoms+0x53>
mov    $0x0,%al
call   1030 <drand48@plt>
imul   $0x64,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <get_bin_randoms+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bin_randoms>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
js     1148 <get_bin_randoms+0x38>
mov    %rdi,%r14
mov    %esi,%r15d
mov    $0xffffffffffffffff,%rbx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <drand48@plt>
movl   $0x0,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <get_bin_randoms+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @get_bin_randoms(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 -1, i32* %5
br label %7
7: ; preds = %20, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = call i32 (...) @drand48()
%13 = mul nsw i32 100, %12
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = srem i32 %14, 2
%16 = load i32*, i32** %3
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
store i32 %15, i32* %19
br label %20
20: ; preds = %11
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %7
23: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @get_bin_randoms(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ -1, %4 ], [ %10, %6 ]
%8 = tail call i32 (...) @drand48()
%9 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 0, i32* %9
%10 = add nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int int64_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ INT32_MAX;
scalar_t__ INT32_MIN;
scalar_t__ __stdfix_sat_k(int);
int32_t __stdfix_smul_k(int32_t x, int32_t y) {
  if (x == INT32_MIN && y == INT32_MIN)
    return (INT32_MAX);
  return (__stdfix_sat_k(((int64_t)x * (int64_t)y) >> 15));
}


x86 assembly (clang, -O0):
<__stdfix_smul_k>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ead(%rip),%rcx
cmp    (%rcx),%rax
jne    115b <__stdfix_smul_k+0x4b>
mov    -0x18(%rbp),%rax
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%rax
jne    115b <__stdfix_smul_k+0x4b>
mov    0x2e91(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <__stdfix_smul_k+0x64>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
mov    -0x18(%rbp),%rax
imul   %eax,%edi
sar    $0xf,%edi
call   1030 <__stdfix_sat_k@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stdfix_smul_k>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%rax
cmp    %rdi,%rax
jne    112f <__stdfix_smul_k+0x1f>
cmp    %rsi,%rax
jne    112f <__stdfix_smul_k+0x1f>
mov    0x2eb5(%rip),%rax
mov    (%rax),%rax
ret
imul   %edi,%esi
sar    $0xf,%esi
mov    %esi,%edi
jmp    1030 <__stdfix_sat_k@plt>

LLVM IR (-O0):
@INT32_MIN = global i64 0
@INT32_MAX = global i64 0
define i64 @__stdfix_smul_k(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* @INT32_MIN
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i64, i64* %5
%11 = load i64, i64* @INT32_MIN
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i64, i64* @INT32_MAX
store i64 %14, i64* %3
br label %23
15: ; preds = %9, %2
%16 = load i64, i64* %4
%17 = trunc i64 %16 to i32
%18 = load i64, i64* %5
%19 = trunc i64 %18 to i32
%20 = mul nsw i32 %17, %19
%21 = ashr i32 %20, 15
%22 = call i64 @__stdfix_sat_k(i32 %21)
store i64 %22, i64* %3
br label %23
23: ; preds = %15, %13
%24 = load i64, i64* %3
ret i64 %24
}

LLVM IR (-O2):
@INT32_MIN = global i64 0
@INT32_MAX = global i64 0
define i64 @__stdfix_smul_k(i64 %0, i64 %1) {
%3 = load i64, i64* @INT32_MIN
%4 = icmp eq i64 %3, %0
%5 = icmp eq i64 %3, %1
%6 = and i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i64, i64* @INT32_MAX
br label %15
9: ; preds = %2
%10 = trunc i64 %0 to i32
%11 = trunc i64 %1 to i32
%12 = mul nsw i32 %11, %10
%13 = ashr i32 %12, 15
%14 = tail call i64 @__stdfix_sat_k(i32 %13)
br label %15
15: ; preds = %9, %7
%16 = phi i64 [ %8, %7 ], [ %14, %9 ]
ret i64 %16
}
unsigned int modulo_dec(const unsigned int value, const unsigned int modulus) {
  return (0 == value) ? (modulus - 1) : (value - 1);
}


x86 assembly (clang, -O0):
<modulo_dec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jne    1123 <modulo_dec+0x23>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <modulo_dec+0x2c>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo_dec>:
test   %edi,%edi
cmovne %edi,%esi
lea    -0x1(%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @modulo_dec(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 %1, i32 %0
%5 = add i32 %4, -1
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ print_special(unsigned char const *, char *,
                                 int /*<<< orphan*/ *);
void print_section_name(const unsigned char *s, FILE *out) {
  fputc('[', out);
  print_special(s, "\"[] \f\n\r\t\v", out);
  fputs("]\n", out);
}


x86 assembly (clang, -O0):
<print_section_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x5b,%edi
call   1040 <fputc@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xea3(%rip),%rsi
call   1050 <print_special@plt>
mov    -0x10(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_section_name>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    $0x5b,%edi
call   1030 <fputc@plt>
lea    0xeb5(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1040 <print_special@plt>
lea    0xead(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <fwrite@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\22[] \0C\0A\0D\09\0B\00"
@.str.1 = [3 x i8] c"]\0A\00"
define void @print_section_name(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call i32 @fputc(i8 signext 91, i32* %5)
%7 = load i8*, i8** %3
%8 = load i32*, i32** %4
%9 = call i32 @print_special(i8* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %8)
%10 = load i32*, i32** %4
%11 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"\22[] \0C\0A\0D\09\0B\00"
@.str.1 = [3 x i8] c"]\0A\00"
define void @print_section_name(i8* %0, i32* %1) {
%3 = tail call i32 @fputc(i8 signext 91, i32* %1)
%4 = tail call i32 @print_special(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64 2, i64 1, i32* %1)
ret void
}
/* Variables and functions */
float sqrtf(float);
float xsqrtf(float f) { return sqrtf(f); }


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

x86 assembly (clang, -O2):
<xsqrtf>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111d <xsqrtf+0xd>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @xsqrtf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sqrtf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @xsqrtf(float %0) {
%2 = tail call float @sqrtf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int c_printf(char *msg) {
  printf(msg);
  return 0;
}


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

x86 assembly (clang, -O2):
<c_printf>:
push   %rax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @c_printf(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret i32 0
}