xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(int);
int strcmp(char *, char *);
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  FILE *f0, *f1;
  char s[100];
  char s1[] = "fucka";
  char s2[] = "fuck";
  printf("%d", strcmp(s1, s2));
  putchar(strcmp(s1, s2));
  system("date");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xea8(%rip),%eax
mov    %eax,-0x96(%rbp)
mov    0xe9f(%rip),%ax
mov    %ax,-0x92(%rbp)
mov    0xe94(%rip),%eax
mov    %eax,-0x9b(%rbp)
mov    0xe8c(%rip),%al
mov    %al,-0x97(%rbp)
lea    -0x96(%rbp),%rdi
lea    -0x9b(%rbp),%rsi
call   1060 <strcmp@plt>
mov    %eax,%esi
lea    0xe6b(%rip),%rdi
call   1050 <printf@plt>
lea    -0x96(%rbp),%rdi
lea    -0x9b(%rbp),%rsi
call   1060 <strcmp@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
lea    0xe48(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0x1,%esi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1030 <putchar@plt>
lea    0xeb0(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.s1 = [6 x i8] c"fucka\00"
@__const.main.s2 = [5 x i8] c"fuck\00"
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"date\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca [100 x i8]
%8 = alloca [6 x i8]
%9 = alloca [5 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%10 = bitcast [6 x i8]* %8 to i8*
%11 = bitcast [5 x i8]* %9 to i8*
%12 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 0
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 0
%14 = call i32 @strcmp(i8* %12, i8* %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 0
%17 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 0
%18 = call i32 @strcmp(i8* %16, i8* %17)
%19 = call i32 @putchar(i32 %18)
%20 = call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"date\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = tail call i32 @putchar(i32 1)
%5 = tail call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void XcmsDefaultCCC() {}


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

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

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

LLVM IR (-O2):
define void @XcmsDefaultCCC() {
ret void
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn26() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn26");
  return result;
}


x86 assembly (clang, -O0):
<fn26>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn26>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn26\00"
define i8* @fn26() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn26\00"
define i8* @fn26() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ ta_oom_b(int /*<<< orphan*/);
int /*<<< orphan*/ ta_strndup_append(char **, char const *, size_t);
char *ta_talloc_strndup_append(char *s, const char *a, size_t n) {
  ta_oom_b(ta_strndup_append(&s, a, n));
  return s;
}


x86 assembly (clang, -O0):
<ta_talloc_strndup_append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x8(%rbp),%rdi
call   1040 <ta_strndup_append@plt>
mov    %eax,%edi
call   1030 <ta_oom_b@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ta_talloc_strndup_append>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1040 <ta_strndup_append@plt>
mov    %eax,%edi
call   1030 <ta_oom_b@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @ta_talloc_strndup_append(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
store i8* %0, i8** %4
%5 = call i32 @ta_strndup_append(i8** %4, i8* %1, i64 %2)
%6 = call i32 @ta_oom_b(i32 %5)
%7 = load i8*, i8** %4
ret i8* %7
}
double vde_chain_nm7_sq(double x) { return x * x; }


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

x86 assembly (clang, -O2):
<vde_chain_nm7_sq>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @vde_chain_nm7_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
void __down_read_trylock(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<__down_read_trylock>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__down_read_trylock>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

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

LLVM IR (-O2):
@__func__.__down_read_trylock = [20 x i8] c"__down_read_trylock\00"
define void @__down_read_trylock() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.__down_read_trylock, i64 0, i64 0))
ret void
}
void lm_dump_agc(float gain) {}


x86 assembly (clang, -O0):
<lm_dump_agc>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @lm_dump_agc(float %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CLI_Execute();
int /*<<< orphan*/ IRQ_Enable();
int /*<<< orphan*/ InitHW();
int /*<<< orphan*/ InitSW();
int main(int argc, char *argv[]) {
  InitHW();
  InitSW();
  IRQ_Enable();
  while (1)
    CLI_Execute();
  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   1060 <InitHW@plt>
mov    $0x0,%al
call   1040 <InitSW@plt>
mov    $0x0,%al
call   1050 <IRQ_Enable@plt>
mov    $0x0,%al
call   1030 <CLI_Execute@plt>
jmp    116b <main+0x2b>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <InitHW@plt>
xor    %eax,%eax
call   1040 <InitSW@plt>
xor    %eax,%eax
call   1050 <IRQ_Enable@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <CLI_Execute@plt>
jmp    1160 <main+0x20>

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 (...) @InitHW()
%7 = call i32 (...) @InitSW()
%8 = call i32 (...) @IRQ_Enable()
br label %9
9: ; preds = %2, %9
%10 = call i32 (...) @CLI_Execute()
br label %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @InitHW()
%4 = tail call i32 (...) @InitSW()
%5 = tail call i32 (...) @IRQ_Enable()
br label %6
6: ; preds = %2, %6
%7 = tail call i32 (...) @CLI_Execute()
br label %6
}
void RELEASE_TIMER(void) {}


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

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

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

LLVM IR (-O2):
define void @RELEASE_TIMER() {
ret void
}
/* Variables and functions */
scalar_t__ isspace(char const);
int IsStringEmpty(const char *s) {
  if (!s) {
    return 1;
  }
  while (isspace(*s))
    ++s;
  if (*s == '\0')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<IsStringEmpty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <IsStringEmpty+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1182 <IsStringEmpty+0x72>
jmp    1138 <IsStringEmpty+0x28>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     115f <IsStringEmpty+0x4f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1138 <IsStringEmpty+0x28>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    117b <IsStringEmpty+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    1182 <IsStringEmpty+0x72>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsStringEmpty>:
test   %rdi,%rdi
je     113c <IsStringEmpty+0x2c>
push   %rbx
mov    %rdi,%rbx
nopl   0x0(%rax)
movsbl (%rbx),%edi
call   1030 <isspace@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1120 <IsStringEmpty+0x10>
xor    %eax,%eax
cmpb   $0x0,-0x1(%rbx)
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @IsStringEmpty(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 %7, label %6
6: ; preds = %1
store i32 1, i32* %2
br label %23
7: ; preds = %1
br label %8
8: ; preds = %13, %7
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = call i64 @isspace(i8 signext %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
br label %8
16: ; preds = %8
%17 = load i8*, i8** %3
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %16
store i32 1, i32* %2
br label %23
22: ; preds = %16
store i32 0, i32* %2
br label %23
23: ; preds = %22, %21, %6
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @IsStringEmpty(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %8, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = tail call i64 @isspace(i8 signext %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = load i8, i8* %4
%11 = icmp eq i8 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %1
%14 = phi i32 [ 1, %1 ], [ %12, %9 ]
ret i32 %14
}
/* Type definitions */
struct svc_req {
  int dummy;
};

/* Variables and functions */
int l2tp_ppp_profile_delete_1_svc(char *, void *, struct svc_req *);
int _l2tp_ppp_profile_delete_1(char **argp, void *result,
                               struct svc_req *rqstp) {
  return (l2tp_ppp_profile_delete_1_svc(*argp, result, rqstp));
}


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

x86 assembly (clang, -O2):
<_l2tp_ppp_profile_delete_1>:
mov    (%rdi),%rdi
jmp    1030 <l2tp_ppp_profile_delete_1_svc@plt>

LLVM IR (-O0):
%struct.svc_req = type { i32 }
define i32 @_l2tp_ppp_profile_delete_1(i8** %0, i8* %1, %struct.svc_req* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca %struct.svc_req*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store %struct.svc_req* %2, %struct.svc_req** %6
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = load i8*, i8** %5
%10 = load %struct.svc_req*, %struct.svc_req** %6
%11 = call i32 @l2tp_ppp_profile_delete_1_svc(i8* %8, i8* %9, %struct.svc_req* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
define i32 @_l2tp_ppp_profile_delete_1(i8** nocapture %0, i8* %1, %struct.svc_req* %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @l2tp_ppp_profile_delete_1_svc(i8* %4, i8* %1, %struct.svc_req* %2)
ret i32 %5
}
void gtk_radio_tool_button_set_group() {}


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

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

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

LLVM IR (-O2):
define void @gtk_radio_tool_button_set_group() {
ret void
}
/* Variables and functions */
int setsockopt(int, int, int, void const *, int);
int /*<<< orphan*/ unix_error(char *);
void Setsockopt(int s, int level, int optname, const void *optval, int optlen) {
  int n;
  if ((n = setsockopt(s, level, optname, optval, optlen)) < 0)
    unix_error("Setsockopt error");
}


x86 assembly (clang, -O0):
<Setsockopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <setsockopt@plt>
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jge    1167 <Setsockopt+0x47>
lea    0xe9e(%rip),%rdi
call   1040 <unix_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Setsockopt>:
push   %rax
call   1030 <setsockopt@plt>
test   %eax,%eax
js     112c <Setsockopt+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1040 <unix_error@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"Setsockopt error\00"
define void @Setsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @setsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @unix_error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}
/* Variables and functions */
int sha256_VST(unsigned char *, unsigned char *, int);
int vst_entry() {
  unsigned char input[] = "This is a test string";
  unsigned char result[32] = "";
  return sha256_VST(input, result, 21);
}


x86 assembly (clang, -O0):
<vst_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xec6(%rip),%ax
mov    %ax,-0xc(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1030 <memset@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x15,%edx
call   1040 <sha256_VST@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vst_entry>:
sub    $0x48,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x676e6972747320,%rax
mov    %rax,0xe(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
mov    %rsp,%rdi
lea    0x20(%rsp),%rsi
mov    $0x15,%edx
call   1030 <sha256_VST@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.vst_entry.input = [22 x i8] c"This is a test string\00"
define i32 @vst_entry() {
%1 = alloca [22 x i8]
%2 = alloca [32 x i8]
%3 = bitcast [22 x i8]* %1 to i8*
%4 = bitcast [32 x i8]* %2 to i8*
%5 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%7 = call i32 @sha256_VST(i8* %5, i8* %6, i32 21)
ret i32 %7
}

LLVM IR (-O2):
@__const.vst_entry.input = [22 x i8] c"This is a test string\00"
define i32 @vst_entry() {
%1 = alloca [22 x i8]
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%5 = call i32 @sha256_VST(i8* %3, i8* %4, i32 21)
ret i32 %5
}
int IntCompare2(void *array1, void *array2, int i, int j) {
  return (((int *)array1)[i] <= ((int *)array2)[j]);
}


x86 assembly (clang, -O0):
<IntCompare2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntCompare2>:
movslq %edx,%rax
mov    (%rdi,%rax,4),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%rsi,%rcx,4),%edx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @IntCompare2(i8* nocapture %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = bitcast i8* %0 to i32*
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds i32, i32* %5, i64 %6
%8 = load i32, i32* %7
%9 = bitcast i8* %1 to i32*
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i32, i32* %9, i64 %10
%12 = load i32, i32* %11
%13 = icmp sle i32 %8, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
scalar_t__ ESRCH;
int /*<<< orphan*/ SIGKILL;
scalar_t__ errno;
int /*<<< orphan*/ error(int /*<<< orphan*/ *);
scalar_t__ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void terminate(pid_t pid) {
  if (kill(pid, SIGKILL) < 0 && errno != ESRCH)
    error(NULL);
}


x86 assembly (clang, -O0):
<terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
cmp    $0x0,%rax
jge    1169 <terminate+0x49>
mov    0x2e93(%rip),%rax
mov    (%rax),%rax
mov    0x2e71(%rip),%rcx
cmp    (%rcx),%rax
je     1169 <terminate+0x49>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminate>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
test   %rax,%rax
jns    114a <terminate+0x2a>
mov    0x2ea5(%rip),%rax
mov    (%rax),%rax
mov    0x2e83(%rip),%rcx
cmp    (%rcx),%rax
jne    114c <terminate+0x2c>
pop    %rax
ret
xor    %edi,%edi
pop    %rax
jmp    1040 <error@plt>

LLVM IR (-O0):
@SIGKILL = global i32 0
@errno = global i64 0
@ESRCH = global i64 0
define void @terminate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGKILL
%5 = call i64 @kill(i32 %3, i32 %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i64, i64* @errno
%9 = load i64, i64* @ESRCH
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @error(i32* null)
br label %13
13: ; preds = %11, %7, %1
ret void
}

LLVM IR (-O2):
@SIGKILL = global i32 0
@errno = global i64 0
@ESRCH = global i64 0
define void @terminate(i32 %0) {
%2 = load i32, i32* @SIGKILL
%3 = tail call i64 @kill(i32 %0, i32 %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i64, i64* @errno
%7 = load i64, i64* @ESRCH
%8 = icmp eq i64 %6, %7
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 @error(i32* null)
br label %11
11: ; preds = %9, %5, %1
ret void
}
void GPU_setMode(unsigned long gdata) {}


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

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

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

LLVM IR (-O2):
define void @GPU_setMode(i64 %0) {
ret void
}
double logic_ne(double a, double b) { return a != b; }


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

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

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

LLVM IR (-O2):
define double @logic_ne(double %0, double %1) {
%3 = fcmp une double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
/* Variables and functions */
double longSeqTm(char *, int /*<<< orphan*/, int, double);
double oligoTm(char *, double, double);
int strlen(char *);
double seqTm(char *seq, double dna_conc, double salt_conc) {
  int len = strlen(seq);
  return (len > 36) ? longSeqTm(seq, 0, len, salt_conc)
                    : oligoTm(seq, dna_conc, salt_conc);
}


x86 assembly (clang, -O0):
<seqTm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x24,-0x1c(%rbp)
jle    1179 <seqTm+0x49>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
xor    %esi,%esi
call   1050 <longSeqTm@plt>
movsd  %xmm0,-0x28(%rbp)
jmp    1191 <seqTm+0x61>
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <oligoTm@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seqTm>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
cmp    $0x25,%eax
jl     1163 <seqTm+0x33>
xor    %esi,%esi
mov    %eax,%edx
movsd  (%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1050 <longSeqTm@plt>
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
add    $0x10,%rsp
pop    %rbx
jmp    1030 <oligoTm@plt>

LLVM IR (-O0):
define double @seqTm(i8* %0, double %1, double %2) {
%4 = alloca i8*
%5 = alloca double
%6 = alloca double
%7 = alloca i32
store i8* %0, i8** %4
store double %1, double* %5
store double %2, double* %6
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = icmp sgt i32 %10, 36
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = load i8*, i8** %4
%14 = load i32, i32* %7
%15 = load double, double* %6
%16 = call double @longSeqTm(i8* %13, i32 0, i32 %14, double %15)
br label %22
17: ; preds = %3
%18 = load i8*, i8** %4
%19 = load double, double* %5
%20 = load double, double* %6
%21 = call double @oligoTm(i8* %18, double %19, double %20)
br label %22
22: ; preds = %17, %12
%23 = phi double [ %16, %12 ], [ %21, %17 ]
ret double %23
}

LLVM IR (-O2):
define double @seqTm(i8* %0, double %1, double %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp sgt i32 %4, 36
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call double @longSeqTm(i8* %0, i32 0, i32 %4, double %2)
br label %10
8: ; preds = %3
%9 = tail call double @oligoTm(i8* %0, double %1, double %2)
br label %10
10: ; preds = %8, %6
%11 = phi double [ %7, %6 ], [ %9, %8 ]
ret double %11
}
int hxd_version(void) { return 0x20160408; }


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

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

LLVM IR (-O0):
define i32 @hxd_version() {
ret i32 538313736
}

LLVM IR (-O2):
define i32 @hxd_version() {
ret i32 538313736
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void tlb_pagesize_validate(uint64_t size) {
  assert((size == 4096) || (size == 65536) || (size == 16777216));
}


x86 assembly (clang, -O0):
<tlb_pagesize_validate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x1000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114c <tlb_pagesize_validate+0x3c>
mov    $0x1,%al
cmpl   $0x10000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114c <tlb_pagesize_validate+0x3c>
cmpl   $0x1000000,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlb_pagesize_validate>:
mov    %edi,%eax
mov    $0x1,%edi
cmp    $0x1000,%eax
je     1125 <tlb_pagesize_validate+0x15>
cmp    $0x10000,%eax
jne    112a <tlb_pagesize_validate+0x1a>
jmp    1030 <assert@plt>
xor    %edi,%edi
cmp    $0x1000000,%eax
sete   %dil
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @tlb_pagesize_validate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 4096
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 65536
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 16777216
br label %11
11: ; preds = %8, %5, %1
%12 = phi i1 [ true, %5 ], [ true, %1 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret void
}

LLVM IR (-O2):
define void @tlb_pagesize_validate(i32 %0) {
switch i32 %0, label %2 [
i32 65536, label %5
i32 4096, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 16777216
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
%7 = tail call i32 @assert(i32 %6)
ret void
}
unsigned int hash(char *data) {
  char *p;
  unsigned int h = 5381;
  for (p = data; *p != '\0'; p++) {
    h = ((h << 5) + h) + *p;
  }
  return h;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <hash+0x4d>
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
add    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <hash+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <hash+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <hash+0x20>
ret
mov    $0x1505,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
store i32 5381, i32* %4
%5 = load i8*, i8** %2
store i8* %5, i8** %3
br label %6
6: ; preds = %20, %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 %23
11: ; preds = %6
%12 = load i32, i32* %4
%13 = shl i32 %12, 5
%14 = load i32, i32* %4
%15 = add i32 %13, %14
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = add i32 %15, %18
store i32 %19, i32* %4
br label %20
20: ; preds = %11
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
br label %6
23: ; preds = %6
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 33
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Type definitions */
typedef size_t uint;

/* Variables and functions */
size_t xencode_char(char const);
void xstr_to_seq(uint n, const char *str, uint *seq) {
  uint i;
  for (i = 0; i < n; i++)
    seq[i] = xencode_char(str[i]);
}


x86 assembly (clang, -O0):
<xstr_to_seq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    116b <xstr_to_seq+0x5b>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <xencode_char@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <xstr_to_seq+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstr_to_seq>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdi,%rdi
je     1147 <xstr_to_seq+0x37>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <xencode_char@plt>
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <xstr_to_seq+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @xstr_to_seq(i64 %0, i8* %1, i64* %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64*
%7 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
store i64* %2, i64** %6
store i64 0, i64* %7
br label %8
8: ; preds = %21, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %4
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %24
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = load i64, i64* %7
%15 = getelementptr inbounds i8, i8* %13, i64 %14
%16 = load i8, i8* %15
%17 = call i64 @xencode_char(i8 signext %16)
%18 = load i64*, i64** %6
%19 = load i64, i64* %7
%20 = getelementptr inbounds i64, i64* %18, i64 %19
store i64 %17, i64* %20
br label %21
21: ; preds = %12
%22 = load i64, i64* %7
%23 = add i64 %22, 1
store i64 %23, i64* %7
br label %8
24: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @xstr_to_seq(i64 %0, i8* nocapture %1, i64* nocapture writeonly %2) {
%4 = icmp eq i64 %0, 0
br i1 %4, label %13, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %11, %5 ], [ 0, %3 ]
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = load i8, i8* %7
%9 = tail call i64 @xencode_char(i8 signext %8)
%10 = getelementptr inbounds i64, i64* %2, i64 %6
store i64 %9, i64* %10
%11 = add nuw i64 %6, 1
%12 = icmp eq i64 %11, %0
br i1 %12, label %13, label %5
13: ; preds = %5, %3
ret void
}
void DAC_Out(unsigned short input) {
  unsigned short output = input & 0x0fff;
  output |= 0xc000;
  while (((*((volatile unsigned long *)0x4000800C)) & 0x00000002) == 0) {
  };
  (*((volatile unsigned long *)0x40008008)) = output;
}


x86 assembly (clang, -O0):
<DAC_Out>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xfff,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
or     $0xc000,%eax
mov    %ax,-0x4(%rbp)
mov    $0x4000800c,%eax
mov    (%rax),%rax
and    $0x2,%rax
cmp    $0x0,%rax
jne    1140 <DAC_Out+0x40>
jmp    1125 <DAC_Out+0x25>
movzwl -0x4(%rbp),%eax
mov    %eax,%ecx
mov    $0x40008008,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DAC_Out>:
testq  $0x2,0x4000800c
je     1100 <DAC_Out>
and    $0xfff,%edi
or     $0xc000,%edi
mov    %rdi,0x40008008
40
ret

LLVM IR (-O0):
define void @DAC_Out(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = and i32 %5, 4095
%7 = trunc i32 %6 to i16
store i16 %7, i16* %3
%8 = load i16, i16* %3
%9 = zext i16 %8 to i32
%10 = or i32 %9, 49152
%11 = trunc i32 %10 to i16
store i16 %11, i16* %3
br label %12
12: ; preds = %16, %1
%13 = load volatile i64, i64* inttoptr (i64 1073774604 to i64*)
%14 = and i64 %13, 2
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12
br label %12
17: ; preds = %12
%18 = load i16, i16* %3
%19 = zext i16 %18 to i64
store volatile i64 %19, i64* inttoptr (i64 1073774600 to i64*)
ret void
}

LLVM IR (-O2):
define void @DAC_Out(i16 zeroext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 1073774604 to i64*)
%4 = and i64 %3, 2
%5 = icmp eq i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = and i16 %0, 4095
%8 = or i16 %7, -16384
%9 = zext i16 %8 to i64
store volatile i64 %9, i64* inttoptr (i64 1073774600 to i64*)
ret void
}
void rgb16(unsigned char *buf, unsigned short c) {
  int i;
  for (i = 0; i < 3; i++) {
    *buf++ = ((c >> (i * 5)) & 0x1f) << 3;
  }
}


x86 assembly (clang, -O0):
<rgb16>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1151 <rgb16+0x51>
movzwl -0xa(%rbp),%eax
imul   $0x5,-0x10(%rbp),%ecx
sar    %cl,%eax
and    $0x1f,%eax
shl    $0x3,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <rgb16+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb16>:
lea    0x0(,%rsi,8),%eax
mov    %al,(%rdi)
mov    %esi,%eax
shr    $0x2,%eax
and    $0xf8,%al
mov    %al,0x1(%rdi)
shr    $0x7,%esi
and    $0xf8,%sil
mov    %sil,0x2(%rdi)
ret

LLVM IR (-O0):
define void @rgb16(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i32
store i8* %0, i8** %3
store i16 %1, i16* %4
store i32 0, i32* %5
br label %6
6: ; preds = %20, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i16, i16* %4
%11 = zext i16 %10 to i32
%12 = load i32, i32* %5
%13 = mul nsw i32 %12, 5
%14 = ashr i32 %11, %13
%15 = and i32 %14, 31
%16 = shl i32 %15, 3
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
store i8 %17, i8* %18
br label %20
20: ; preds = %9
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %6
23: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @rgb16(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
%4 = shl i8 %3, 3
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %0
%6 = lshr i16 %1, 2
%7 = trunc i16 %6 to i8
%8 = and i8 %7, -8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %5
%10 = lshr i16 %1, 7
%11 = trunc i16 %10 to i8
%12 = and i8 %11, -8
store i8 %12, i8* %9
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
char *strerror(int);
char *strerror_l(int errnum, locale_t locale) {
  return strerror(errnum);
  (void)locale;
}


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

x86 assembly (clang, -O2):
<strerror_l>:
jmp    1030 <strerror@plt>

LLVM IR (-O0):
define i8* @strerror_l(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 = call i8* @strerror(i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @strerror_l(i32 %0, i32 %1) {
%3 = tail call i8* @strerror(i32 %0)
ret i8* %3
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
int randn(int n) { return (int)((float)n * (float)rand() / (float)RAND_MAX); }


x86 assembly (clang, -O0):
<randn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movss  -0x8(%rbp),%xmm0
cvtsi2ss %rax,%xmm1
mulss  %xmm1,%xmm0
mov    0x2ea7(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randn>:
push   %rax
cvtsi2ss %edi,%xmm0
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mov    0x2eb7(%rip),%rax
cvtsi2ssq (%rax),%xmm1
mulss  0x4(%rsp),%xmm0
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @randn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to float
%5 = call i64 (...) @rand()
%6 = sitofp i64 %5 to float
%7 = fmul float %4, %6
%8 = load i64, i64* @RAND_MAX
%9 = sitofp i64 %8 to float
%10 = fdiv float %7, %9
%11 = fptosi float %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @randn(i32 %0) {
%2 = sitofp i32 %0 to float
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to float
%5 = fmul float %2, %4
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to float
%8 = fdiv float %5, %7
%9 = fptosi float %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
gen_arithm_shift_right() {
  gen_pop();
  gen_call("ccasr");
}


x86 assembly (clang, -O0):
<gen_arithm_shift_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xeca(%rip),%rdi
call   1040 <gen_call@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_arithm_shift_right>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ccasr\00"
define i32 @gen_arithm_shift_right() {
%1 = alloca i32
%2 = call i32 (...) @gen_pop()
%3 = call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [6 x i8] c"ccasr\00"
define i32 @gen_arithm_shift_right() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ xoffset;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
int get_XImage_xoffset(void *_p) { return (int)((XImage *)_p)->xoffset; }


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

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

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

LLVM IR (-O2):
define i32 @get_XImage_xoffset(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ MCP4461_SetValue(int, int, char);
void setHeadStepper2Current(char current) {
  MCP4461_SetValue(0x58, 0x01, current);
}


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

x86 assembly (clang, -O2):
<setHeadStepper2Current>:
mov    %edi,%edx
mov    $0x58,%edi
mov    $0x1,%esi
jmp    1030 <MCP4461_SetValue@plt>

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

LLVM IR (-O2):
define void @setHeadStepper2Current(i8 signext %0) {
%2 = tail call i32 @MCP4461_SetValue(i32 88, i32 1, i8 signext %0)
ret void
}
void *param_double_init() {
  double *data = malloc(sizeof(double));
  from_double(data, 0.0);
  return data;
}


x86 assembly (clang, -O0):
<param_double_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xorps  %xmm0,%xmm0
mov    $0x1,%al
call   1030 <from_double@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<param_double_init>:
push   %rbx
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xorps  %xmm0,%xmm0
mov    %rax,%rdi
mov    $0x1,%al
call   1030 <from_double@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @param_double_init() {
%1 = alloca double*
%2 = call i8* @malloc(i64 8)
%3 = bitcast i8* %2 to double*
store double* %3, double** %1
%4 = load double*, double** %1
%5 = call i32 (double*, double, ...) bitcast (i32 (...)* @from_double to i32 (double*, double, ...)*)(double* %4, double 0.000000e+00)
%6 = load double*, double** %1
%7 = bitcast double* %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @param_double_init() {
%1 = tail call dereferenceable_or_null(8) i8* @malloc(i64 8)
%2 = bitcast i8* %1 to double*
%3 = tail call i32 (double*, double, ...) bitcast (i32 (...)* @from_double to i32 (double*, double, ...)*)(double* %2, double 0.000000e+00)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ SYS_brk;
scalar_t__ syscall(int /*<<< orphan*/, void *);
int brk(void *addr) {
  void *new_brk;
  new_brk = (void *)syscall(SYS_brk, addr);
  if (new_brk != addr)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<brk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <syscall@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     114c <brk+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <brk+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brk>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1030 <syscall@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@SYS_brk = global i32 0
define i32 @brk(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i32, i32* @SYS_brk
%6 = load i8*, i8** %3
%7 = call i64 @syscall(i32 %5, i8* %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = load i8*, i8** %3
%11 = icmp ne i8* %9, %10
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@SYS_brk = global i32 0
define i32 @brk(i8* %0) {
%2 = load i32, i32* @SYS_brk
%3 = tail call i64 @syscall(i32 %2, i8* %0)
%4 = inttoptr i64 %3 to i8*
%5 = icmp ne i8* %4, %0
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void _hello() { printf("%s", "Hello world!\n"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [14 x i8] c"Hello world!\0A\00"
define void @_hello() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int pthread_cond_wait() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_cond_wait() {
ret i32 0
}