xunge/DecIR huggingface dataset:
void matmul_i4(int bbase_yn, int xcount) {
  int x;
  int *restrict dest_y;
  const int *abase_n;
  for (x = 0; x < xcount; x++) {
    dest_y[x] += abase_n[x] * bbase_yn;
  }
}


x86 assembly (clang, -O0):
<matmul_i4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1148 <matmul_i4+0x48>
mov    -0x20(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
imul   -0x4(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <matmul_i4+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @matmul_i4(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 1
tail call void @llvm.assume(i1 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ normalize_lines(double *, int, int);
void normalize_Q(double *Q, int N, int K) { normalize_lines(Q, N, K); }


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

x86 assembly (clang, -O2):
<normalize_Q>:
jmp    1030 <normalize_lines@plt>

LLVM IR (-O0):
define void @normalize_Q(double* %0, i32 %1, i32 %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
store double* %0, double** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load double*, double** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @normalize_lines(double* %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @normalize_Q(double* %0, i32 %1, i32 %2) {
%4 = tail call i32 @normalize_lines(double* %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ipc_library_init();
int main(int argc, char **argv) {
  ipc_library_init();
  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   1030 <ipc_library_init@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <ipc_library_init@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 (...) @ipc_library_init()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ipc_library_init()
ret i32 0
}
extern double float_id(double x) { return x; }


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

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

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

LLVM IR (-O2):
define double @float_id(double returned %0) {
ret double %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int write(int, int /*<<< orphan*/ *, int);
int serialport_writebyte(int fd, uint8_t b) {
  int n = write(fd, &b, 1);
  if (n != 1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<serialport_writebyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
je     1148 <serialport_writebyte+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <serialport_writebyte+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialport_writebyte>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @serialport_writebyte(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @write(i32 %0, i32* %3, i32 1)
%5 = icmp ne i32 %4, 1
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int factorial(int);
int power(int);
int /*<<< orphan*/ printf(char *, int, int);
int magia(int n) {
  printf("\t\t\tFactorial is %d, power is %d\n", factorial(1), power(2));
  printf("\t\t\tThe factorial is %d, power is %d\n", factorial(3), power(3));
  return factorial(7);
}


x86 assembly (clang, -O0):
<magia>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <factorial@plt>
mov    %eax,-0xc(%rbp)
mov    $0x2,%edi
call   1030 <power@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xea2(%rip),%rdi
call   1050 <printf@plt>
mov    $0x3,%edi
call   1040 <factorial@plt>
mov    %eax,-0x8(%rbp)
mov    $0x3,%edi
call   1030 <power@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe9b(%rip),%rdi
call   1050 <printf@plt>
mov    $0x7,%edi
call   1040 <factorial@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<magia>:
push   %rbx
mov    $0x1,%edi
call   1040 <factorial@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1030 <power@plt>
lea    0xeb2(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1050 <printf@plt>
mov    $0x3,%edi
call   1040 <factorial@plt>
mov    %eax,%ebx
mov    $0x3,%edi
call   1030 <power@plt>
lea    0xead(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1050 <printf@plt>
mov    $0x7,%edi
pop    %rbx
jmp    1040 <factorial@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"\09\09\09Factorial is %d, power is %d\0A\00"
@.str.1 = [37 x i8] c"\09\09\09The factorial is %d, power is %d\0A\00"
define i32 @magia(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @factorial(i32 1)
%4 = call i32 @power(i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = call i32 @factorial(i32 3)
%7 = call i32 @power(i32 3)
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7)
%9 = call i32 @factorial(i32 7)
ret i32 %9
}

LLVM IR (-O2):
@.str = [33 x i8] c"\09\09\09Factorial is %d, power is %d\0A\00"
@.str.1 = [37 x i8] c"\09\09\09The factorial is %d, power is %d\0A\00"
define i32 @magia(i32 %0) {
%2 = tail call i32 @factorial(i32 1)
%3 = tail call i32 @power(i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = tail call i32 @factorial(i32 3)
%6 = tail call i32 @power(i32 3)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
%8 = tail call i32 @factorial(i32 7)
ret i32 %8
}
/* Variables and functions */
int minsym_fun();
int main(void) { return minsym_fun(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @minsym_fun()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void merror(char *s) {
  (void)fprintf(
      stderr,
      "A fatal error has occured: %s.\nCan not continue...\nExiting...\n", s);
  (void)cleanup();
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<merror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <cleanup@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<merror>:
push   %rax
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <cleanup@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [63 x i8] c"A fatal error has occured: %s.\0ACan not continue...\0AExiting...\0A\00"
@EXIT_FAILURE = global i32 0
define void @merror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @cleanup()
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [63 x i8] c"A fatal error has occured: %s.\0ACan not continue...\0AExiting...\0A\00"
@EXIT_FAILURE = global i32 0
define void @merror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @cleanup()
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int dup2(int, int);
int /*<<< orphan*/ unix_error(char *);
int Dup2(int fd1, int fd2) {
  int rc;
  if ((rc = dup2(fd1, fd2)) < 0)
    unix_error("Dup2 error");
  return rc;
}


x86 assembly (clang, -O0):
<Dup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <dup2@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1151 <Dup2+0x31>
lea    0xeb4(%rip),%rdi
call   1040 <unix_error@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dup2>:
push   %rbx
call   1030 <dup2@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Dup2+0x18>
lea    0xecd(%rip),%rdi
call   1040 <unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Dup2 error\00"
define i32 @Dup2(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 = load i32, i32* %4
%8 = call i32 @dup2(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @unix_error(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
@.str = [11 x i8] c"Dup2 error\00"
define i32 @Dup2(i32 %0, i32 %1) {
%3 = tail call i32 @dup2(i32 %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @unix_error(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
int internal_to_upper(int);
int trio_to_upper(int source) { return internal_to_upper(source); }


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

x86 assembly (clang, -O2):
<trio_to_upper>:
jmp    1030 <internal_to_upper@plt>

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

LLVM IR (-O2):
define i32 @trio_to_upper(i32 %0) {
%2 = tail call i32 @internal_to_upper(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int /*<<< orphan*/, int, int);
void C67_INTSPU(int r, int v) { C67_asm("INTSPU.L", 0, r, v); }


x86 assembly (clang, -O0):
<C67_INTSPU>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xed5(%rip),%rdi
xor    %esi,%esi
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_INTSPU>:
mov    %esi,%ecx
mov    %edi,%edx
lea    0xee5(%rip),%rdi
xor    %esi,%esi
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"INTSPU.L\00"
define void @C67_INTSPU(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 = load i32, i32* %4
%7 = call i32 @C67_asm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0, i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"INTSPU.L\00"
define void @C67_INTSPU(i32 %0, i32 %1) {
%3 = tail call i32 @C67_asm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0, i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *get_setting(char *, char *);
long strtol(char *, int /*<<< orphan*/ *, int);
int get_setting_INT(char *filename, char *settingname) {
  char *tempstr = get_setting(filename, settingname);
  if (tempstr == NULL)
    return -1;
  long tempo = strtol(tempstr, NULL, 10);
  free(tempstr);
  return (int)tempo;
}


x86 assembly (clang, -O0):
<get_setting_INT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <get_setting@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1168 <get_setting_INT+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    118e <get_setting_INT+0x5e>
mov    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_setting_INT>:
push   %r14
push   %rbx
push   %rax
call   1040 <get_setting@plt>
test   %rax,%rax
je     115d <get_setting_INT+0x2d>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
jmp    1163 <get_setting_INT+0x33>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @get_setting_INT(i8* %0, i8* %1) {
%3 = tail call i8* @get_setting(i8* %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @strtol(i8* nocapture %3, i32* null, i32 10)
%7 = tail call i32 @free(i8* %3)
%8 = trunc i64 %6 to i32
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ %8, %5 ], [ -1, %2 ]
ret i32 %10
}
/* Type definitions */
struct Position {
  int dummy;
};
struct Jelly {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ remove_proximity_from_list(struct Jelly *,
                                              struct Position *);
void proximity_lost(struct Jelly *jelly, struct Position *position) {
  remove_proximity_from_list(jelly, position);
}


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

x86 assembly (clang, -O2):
<proximity_lost>:
jmp    1030 <remove_proximity_from_list@plt>

LLVM IR (-O0):
%struct.Jelly = type { i32 }
%struct.Position = type { i32 }
define void @proximity_lost(%struct.Jelly* %0, %struct.Position* %1) {
%3 = alloca %struct.Jelly*
%4 = alloca %struct.Position*
store %struct.Jelly* %0, %struct.Jelly** %3
store %struct.Position* %1, %struct.Position** %4
%5 = load %struct.Jelly*, %struct.Jelly** %3
%6 = load %struct.Position*, %struct.Position** %4
%7 = call i32 @remove_proximity_from_list(%struct.Jelly* %5, %struct.Position* %6)
ret void
}

LLVM IR (-O2):
%struct.Jelly = type { i32 }
%struct.Position = type { i32 }
define void @proximity_lost(%struct.Jelly* %0, %struct.Position* %1) {
%3 = tail call i32 @remove_proximity_from_list(%struct.Jelly* %0, %struct.Position* %1)
ret void
}
int IpIsValid(unsigned char *ipadr) {
  int fvalid = 1;
  if (ipadr[0] == 0)
    fvalid = 0;
  return (fvalid);
}


x86 assembly (clang, -O0):
<IpIsValid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
jne    1126 <IpIsValid+0x26>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IpIsValid>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
setne  %al
ret

LLVM IR (-O0):
define i32 @IpIsValid(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 1, i32* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %3
br label %10
10: ; preds = %9, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @IpIsValid(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ne i8 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ asprintf(char **, char *, char const *, int const, char const *);
char *get_logname(const char *source, const int pass, const char *suffix) {
  char *file = NULL;
  if (!source)
    return NULL;
  if (asprintf(&file, "%s.%03d.%s", source, pass, suffix) < 0)
    return NULL;
  return file;
}


x86 assembly (clang, -O0):
<get_logname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <get_logname+0x33>
movq   $0x0,-0x8(%rbp)
jmp    117d <get_logname+0x6d>
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
lea    -0x28(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1030 <asprintf@plt>
cmp    $0x0,%rax
jge    1175 <get_logname+0x65>
movq   $0x0,-0x8(%rbp)
jmp    117d <get_logname+0x6d>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_logname>:
push   %rax
movq   $0x0,(%rsp)
test   %rdi,%rdi
je     1140 <get_logname+0x30>
mov    %rdx,%r8
mov    %esi,%ecx
mov    %rdi,%rdx
lea    0xed3(%rip),%rsi
mov    %rsp,%rdi
call   1030 <asprintf@plt>
test   %rax,%rax
js     1140 <get_logname+0x30>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"%s.%03d.%s\00"
define i8* @get_logname(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
store i8* null, i8** %4
%6 = icmp eq i8* %0, null
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = call i64 @asprintf(i8** %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
%9 = icmp slt i64 %8, 0
%10 = load i8*, i8** %4
%11 = select i1 %9, i8* null, i8* %10
br label %12
12: ; preds = %7, %3
%13 = phi i8* [ null, %3 ], [ %11, %7 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void htmlRecordContext(void) {
  printf("<p><u>Record Context Info</u><br>");
  printf("No context information currently available.");
}


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

x86 assembly (clang, -O2):
<htmlRecordContext>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"<p><u>Record Context Info</u><br>\00"
@.str.1 = [44 x i8] c"No context information currently available.\00"
define void @htmlRecordContext() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"<p><u>Record Context Info</u><br>\00"
@.str.1 = [44 x i8] c"No context information currently available.\00"
define void @htmlRecordContext() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, int, char *, char *);
void STEST904(char *p1, int p2, int p3, char *p4, char *p5) {
  printf("C904:(%3s,%d,%d,%3s,%3s):(XYZ,3,5,XYZ,123):Call modes alternance\n",
         p1, p2, p3, p4, p5);
}


x86 assembly (clang, -O0):
<STEST904>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STEST904>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xedc(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [66 x i8] c"C904:(%3s,%d,%d,%3s,%3s):(XYZ,3,5,XYZ,123):Call modes alternance\0A\00"
define void @STEST904(i8* %0, i32 %1, i32 %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12, i32 %13, i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [66 x i8] c"C904:(%3s,%d,%d,%3s,%3s):(XYZ,3,5,XYZ,123):Call modes alternance\0A\00"
define void @STEST904(i8* %0, i32 %1, i32 %2, i8* %3, i8* %4) {
%6 = tail call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %2, i8* %3, i8* %4)
ret void
}
prs(str) char *str;
{
  if (str && *str)
    write(2, str, strlen(str));
}


x86 assembly (clang, -O0):
<prs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116b <prs+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116b <prs+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
mov    $0x2,%edi
mov    $0x0,%al
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prs>:
push   %rbx
test   %rdi,%rdi
je     1148 <prs+0x28>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1148 <prs+0x28>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <write@plt>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @prs(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i8*, i8** %3
%14 = call i64 @strlen(i8* %13)
%15 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 2, i8* %12, i64 %14)
br label %16
16: ; preds = %11, %6, %1
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @prs(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i64 @strlen(i8* %0)
%8 = tail call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 2, i8* %0, i64 %7)
br label %9
9: ; preds = %6, %3, %1
ret i32 undef
}
/* Variables and functions */
int fork();
int /*<<< orphan*/ proizvodjac(int);
void stvori_proizvodjace() {
  switch (fork()) {
  case 0:
    proizvodjac(2);
    break;
  default:
    proizvodjac(1);
    break;
  }
}


x86 assembly (clang, -O0):
<stvori_proizvodjace>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
call   1040 <fork@plt>
test   %eax,%eax
jne    1147 <stvori_proizvodjace+0x27>
jmp    1138 <stvori_proizvodjace+0x18>
mov    $0x2,%edi
call   1030 <proizvodjac@plt>
jmp    1151 <stvori_proizvodjace+0x31>
mov    $0x1,%edi
call   1030 <proizvodjac@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stvori_proizvodjace>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
cmp    $0x1,%eax
mov    $0x1,%edi
adc    $0x0,%edi
pop    %rax
jmp    1030 <proizvodjac@plt>

LLVM IR (-O0):
define void @stvori_proizvodjace() {
%1 = call i32 (...) @fork()
switch i32 %1, label %4 [
i32 0, label %2
]
2: ; preds = %0
%3 = call i32 @proizvodjac(i32 2)
br label %6
4: ; preds = %0
%5 = call i32 @proizvodjac(i32 1)
br label %6
6: ; preds = %4, %2
ret void
}

LLVM IR (-O2):
define void @stvori_proizvodjace() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i32 2, i32 1
%4 = tail call i32 @proizvodjac(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void INT_Excep_IRQ4(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_IRQ4() {
ret void
}
/* Variables and functions */
float sqrt(double);
float ET_distance(int X) {
  return sqrt(3674186.332167 / (X - 9.384503) + 26294.871673) - 176.997129;
}


x86 assembly (clang, -O0):
<ET_distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xef0(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xedc(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xec8(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
cvtss2sd %xmm0,%xmm0
movsd  0xeab(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ET_distance>:
push   %rax
cvtsi2sd %edi,%xmm1
addsd  0xee3(%rip),%xmm1
movsd  0xee3(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  0xedf(%rip),%xmm0
call   1030 <sqrt@plt>
cvtss2sd %xmm0,%xmm0
addsd  0xed6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ET_distance(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fsub double %4, 0x4022C4DD93C46D83
%6 = fdiv double 0x414C08252A8472C1, %5
%7 = fadd double %6, 0x40D9ADB7C97D8CF4
%8 = call float @sqrt(double %7)
%9 = fpext float %8 to double
%10 = fsub double %9, 0x40661FE87B139C95
%11 = fptrunc double %10 to float
ret float %11
}

LLVM IR (-O2):
define float @ET_distance(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fadd double %2, 0xC022C4DD93C46D83
%4 = fdiv double 0x414C08252A8472C1, %3
%5 = fadd double %4, 0x40D9ADB7C97D8CF4
%6 = tail call float @sqrt(double %5)
%7 = fpext float %6 to double
%8 = fadd double %7, 0xC0661FE87B139C95
%9 = fptrunc double %8 to float
ret float %9
}
double Absolute(double x) {
  if (x < 0.0)
    return (-x);
  else
    return (x);
}


x86 assembly (clang, -O0):
<Absolute>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113d <Absolute+0x3d>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1147 <Absolute+0x47>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Absolute>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @Absolute(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int distance = 100;
  printf("You are %d miles away.\n", distance);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"You are %d miles away.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"You are %d miles away.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 100)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ sflap_send(char *, int, int);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void serv_chat_leave(int id) {
  char *buf = malloc(256);
  snprintf(buf, 255, "toc_chat_leave %d", id);
  sflap_send(buf, -1, 2);
  free(buf);
}


x86 assembly (clang, -O0):
<serv_chat_leave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x100,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0xff,%esi
lea    0xe94(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x10(%rbp),%rdi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1060 <sflap_send@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serv_chat_leave>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x100,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xea7(%rip),%rdx
mov    %rax,%rdi
mov    $0xff,%esi
mov    %ebp,%ecx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1060 <sflap_send@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"toc_chat_leave %d\00"
define void @serv_chat_leave(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @malloc(i32 256)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* %2
%7 = call i32 @snprintf(i8* %5, i32 255, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %3
%9 = call i32 @sflap_send(i8* %8, i32 -1, i32 2)
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"toc_chat_leave %d\00"
define void @serv_chat_leave(i32 %0) {
%2 = tail call dereferenceable_or_null(256) i8* @malloc(i32 256)
%3 = tail call i32 @snprintf(i8* %2, i32 255, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @sflap_send(i8* %2, i32 -1, i32 2)
%5 = tail call i32 @free(i8* %2)
ret void
}
int sol_http_client_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sol_http_client_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ExitProcess(int);
int exit(int status) { ExitProcess(status); }


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ExitProcess@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rax
call   1030 <ExitProcess@plt>

LLVM IR (-O0):
define i32 @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ExitProcess(i32 %3)
unreachable
}

LLVM IR (-O2):
define i32 @exit(i32 %0) {
%2 = tail call i32 @ExitProcess(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ get_string(char *, char *, int);
int /*<<< orphan*/ process_pref_file_aux(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void do_cmd_pref(void) {
  char buf[80];
  strcpy(buf, "");
  if (!get_string("Pref: ", buf, 80))
    return;
  (void)process_pref_file_aux(buf);
}


x86 assembly (clang, -O0):
<do_cmd_pref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x50(%rbp),%rsi
lea    0xead(%rip),%rdi
mov    $0x50,%edx
call   1040 <get_string@plt>
cmp    $0x0,%eax
jne    116b <do_cmd_pref+0x3b>
jmp    1174 <do_cmd_pref+0x44>
lea    -0x50(%rbp),%rdi
call   1050 <process_pref_file_aux@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cmd_pref>:
push   %rbx
sub    $0x50,%rsp
lea    0xeca(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xeb2(%rip),%rdi
mov    %rbx,%rsi
mov    $0x50,%edx
call   1040 <get_string@plt>
test   %eax,%eax
je     1167 <do_cmd_pref+0x37>
mov    %rsp,%rdi
call   1050 <process_pref_file_aux@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [7 x i8] c"Pref: \00"
define void @do_cmd_pref() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%5 = call i32 @get_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 80)
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %0
br label %11
8: ; preds = %0
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%10 = call i32 @process_pref_file_aux(i8* %9)
br label %11
11: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [7 x i8] c"Pref: \00"
define void @do_cmd_pref() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @get_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 80)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @process_pref_file_aux(i8* %2)
br label %8
8: ; preds = %0, %6
ret void
}
/* Variables and functions */
char *strstr(char *, char *);
int name_fixup(char *name) {
  char *b;
  if (!name)
    return 1;
  b = strstr(name, ".blktrace.");
  if (b)
    *b = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<name_fixup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <name_fixup+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1160 <name_fixup+0x50>
mov    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1159 <name_fixup+0x49>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<name_fixup>:
push   %rax
test   %rdi,%rdi
je     1131 <name_fixup+0x21>
lea    0xee3(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     112f <name_fixup+0x1f>
movb   $0x0,(%rcx)
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c".blktrace.\00"
define i32 @name_fixup(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 1, i32* %2
br label %16
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @strstr(i8* %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = load i8*, i8** %4
store i8 0, i8* %14
br label %15
15: ; preds = %13, %8
store i32 0, i32* %2
br label %16
16: ; preds = %15, %7
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [11 x i8] c".blktrace.\00"
define i32 @name_fixup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i8* @strstr(i8* %0, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %3
store i8 0, i8* %4
br label %7
7: ; preds = %3, %6, %1
%8 = phi i32 [ 1, %1 ], [ 0, %6 ], [ 0, %3 ]
ret i32 %8
}
int thermal_notify_tz_trip_change(int tz_id, int id, int type, int temp,
                                  int hyst) {
  return 0;
}


x86 assembly (clang, -O0):
<thermal_notify_tz_trip_change>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @thermal_notify_tz_trip_change(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *progname) {
  printf("Usage: %s <query_name> <destination_ip> [options]\n"
         "\tOptions:\n"
         "\t-t, --type\t\tquery type\n"
         "\t-s, --source-ip\t\tsource ip\n"
         "\t-p, --dest-port\t\tdestination port\n"
         "\t-P, --src-port\t\tsource port\n"
         "\t-i, --interval\t\tinterval (in millisecond) between two packets\n"
         "\t-n, --number\t\tnumber of DNS requests to send\n"
         "\t-r, --random\t\tfake random source IP\n"
         "\t-D, --daemon\t\trun as daemon\n"
         "\t-h, --help\n"
         "\n",
         progname);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [365 x i8] c"Usage: %s <query_name> <destination_ip> [options]\0A\09Options:\0A\09-t, --type\09\09query type\0A\09-s, --source-ip\09\09source ip\0A\09-p, --dest-port\09\09destination port\0A\09-P, --src-port\09\09source port\0A\09-i, --interval\09\09interval (in millisecond) between two packets\0A\09-n, --number\09\09number of DNS requests to send\0A\09-r, --random\09\09fake random source IP\0A\09-D, --daemon\09\09run as daemon\0A\09-h, --help\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([365 x i8], [365 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [365 x i8] c"Usage: %s <query_name> <destination_ip> [options]\0A\09Options:\0A\09-t, --type\09\09query type\0A\09-s, --source-ip\09\09source ip\0A\09-p, --dest-port\09\09destination port\0A\09-P, --src-port\09\09source port\0A\09-i, --interval\09\09interval (in millisecond) between two packets\0A\09-n, --number\09\09number of DNS requests to send\0A\09-r, --random\09\09fake random source IP\0A\09-D, --daemon\09\09run as daemon\0A\09-h, --help\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([365 x i8], [365 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
void u_int32_t_swap(void *a, void *b, int size) {
  u_int32_t t = *(u_int32_t *)a;
  *(u_int32_t *)a = *(u_int32_t *)b;
  *(u_int32_t *)b = t;
}


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

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

LLVM IR (-O0):
define void @u_int32_t_swap(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %7
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
%14 = load i8*, i8** %4
%15 = bitcast i8* %14 to i32*
store i32 %13, i32* %15
%16 = load i32, i32* %7
%17 = load i8*, i8** %5
%18 = bitcast i8* %17 to i32*
store i32 %16, i32* %18
ret void
}

LLVM IR (-O2):
define void @u_int32_t_swap(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
store i32 %7, i32* %4
store i32 %5, i32* %6
ret void
}
void update_curr_stop(struct rq *rq) {}


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

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

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

LLVM IR (-O2):
%struct.rq = type opaque
define void @update_curr_stop(%struct.rq* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int __ftoa(char *buffer, double n, int precision) {
  sprintf(buffer, "%d", (int)n);
  return 0;
}


x86 assembly (clang, -O0):
<__ftoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
cvttsd2si -0x10(%rbp),%edx
lea    0xecc(%rip),%rsi
call   1030 <sprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ftoa>:
push   %rax
cvttsd2si %xmm0,%edx
lea    0xee4(%rip),%rsi
call   1030 <sprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @__ftoa(i8* %0, double %1, i32 %2) {
%4 = alloca i8*
%5 = alloca double
%6 = alloca i32
store i8* %0, i8** %4
store double %1, double* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load double, double* %5
%9 = fptosi double %8 to i32
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @__ftoa(i8* nocapture writeonly %0, double %1, i32 %2) {
%4 = fptosi double %1 to i32
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}