xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ srand(int);
int /*<<< orphan*/ srand48(int);
void __InitRandom(int seed) {
  if (seed == -1) {
    srand48(7654321L);
    srand(4321);
  } else {
    srand48(seed);
    srand(seed);
  }
}


x86 assembly (clang, -O0):
<__InitRandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    114e <__InitRandom+0x2e>
mov    $0x74cbb1,%edi
call   1040 <srand48@plt>
mov    $0x10e1,%edi
call   1030 <srand@plt>
jmp    115e <__InitRandom+0x3e>
mov    -0x4(%rbp),%edi
call   1040 <srand48@plt>
mov    -0x4(%rbp),%edi
call   1030 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__InitRandom>:
push   %rbx
mov    %edi,%ebx
cmp    $0xffffffff,%edi
mov    $0x74cbb1,%edi
cmovne %ebx,%edi
mov    $0x10e1,%eax
cmove  %eax,%ebx
call   1040 <srand48@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @__InitRandom(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @srand48(i32 7654321)
%7 = call i32 @srand(i32 4321)
br label %13
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @srand48(i32 %9)
%11 = load i32, i32* %2
%12 = call i32 @srand(i32 %11)
br label %13
13: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
define void @__InitRandom(i32 %0) {
%2 = icmp eq i32 %0, -1
%3 = select i1 %2, i32 7654321, i32 %0
%4 = select i1 %2, i32 4321, i32 %0
%5 = tail call i32 @srand48(i32 %3)
%6 = tail call i32 @srand(i32 %4)
ret void
}
/* Variables and functions */
scalar_t__ powf(float, float);
float sqrtf(scalar_t__);
float radius(float *cartesian) {
  return sqrtf(powf(cartesian[0], 2.f) + powf(cartesian[1], 2.f) +
               powf(cartesian[2], 2.f));
}


x86 assembly (clang, -O0):
<radius>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  0xec4(%rip),%xmm1
call   1030 <powf@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  0xeaa(%rip),%xmm1
call   1030 <powf@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
movss  0xe86(%rip),%xmm1
call   1030 <powf@plt>
mov    -0x10(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrtf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radius>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movss  (%rdi),%xmm0
movss  0xecd(%rip),%xmm1
call   1030 <powf@plt>
mov    %rax,%rbx
movss  0x4(%r14),%xmm0
movss  0xeb7(%rip),%xmm1
call   1030 <powf@plt>
add    %rax,%rbx
movss  0x8(%r14),%xmm0
movss  0xea1(%rip),%xmm1
call   1030 <powf@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sqrtf@plt>

LLVM IR (-O0):
define float @radius(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = call i64 @powf(float %5, float 2.000000e+00)
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 1
%9 = load float, float* %8
%10 = call i64 @powf(float %9, float 2.000000e+00)
%11 = add nsw i64 %6, %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 2
%14 = load float, float* %13
%15 = call i64 @powf(float %14, float 2.000000e+00)
%16 = add nsw i64 %11, %15
%17 = call float @sqrtf(i64 %16)
ret float %17
}

LLVM IR (-O2):
define float @radius(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call i64 @powf(float %2, float 2.000000e+00)
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = tail call i64 @powf(float %5, float 2.000000e+00)
%7 = add nsw i64 %6, %3
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = tail call i64 @powf(float %9, float 2.000000e+00)
%11 = add nsw i64 %7, %10
%12 = tail call float @sqrtf(i64 %11)
ret float %12
}
void PendSV_Handler(void) { fault_info(__FUNCTION__, sizeof(__FUNCTION__)); }


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

x86 assembly (clang, -O2):
<PendSV_Handler>:
lea    0xee9(%rip),%rdi
mov    $0xf,%esi
xor    %eax,%eax
jmp    1030 <fault_info@plt>

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

LLVM IR (-O2):
@__FUNCTION__.PendSV_Handler = [15 x i8] c"PendSV_Handler\00"
define void @PendSV_Handler() {
%1 = tail call i32 (i8*, i64, ...) bitcast (i32 (...)* @fault_info to i32 (i8*, i64, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__FUNCTION__.PendSV_Handler, i64 0, i64 0), i64 15)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ quick_sort4var_aux(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                      int /*<<< orphan*/);
void sort4var(int32_t *a, int32_t n) { quick_sort4var_aux(a, 0, n); }


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

x86 assembly (clang, -O2):
<sort4var>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <quick_sort4var_aux@plt>

LLVM IR (-O0):
define void @sort4var(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 @quick_sort4var_aux(i32* %5, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
define void @sort4var(i32* %0, i32 %1) {
%3 = tail call i32 @quick_sort4var_aux(i32* %0, i32 0, i32 %1)
ret void
}
void model_initialize(void) { return; }


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

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

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

LLVM IR (-O2):
define void @model_initialize() {
ret void
}
/* Type definitions */
typedef int socklen_t;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int getsockopt(int, int /*<<< orphan*/, int, char *, int *);
int get_tcp_windowsize(int sock, int dir) {
  int bufsize = 0;
  int rc;
  socklen_t len;
  len = sizeof bufsize;
  rc = getsockopt(sock, SOL_SOCKET, dir, (char *)&bufsize, &len);
  if (rc < 0) {
    return rc;
  }
  return bufsize;
}


x86 assembly (clang, -O0):
<get_tcp_windowsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x4,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
lea    -0x10(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1030 <getsockopt@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1160 <get_tcp_windowsize+0x50>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <get_tcp_windowsize+0x56>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tcp_windowsize>:
push   %rax
mov    %esi,%edx
movl   $0x0,(%rsp)
movl   $0x4,0x4(%rsp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rcx
lea    0x4(%rsp),%r8
call   1030 <getsockopt@plt>
test   %eax,%eax
js     113f <get_tcp_windowsize+0x2f>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
define i32 @get_tcp_windowsize(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 0, i32* %6
store i32 4, i32* %8
%9 = load i32, i32* %4
%10 = load i32, i32* @SOL_SOCKET
%11 = load i32, i32* %5
%12 = bitcast i32* %6 to i8*
%13 = call i32 @getsockopt(i32 %9, i32 %10, i32 %11, i8* %12, i32* %8)
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = load i32, i32* %7
store i32 %17, i32* %3
br label %20
18: ; preds = %2
%19 = load i32, i32* %6
store i32 %19, i32* %3
br label %20
20: ; preds = %18, %16
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
define i32 @get_tcp_windowsize(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 4, i32* %4
%7 = load i32, i32* @SOL_SOCKET
%8 = call i32 @getsockopt(i32 %0, i32 %7, i32 %1, i8* %5, i32* %4)
%9 = icmp slt i32 %8, 0
%10 = load i32, i32* %3
%11 = select i1 %9, i32 %8, i32 %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char);
int main(void) {
  printf("%s, %p, %c\n", "We", "are", *"space farers");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"%s, %p, %c\0A\00"
@.str.1 = [3 x i8] c"We\00"
@.str.2 = [4 x i8] c"are\00"
@.str.3 = [13 x i8] c"space farers\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0)
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8 signext %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s, %p, %c\0A\00"
@.str.1 = [3 x i8] c"We\00"
@.str.2 = [4 x i8] c"are\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8 signext 115)
ret i32 0
}
/* Variables and functions */
int isMethaneLevelCritical();
int isMethaneAlarm(void) {
  int retValue_acc;
  {
    { retValue_acc = isMethaneLevelCritical(); }
    return (retValue_acc);
    return (retValue_acc);
  }
}


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

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

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

LLVM IR (-O2):
define i32 @isMethaneAlarm() {
%1 = tail call i32 (...) @isMethaneLevelCritical()
ret i32 %1
}
int f(int i, int j) {
  int k = i == j;
  return k;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @f(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 = icmp eq i32 %6, %7
%9 = zext i1 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct zxcvbn_res {
  int dummy;
};

/* Variables and functions */
int zxcvbn_match_ex(struct zxcvbn_res *, char const *, unsigned int, char **,
                    unsigned int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int zxcvbn_match(struct zxcvbn_res *res, const char *password,
                 unsigned int password_len, char **words,
                 unsigned int words_num) {
  return zxcvbn_match_ex(res, password, password_len, words, words_num, NULL,
                         0);
}


x86 assembly (clang, -O0):
<zxcvbn_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <zxcvbn_match_ex@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zxcvbn_match>:
push   %rax
movl   $0x0,(%rsp)
xor    %r9d,%r9d
call   1030 <zxcvbn_match_ex@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.zxcvbn_res = type { i32 }
define i32 @zxcvbn_match(%struct.zxcvbn_res* %0, i8* %1, i32 %2, i8** %3, i32 %4) {
%6 = alloca %struct.zxcvbn_res*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8**
%10 = alloca i32
store %struct.zxcvbn_res* %0, %struct.zxcvbn_res** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8** %3, i8*** %9
store i32 %4, i32* %10
%11 = load %struct.zxcvbn_res*, %struct.zxcvbn_res** %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load i8**, i8*** %9
%15 = load i32, i32* %10
%16 = call i32 @zxcvbn_match_ex(%struct.zxcvbn_res* %11, i8* %12, i32 %13, i8** %14, i32 %15, i32* null, i32 0)
ret i32 %16
}

LLVM IR (-O2):
%struct.zxcvbn_res = type { i32 }
define i32 @zxcvbn_match(%struct.zxcvbn_res* %0, i8* %1, i32 %2, i8** %3, i32 %4) {
%6 = tail call i32 @zxcvbn_match_ex(%struct.zxcvbn_res* %0, i8* %1, i32 %2, i8** %3, i32 %4, i32* null, i32 0)
ret i32 %6
}
int f(int c) { return c; }


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

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 returned %0) {
ret i32 %0
}
int fun177() { return 177; }


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

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

LLVM IR (-O0):
define i32 @fun177() {
ret i32 177
}

LLVM IR (-O2):
define i32 @fun177() {
ret i32 177
}
int main() {
  int f1 = 1;
  int f2 = 1;
  int result = 0;
  while (f2 < 2000) {
    int f = f1 + f2;
    f1 = f2;
    f2 = f;
    if (f % 2 == 0) {
      result = result + f;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x7d0,-0xc(%rbp)
jge    1164 <main+0x64>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115f <main+0x5f>
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <main+0x20>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 1, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %22, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 2000
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %3
store i32 %13, i32* %2
%14 = load i32, i32* %5
store i32 %14, i32* %3
%15 = load i32, i32* %5
%16 = srem i32 %15, 2
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %9
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = add nsw i32 %19, %20
store i32 %21, i32* %4
br label %22
22: ; preds = %18, %9
br label %6
23: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void setval_228(unsigned *p) { *p = 3380926089U; }


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

x86 assembly (clang, -O2):
<setval_228>:
movl   $0xc984d689,(%rdi)
ret

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

LLVM IR (-O2):
define void @setval_228(i32* nocapture writeonly %0) {
store i32 -914041207, i32* %0
ret void
}
/* Type definitions */
struct netobj {
  int /*<<< orphan*/ n_len;
  int /*<<< orphan*/ n_bytes;
};
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ MAX_NETOBJ_SZ;
int /*<<< orphan*/ xdr_bytes(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ *, int /*<<< orphan*/);
bool_t xdr_netobj(XDR *xdrs, struct netobj *np) {
  return (xdr_bytes(xdrs, &np->n_bytes, &np->n_len, MAX_NETOBJ_SZ));
}


x86 assembly (clang, -O0):
<xdr_netobj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x4,%rsi
mov    -0x10(%rbp),%rdx
mov    0x2eb1(%rip),%rax
mov    (%rax),%ecx
call   1030 <xdr_bytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_netobj>:
mov    %rsi,%rdx
add    $0x4,%rsi
mov    0x2eca(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <xdr_bytes@plt>

LLVM IR (-O0):
%struct.netobj = type { i32, i32 }
@MAX_NETOBJ_SZ = global i32 0
define i32 @xdr_netobj(i32* %0, %struct.netobj* %1) {
%3 = alloca i32*
%4 = alloca %struct.netobj*
store i32* %0, i32** %3
store %struct.netobj* %1, %struct.netobj** %4
%5 = load i32*, i32** %3
%6 = load %struct.netobj*, %struct.netobj** %4
%7 = getelementptr inbounds %struct.netobj, %struct.netobj* %6, i32 0, i32 1
%8 = load %struct.netobj*, %struct.netobj** %4
%9 = getelementptr inbounds %struct.netobj, %struct.netobj* %8, i32 0, i32 0
%10 = load i32, i32* @MAX_NETOBJ_SZ
%11 = call i32 @xdr_bytes(i32* %5, i32* %7, i32* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.netobj = type { i32, i32 }
@MAX_NETOBJ_SZ = global i32 0
define i32 @xdr_netobj(i32* %0, %struct.netobj* %1) {
%3 = getelementptr inbounds %struct.netobj, %struct.netobj* %1, i64 0, i32 1
%4 = getelementptr inbounds %struct.netobj, %struct.netobj* %1, i64 0, i32 0
%5 = load i32, i32* @MAX_NETOBJ_SZ
%6 = tail call i32 @xdr_bytes(i32* %0, i32* %3, i32* %4, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ l_print(long);
int /*<<< orphan*/ printf(char *, ...);
char err_msg(char *msg, char f, long s) {
  printf("\nERROR. \n%s", msg);
  if (f != 0)
    l_print(s);
  printf("\n");
  return -1;
}


x86 assembly (clang, -O0):
<err_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
je     115e <err_msg+0x3e>
mov    -0x18(%rbp),%rdi
call   1040 <l_print@plt>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xff,%al
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_msg>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%rsi
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %bpl,%bpl
je     1156 <err_msg+0x26>
mov    %rbx,%rdi
call   1050 <l_print@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xff,%al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"\0AERROR. \0A%s\00"
define signext i8 @err_msg(i8* %0, i8 signext %1, i64 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = icmp eq i8 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @l_print(i64 %2)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @putchar(i32 10)
ret i8 -1
}
int fun1274() { return 1274; }


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

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

LLVM IR (-O0):
define i32 @fun1274() {
ret i32 1274
}

LLVM IR (-O2):
define i32 @fun1274() {
ret i32 1274
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("[BEGIN] dlsym-in-interposed-malloc\n");
  (void)malloc(1);
  printf("[PASS] dlsym-in-interposed-malloc\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <malloc@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"[BEGIN] dlsym-in-interposed-malloc\0A\00"
@.str.1 = [35 x i8] c"[PASS] dlsym-in-interposed-malloc\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @malloc(i32 1)
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [35 x i8] c"[BEGIN] dlsym-in-interposed-malloc\00"
@str.2 = [34 x i8] c"[PASS] dlsym-in-interposed-malloc\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @malloc(i32 1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) { fprintf(stderr, "usage: ethos <tap> <serial>\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"usage: ethos <tap> <serial>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"usage: ethos <tap> <serial>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ data_offset_from_whence(int, size_t);
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ xread(int, void *, size_t);
ssize_t read_whence_data(int fd, void *buffer, size_t len, int whence) {
  off_t offset = data_offset_from_whence(whence, len);
  lseek(fd, offset, SEEK_SET);
  return xread(fd, buffer, len);
}


x86 assembly (clang, -O0):
<read_whence_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <data_offset_from_whence@plt>
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    0x2e7e(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <xread@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_whence_data>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    %ecx,%edi
mov    %rdx,%rsi
call   1040 <data_offset_from_whence@plt>
mov    0x2e93(%rip),%rcx
mov    (%rcx),%edx
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <lseek@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <xread@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @read_whence_data(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%10 = load i32, i32* %8
%11 = load i64, i64* %7
%12 = call i32 @data_offset_from_whence(i32 %10, i64 %11)
store i32 %12, i32* %9
%13 = load i32, i32* %5
%14 = load i32, i32* %9
%15 = load i32, i32* @SEEK_SET
%16 = call i32 @lseek(i32 %13, i32 %14, i32 %15)
%17 = load i32, i32* %5
%18 = load i8*, i8** %6
%19 = load i64, i64* %7
%20 = call i32 @xread(i32 %17, i8* %18, i64 %19)
ret i32 %20
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @read_whence_data(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @data_offset_from_whence(i32 %3, i64 %2)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @lseek(i32 %0, i32 %5, i32 %6)
%8 = tail call i32 @xread(i32 %0, i8* %1, i64 %2)
ret i32 %8
}
/* Variables and functions */
size_t max3(size_t a, size_t b, size_t c) {
  if (b > a) {
    return (c > b) ? c : b;
  } else {
    return (c > a) ? c : a;
  }
}


x86 assembly (clang, -O0):
<max3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    114e <max3+0x4e>
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1139 <max3+0x39>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1141 <max3+0x41>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1179 <max3+0x79>
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1169 <max3+0x69>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1171 <max3+0x71>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max3>:
mov    %rsi,%rax
cmp    %rsi,%rdx
cmova  %rdx,%rax
cmp    %rdi,%rax
cmovbe %rdi,%rax
ret

LLVM IR (-O0):
define i64 @max3(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64, i64* %6
%9 = load i64, i64* %5
%10 = icmp ugt i64 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %3
%12 = load i64, i64* %7
%13 = load i64, i64* %6
%14 = icmp ugt i64 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load i64, i64* %7
br label %19
17: ; preds = %11
%18 = load i64, i64* %6
br label %19
19: ; preds = %17, %15
%20 = phi i64 [ %16, %15 ], [ %18, %17 ]
store i64 %20, i64* %4
br label %31
21: ; preds = %3
%22 = load i64, i64* %7
%23 = load i64, i64* %5
%24 = icmp ugt i64 %22, %23
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load i64, i64* %7
br label %29
27: ; preds = %21
%28 = load i64, i64* %5
br label %29
29: ; preds = %27, %25
%30 = phi i64 [ %26, %25 ], [ %28, %27 ]
store i64 %30, i64* %4
br label %31
31: ; preds = %29, %19
%32 = load i64, i64* %4
ret i64 %32
}

LLVM IR (-O2):
define i64 @max3(i64 %0, i64 %1, i64 %2) {
%4 = icmp ugt i64 %2, %1
%5 = select i1 %4, i64 %2, i64 %1
%6 = icmp ugt i64 %5, %0
%7 = select i1 %6, i64 %5, i64 %0
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int /*<<< orphan*/ EVP_DigestFinal_ex(int /*<<< orphan*/ *, char *,
                                      unsigned int *);
int /*<<< orphan*/ EVP_MD_CTX_destroy(int /*<<< orphan*/ *);
int HASH_finish(void *ctx, char *out) {
  EVP_MD_CTX *pctx = (EVP_MD_CTX *)ctx;
  unsigned int len = 0;
  EVP_DigestFinal_ex(pctx, out, &len);
  EVP_MD_CTX_destroy(pctx);
  return 0;
}


x86 assembly (clang, -O0):
<HASH_finish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <EVP_DigestFinal_ex@plt>
mov    -0x18(%rbp),%rdi
call   1040 <EVP_MD_CTX_destroy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HASH_finish>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdx
call   1030 <EVP_DigestFinal_ex@plt>
mov    %rbx,%rdi
call   1040 <EVP_MD_CTX_destroy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @HASH_finish(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
store i32 0, i32* %6
%9 = load i32*, i32** %5
%10 = load i8*, i8** %4
%11 = call i32 @EVP_DigestFinal_ex(i32* %9, i8* %10, i32* %6)
%12 = load i32*, i32** %5
%13 = call i32 @EVP_MD_CTX_destroy(i32* %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @HASH_finish(i8* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i8* %0 to i32*
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = call i32 @EVP_DigestFinal_ex(i32* %4, i8* %1, i32* %3)
%7 = call i32 @EVP_MD_CTX_destroy(i32* %4)
ret i32 0
}
char *bindex(sp, c)
register char *sp, c;
{
  register char *r;
  r = sp;
  while (*sp) {
    if (*sp++ == c)
      r = sp;
  }
  return r;
}


x86 assembly (clang, -O0):
<bindex>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <bindex+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1149 <bindex+0x49>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1116 <bindex+0x16>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bindex>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1134 <bindex+0x34>
movsbl %sil,%edx
lea    0x1(%rax),%rsi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
cmp    %ecx,%edx
cmove  %rsi,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <bindex+0x20>
ret

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

LLVM IR (-O2):
define i8* @bindex(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %8
%9 = phi i8 [ %3, %5 ], [ %16, %8 ]
%10 = phi i8* [ %0, %5 ], [ %15, %8 ]
%11 = phi i8* [ %0, %5 ], [ %12, %8 ]
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = sext i8 %9 to i32
%14 = icmp eq i32 %7, %13
%15 = select i1 %14, i8* %12, i8* %10
%16 = load i8, i8* %12
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %8
18: ; preds = %8, %2
%19 = phi i8* [ %0, %2 ], [ %15, %8 ]
ret i8* %19
}
int main() {
  char c;
  c = -1;
  if ((int)c != -1) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0xff,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xffffffff,%eax
je     1128 <main+0x28>
movl   $0x1,-0x4(%rbp)
jmp    112f <main+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 -1, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ drawCharacterWithColor(char, int);
void drawCharacter(char c) { drawCharacterWithColor(c, 0xFFFFFF); }


x86 assembly (clang, -O0):
<drawCharacter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xffffff,%esi
movsbl -0x1(%rbp),%edi
call   1030 <drawCharacterWithColor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawCharacter>:
mov    $0xffffff,%esi
jmp    1030 <drawCharacterWithColor@plt>

LLVM IR (-O0):
define void @drawCharacter(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @drawCharacterWithColor(i8 signext %3, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @drawCharacter(i8 signext %0) {
%2 = tail call i32 @drawCharacterWithColor(i8 signext %0, i32 16777215)
ret void
}
void test_iscntrl(void) {
  int i, j;
  for (i = -127; i < 256;)
    j = i, printf("%s: %d -> %d\n", __FUNCTION__, j, iscntrl(i++) ? 1 : 0);
}


x86 assembly (clang, -O0):
<test_iscntrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffff81,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1184 <test_iscntrl+0x64>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
call   1030 <iscntrl@plt>
mov    -0xc(%rbp),%edx
mov    %eax,%esi
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x0,%esi
cmovne %eax,%ecx
lea    0xe8f(%rip),%rdi
lea    0xe96(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    112f <test_iscntrl+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_iscntrl>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0xffffff81,%ebx
lea    0xecd(%rip),%r14
lea    0xed4(%rip),%r15
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%ebp
mov    %ebx,%edi
call   1030 <iscntrl@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%ebx
cmp    $0x100,%ebp
jne    1140 <test_iscntrl+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_iscntrl = [13 x i8] c"test_iscntrl\00"
define void @test_iscntrl() {
%1 = alloca i32
%2 = alloca i32
store i32 -127, i32* %1
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 256
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
%11 = call i32 @iscntrl(i32 %9)
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_iscntrl, i64 0, i64 0), i32 %8, i32 %14)
br label %3
16: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_iscntrl = [13 x i8] c"test_iscntrl\00"
define void @test_iscntrl() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ -127, %0 ], [ %3, %1 ]
%3 = add nsw i32 %2, 1
%4 = tail call i32 @iscntrl(i32 %2)
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_iscntrl, i64 0, i64 0), i32 %2, i32 %6)
%8 = icmp eq i32 %3, 256
br i1 %8, label %9, label %1
9: ; preds = %1
ret void
}
__attribute__((no)) int anotherTest(int spare) { return 53; }


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

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

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

LLVM IR (-O2):
define i32 @anotherTest(i32 %0) {
ret i32 53
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ arand(int *, int);
int /*<<< orphan*/ print(int *, int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ stoogesort(int *, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  int a[5];
  srand(time(NULL));
  arand(a, (sizeof(a) / sizeof(a[0])));
  print(a, (sizeof(a) / sizeof(a[0])));
  stoogesort(a, (sizeof(a) / sizeof(a[0])));
  print(a, (sizeof(a) / sizeof(a[0])));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <arand@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1050 <print@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <stoogesort@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1050 <print@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <arand@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <print@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <stoogesort@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <print@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = call i32 @arand(i32* %5, i32 5)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = call i32 @print(i32* %7, i32 5)
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%10 = call i32 @stoogesort(i32* %9, i32 5)
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%12 = call i32 @print(i32* %11, i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = call i32 @arand(i32* %5, i32 5)
%7 = call i32 @print(i32* %5, i32 5)
%8 = call i32 @stoogesort(i32* %5, i32 5)
%9 = call i32 @print(i32* %5, i32 5)
ret i32 0
}
unsigned kol_mouse_pos() { asm("int $0x40" ::"a"(37), "b"(0)); }


x86 assembly (clang, -O0):
<kol_mouse_pos>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x25,%eax
xor    %ebx,%ebx
int    $0x40
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_mouse_pos>:
push   %rbx
mov    $0x25,%eax
xor    %ebx,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @kol_mouse_pos() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 37, i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ lastStrStr(char *, char *);
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int main(void) {
  char *sbig = "the past was one the future ";
  char *ssmall = "this";
  puts(lastStrStr(sbig, ssmall));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xedc(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <lastStrStr@plt>
mov    %eax,%edi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xeee(%rip),%rsi
call   1040 <lastStrStr@plt>
mov    %eax,%edi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"the past was one the future \00"
@.str.1 = [5 x i8] c"this\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = call i32 @lastStrStr(i8* %4, i8* %5)
%7 = call i32 @puts(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"the past was one the future \00"
@.str.1 = [5 x i8] c"this\00"
define i32 @main() {
%1 = tail call i32 @lastStrStr(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void SWARM_print_help(char **argv) {
  printf("SWARM usage: %s [-t #threads] [-o outfile]\n", argv[0]);
  printf("\t-t #threads    overrides the default number of threads\n");
  printf("\t-o outfile     redirects standard output to outfile\n");
}


x86 assembly (clang, -O0):
<SWARM_print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SWARM_print_help>:
push   %rax
mov    (%rdi),%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1f(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"SWARM usage: %s [-t #threads] [-o outfile]\0A\00"
@.str.1 = [57 x i8] c"\09-t #threads overrides the default number of threads\0A\00"
@.str.2 = [54 x i8] c"\09-o outfile redirects standard output to outfile\0A\00"
define void @SWARM_print_help(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"SWARM usage: %s [-t #threads] [-o outfile]\0A\00"
@str = [56 x i8] c"\09-t #threads overrides the default number of threads\00"
@str.3 = [53 x i8] c"\09-o outfile redirects standard output to outfile\00"
define void @SWARM_print_help(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *, char *);
int /*<<< orphan*/ square(int, char);
void main(void) {
  int side;
  char fillCharacter;
  scanf("%d %c", &side, &fillCharacter);
  square(side, fillCharacter);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x5(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
movsbl -0x5(%rbp),%esi
call   1030 <square@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
lea    0x3(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
movsbl 0x3(%rsp),%esi
call   1030 <square@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %c\00"
define void @main() {
%1 = alloca i32
%2 = alloca i8
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i8* %2)
%5 = load i32, i32* %1
%6 = load i8, i8* %2
%7 = call i32 @square(i32 %5, i8 signext %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ int16Clear(int /*<<< orphan*/ *);
void int16Destroy(int16_t *data) {
  int16Clear(data);
  free(data);
}


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

x86 assembly (clang, -O2):
<int16Destroy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <int16Clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @int16Destroy(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @int16Clear(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @free(i32* %5)
ret void
}

LLVM IR (-O2):
define void @int16Destroy(i32* %0) {
%2 = tail call i32 @int16Clear(i32* %0)
%3 = tail call i32 @free(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int /*<<< orphan*/, int /*<<< orphan*/);
void C67_STH_SP_A0(int r) { C67_asm("STH.D *+SP[A0]", r, 0, 0); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"STH.D *+SP[A0]\00"
define void @C67_STH_SP_A0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @C67_asm(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"STH.D *+SP[A0]\00"
define void @C67_STH_SP_A0(i32 %0) {
%2 = tail call i32 @C67_asm(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0, i32 0, i32 0)
ret void
}