xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char);
int /*<<< orphan*/ stderr;
void func(void *item, void *arg) {
  *((char *)item) = *((char *)arg);
  fprintf(stderr, "value = %s, arg = %c\n", (char *)((char *)item),
          *((char *)arg));
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rax
lea    0xebc(%rip),%rsi
movsbl (%rax),%ecx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
mov    %rdi,%rdx
mov    (%rsi),%al
mov    %al,(%rdi)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
movsbl (%rsi),%ecx
lea    0xed6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"value = %s, arg = %c\0A\00"
define void @func(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = load i8*, i8** %3
store i8 %6, i8* %7
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %9, i8 signext %11)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"value = %s, arg = %c\0A\00"
define void @func(i8* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = load i32, i32* @stderr
%5 = load i8, i8* %1
%6 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i8 signext %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_message(char header[]) {
  printf("%s\n", header);
  return;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @print_message(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_message(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct pptcapi_connection {
  int dummy;
};

/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *);
int pptcapi_authenticate(struct pptcapi_connection *connection, char **error) {
  *error = (char *)malloc(512);
  if (*error) {
    snprintf(*error, 512,
             "SSL Authentication not yet implemented in PPT C API");
  }
  return 2;
}


x86 assembly (clang, -O0):
<pptcapi_authenticate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x200,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     116a <pptcapi_authenticate+0x4a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x200,%esi
lea    0xe9b(%rip),%rdx
call   1030 <snprintf@plt>
mov    $0x2,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pptcapi_authenticate>:
push   %rbx
mov    %rsi,%rbx
mov    $0x200,%edi
call   1040 <malloc@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     114a <pptcapi_authenticate+0x2a>
lea    0xec3(%rip),%rdx
mov    %rax,%rdi
mov    $0x200,%esi
call   1030 <snprintf@plt>
mov    $0x2,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.pptcapi_connection = type { i32 }
@.str = [52 x i8] c"SSL Authentication not yet implemented in PPT C API\00"
define i32 @pptcapi_authenticate(%struct.pptcapi_connection* %0, i8** %1) {
%3 = alloca %struct.pptcapi_connection*
%4 = alloca i8**
store %struct.pptcapi_connection* %0, %struct.pptcapi_connection** %3
store i8** %1, i8*** %4
%5 = call i64 @malloc(i32 512)
%6 = inttoptr i64 %5 to i8*
%7 = load i8**, i8*** %4
store i8* %6, i8** %7
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8**, i8*** %4
%13 = load i8*, i8** %12
%14 = call i32 @snprintf(i8* %13, i32 512, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %11, %2
ret i32 2
}

LLVM IR (-O2):
%struct.pptcapi_connection = type { i32 }
@.str = [52 x i8] c"SSL Authentication not yet implemented in PPT C API\00"
define i32 @pptcapi_authenticate(%struct.pptcapi_connection* nocapture readnone %0, i8** nocapture writeonly %1) {
%3 = tail call i64 @malloc(i32 512)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = icmp eq i64 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @snprintf(i8* %4, i32 512, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret i32 2
}
void foo238() {}


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

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

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

LLVM IR (-O2):
define void @foo238() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ put1(char *);
int put2(char *);
int main(void) {
  put1("If I'd as much money");
  put1(" as I could spend,\n");
  printf("I count %d characters.\n",
         put2("I never would cry old chairs to mend."));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1050 <put1@plt>
lea    0xec3(%rip),%rdi
call   1050 <put1@plt>
lea    0xee3(%rip),%rdi
call   1030 <put2@plt>
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <put1@plt>
lea    0xed1(%rip),%rdi
call   1050 <put1@plt>
lea    0xef1(%rip),%rdi
call   1030 <put2@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"If I'd as much money\00"
@.str.1 = [20 x i8] c" as I could spend,\0A\00"
@.str.2 = [24 x i8] c"I count %d characters.\0A\00"
@.str.3 = [38 x i8] c"I never would cry old chairs to mend.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @put1(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @put1(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @put2(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"If I'd as much money\00"
@.str.1 = [20 x i8] c" as I could spend,\0A\00"
@.str.2 = [24 x i8] c"I count %d characters.\0A\00"
@.str.3 = [38 x i8] c"I never would cry old chairs to mend.\00"
define i32 @main() {
%1 = tail call i32 @put1(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @put1(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @put2(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret i32 0
}
void XSetWMIconName() {}


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

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

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

LLVM IR (-O2):
define void @XSetWMIconName() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *);
void consoleSimpleMessage(const char *text) {
  printf("\033[22;32m");
  printf(text);
  printf("\033[0m\n");
}


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

x86 assembly (clang, -O2):
<consoleSimpleMessage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[22;32m\00"
@str = [5 x i8] c"\1B[0m\00"
define void @consoleSimpleMessage(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
void account_system_time(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<account_system_time>:
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):
<account_system_time>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.account_system_time = [20 x i8] c"account_system_time\00"
define void @account_system_time() {
%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__.account_system_time, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.account_system_time = [20 x i8] c"account_system_time\00"
define void @account_system_time() {
%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__.account_system_time, i64 0, i64 0))
ret void
}
int function(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<function>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @function(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @function(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ CONS_Printf(char *, int, int, int);
void Command_ModDetails_f(void) {
  CONS_Printf(("Mod ID: %d\nMod Version: %d\nCode Base:%d\n"), 12, 19, 210);
}


x86 assembly (clang, -O0):
<Command_ModDetails_f>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xc,%esi
mov    $0x13,%edx
mov    $0xd2,%ecx
call   1030 <CONS_Printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Command_ModDetails_f>:
lea    0xee9(%rip),%rdi
mov    $0xc,%esi
mov    $0x13,%edx
mov    $0xd2,%ecx
jmp    1030 <CONS_Printf@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Mod ID: %d\0AMod Version: %d\0ACode Base:%d\0A\00"
define void @Command_ModDetails_f() {
%1 = call i32 @CONS_Printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 12, i32 19, i32 210)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"Mod ID: %d\0AMod Version: %d\0ACode Base:%d\0A\00"
define void @Command_ModDetails_f() {
%1 = tail call i32 @CONS_Printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 12, i32 19, i32 210)
ret void
}
double my_abs(double num) { return num > 0 ? num : num * (-1); }


x86 assembly (clang, -O0):
<my_abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112a <my_abs+0x2a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    113c <my_abs+0x3c>
movsd  0xece(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @my_abs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load double, double* %2
br label %10
7: ; preds = %1
%8 = load double, double* %2
%9 = fmul double %8, -1.000000e+00
br label %10
10: ; preds = %7, %5
%11 = phi double [ %6, %5 ], [ %9, %7 ]
ret double %11
}

LLVM IR (-O2):
define double @my_abs(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
ret double %4
}
void preempt_schedule(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<preempt_schedule>:
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):
<preempt_schedule>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

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

LLVM IR (-O2):
@__func__.preempt_schedule = [17 x i8] c"preempt_schedule\00"
define void @preempt_schedule() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.preempt_schedule, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cblas_sscal(int const, float const, float *, int const);
void c_sscal(const int N, const float alpha, float *X, const int stride) {
  cblas_sscal(N, alpha, X, stride);
}


x86 assembly (clang, -O0):
<c_sscal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
movss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <cblas_sscal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_sscal>:
jmp    1030 <cblas_sscal@plt>

LLVM IR (-O0):
define void @c_sscal(i32 %0, float %1, float* %2, i32 %3) {
%5 = alloca i32
%6 = alloca float
%7 = alloca float*
%8 = alloca i32
store i32 %0, i32* %5
store float %1, float* %6
store float* %2, float** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load float, float* %6
%11 = load float*, float** %7
%12 = load i32, i32* %8
%13 = call i32 @cblas_sscal(i32 %9, float %10, float* %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @c_sscal(i32 %0, float %1, float* %2, i32 %3) {
%5 = tail call i32 @cblas_sscal(i32 %0, float %1, float* %2, i32 %3)
ret void
}
void Srand(long *idum) {
  *idum = (long)({
    unsigned int lo;
    unsigned int hi;
    __asm__ __volatile__("rdtsc" : "=a"(lo), "=d"(hi));
    ((unsigned long long)hi) << 32 | lo;
  });
}


x86 assembly (clang, -O0):
<Srand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
rdtsc
mov    %eax,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x20,%rax
mov    -0xc(%rbp),%ecx
or     %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Srand>:
rdtsc
shl    $0x20,%rdx
mov    %eax,%eax
or     %rdx,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @Srand(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i64* %0, i64** %2
%6 = call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %3
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = shl i64 %10, 32
%12 = load i32, i32* %3
%13 = zext i32 %12 to i64
%14 = or i64 %11, %13
store i64 %14, i64* %5
%15 = load i64, i64* %5
%16 = load i64*, i64** %2
store i64 %15, i64* %16
ret void
}

LLVM IR (-O2):
define void @Srand(i64* nocapture writeonly %0) {
%2 = tail call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%3 = extractvalue { i32, i32 } %2, 0
%4 = extractvalue { i32, i32 } %2, 1
%5 = zext i32 %4 to i64
%6 = shl nuw i64 %5, 32
%7 = zext i32 %3 to i64
%8 = or i64 %6, %7
store i64 %8, i64* %0
ret void
}
int c058(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c058() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ baz();
int /*<<< orphan*/ corge();
int /*<<< orphan*/ foo(int *);
int /*<<< orphan*/ quux();
int /*<<< orphan*/ qux(int *);
int main() {
  int a[10] = {};
  foo(a);
  bar();
  baz();
  for (int i = 0; i < 10; i++)
    a[i] = 0;
  qux(a);
  quux();
  corge();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
lea    -0x30(%rbp),%rdi
call   1080 <foo@plt>
mov    $0x0,%al
call   1040 <bar@plt>
mov    $0x0,%al
call   1030 <baz@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    11d1 <main+0x61>
movslq -0x34(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11ad <main+0x3d>
lea    -0x30(%rbp),%rdi
call   1060 <qux@plt>
mov    $0x0,%al
call   1090 <quux@plt>
mov    $0x0,%al
call   1070 <corge@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x20(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1070 <foo@plt>
xor    %eax,%eax
call   1040 <bar@plt>
xor    %eax,%eax
call   1030 <baz@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
mov    %rbx,%rdi
call   1050 <qux@plt>
xor    %eax,%eax
call   1080 <quux@plt>
xor    %eax,%eax
call   1060 <corge@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = call i32 @foo(i32* %5)
%7 = call i32 (...) @bar()
%8 = call i32 (...) @baz()
store i32 0, i32* %3
br label %9
9: ; preds = %16, %0
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %14
store i32 0, i32* %15
br label %16
16: ; preds = %12
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %9
19: ; preds = %9
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%21 = call i32 @qux(i32* %20)
%22 = call i32 (...) @quux()
%23 = call i32 (...) @corge()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32* %3)
%5 = call i32 (...) @bar()
%6 = call i32 (...) @baz()
%7 = call i32 @qux(i32* %3)
%8 = call i32 (...) @quux()
%9 = call i32 (...) @corge()
ret i32 0
}
int power(int num, int exp) {
  if (exp == 0)
    return (1);
  if (exp == 1)
    return (num);
  int temp = power(num, exp / 2);
  temp *= temp;
  if (exp % 2 == 1)
    temp *= num;
  return (temp);
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1134 <power+0x24>
movl   $0x1,-0x4(%rbp)
jmp    118f <power+0x7f>
cmpl   $0x1,-0xc(%rbp)
jne    1149 <power+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    118f <power+0x7f>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <power@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1189 <power+0x79>
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
je     1151 <power+0x41>
mov    %esi,%ebp
mov    %edi,%r14d
cmp    $0x1,%esi
je     1157 <power+0x47>
mov    %ebp,%ebx
shr    $0x1f,%ebx
add    %ebp,%ebx
mov    %ebx,%esi
sar    %esi
mov    %r14d,%edi
call   1030 <power@plt>
and    $0xfffffffe,%ebx
sub    %ebx,%ebp
cmp    $0x1,%ebp
mov    $0x1,%ecx
cmove  %r14d,%ecx
imul   %eax,%eax
imul   %ecx,%eax
mov    %eax,%r14d
jmp    1157 <power+0x47>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @power(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %32
10: ; preds = %2
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load i32, i32* %4
store i32 %14, i32* %3
br label %32
15: ; preds = %10
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = sdiv i32 %17, 2
%19 = call i32 @power(i32 %16, i32 %18)
store i32 %19, i32* %6
%20 = load i32, i32* %6
%21 = load i32, i32* %6
%22 = mul nsw i32 %21, %20
store i32 %22, i32* %6
%23 = load i32, i32* %5
%24 = srem i32 %23, 2
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %30
26: ; preds = %15
%27 = load i32, i32* %4
%28 = load i32, i32* %6
%29 = mul nsw i32 %28, %27
store i32 %29, i32* %6
br label %30
30: ; preds = %26, %15
%31 = load i32, i32* %6
store i32 %31, i32* %3
br label %32
32: ; preds = %30, %13, %9
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @power(i32 %0, i32 %1) {
switch i32 %1, label %6 [
i32 0, label %4
i32 1, label %3
]
3: ; preds = %2
br label %4
4: ; preds = %3, %2, %6
%5 = phi i32 [ %13, %6 ], [ %0, %3 ], [ 1, %2 ]
ret i32 %5
6: ; preds = %2
%7 = sdiv i32 %1, 2
%8 = tail call i32 @power(i32 %0, i32 %7)
%9 = srem i32 %1, 2
%10 = icmp eq i32 %9, 1
%11 = select i1 %10, i32 %0, i32 1
%12 = mul i32 %8, %11
%13 = mul i32 %12, %8
br label %4
}
/* Variables and functions */
scalar_t__ lrint(double);
long lrintl(long double x) { return (long double)lrint((double)x); }


x86 assembly (clang, -O0):
<lrintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <lrint@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrintl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <lrint@plt>

LLVM IR (-O0):
define i64 @lrintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @lrint(double %4)
%6 = sitofp i64 %5 to x86_fp80
%7 = fptosi x86_fp80 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @lrintl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @lrint(double %2)
ret i64 %3
}
void XcmsCIELuvQueryMinL() {}


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

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

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

LLVM IR (-O2):
define void @XcmsCIELuvQueryMinL() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ g(int);
int /*<<< orphan*/ h(int);
void main(int foo) {
  f(1);
  f(1);
  g(2);
  g(2);
  if (1) {
    h(3);
  } else {
    h(4);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <f@plt>
mov    $0x1,%edi
call   1040 <f@plt>
mov    $0x2,%edi
call   1050 <g@plt>
mov    $0x2,%edi
call   1050 <g@plt>
mov    $0x3,%edi
call   1030 <h@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <f@plt>
mov    $0x1,%edi
call   1040 <f@plt>
mov    $0x2,%edi
call   1050 <g@plt>
mov    $0x2,%edi
call   1050 <g@plt>
mov    $0x3,%edi
pop    %rax
jmp    1030 <h@plt>

LLVM IR (-O0):
define void @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @f(i32 1)
%4 = call i32 @f(i32 1)
%5 = call i32 @g(i32 2)
%6 = call i32 @g(i32 2)
%7 = call i32 @h(i32 3)
ret void
}

LLVM IR (-O2):
define void @main(i32 %0) {
%2 = tail call i32 @f(i32 1)
%3 = tail call i32 @f(i32 1)
%4 = tail call i32 @g(i32 2)
%5 = tail call i32 @g(i32 2)
%6 = tail call i32 @h(i32 3)
ret void
}
signed char foo(signed char si1, signed char si2) { return si1 * si2; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
imul   %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %esi,%eax
mul    %dil
ret

LLVM IR (-O0):
define signext i8 @foo(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = mul nsw i32 %6, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @foo(i8 signext %0, i8 signext %1) {
%3 = mul i8 %1, %0
ret i8 %3
}
long lmin(long a, long b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<lmin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <lmin+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <lmin+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmin>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @lmin(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
unsigned int dict_hash(const char *str) {
  unsigned int hash = 5381;
  for (int i = 0; str[i]; i++) {
    hash = ((hash << 5) + hash) ^ str[i];
  }
  return hash;
}


x86 assembly (clang, -O0):
<dict_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1150 <dict_hash+0x50>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <dict_hash+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dict_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <dict_hash+0x28>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movsbl %cl,%eax
xor    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <dict_hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @dict_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i32 [ 5381, %1 ], [ %12, %6 ]
ret i32 %5
6: ; preds = %1, %6
%7 = phi i64 [ %13, %6 ], [ 0, %1 ]
%8 = phi i8 [ %15, %6 ], [ %2, %1 ]
%9 = phi i32 [ %12, %6 ], [ 5381, %1 ]
%10 = mul i32 %9, 33
%11 = sext i8 %8 to i32
%12 = xor i32 %10, %11
%13 = add nuw nsw i64 %7, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %4, label %6
}
/* Variables and functions */
int syscall(int, void *, void *);
int capset(void *a, void *b) { return syscall(185, a, b); }


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

x86 assembly (clang, -O2):
<capset>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xb9,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @capset(i8* %0, i8* %1) {
%3 = tail call i32 @syscall(i32 185, i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int ceil(double);
int gdSize(int numgts) {
  return 0x00000080 * ceil((double)numgts / 0x00000080);
}


x86 assembly (clang, -O0):
<gdSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <ceil@plt>
shl    $0x7,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdSize>:
push   %rax
cvtsi2sd %edi,%xmm0
mulsd  0xee3(%rip),%xmm0
call   1030 <ceil@plt>
shl    $0x7,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gdSize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 1.280000e+02
%6 = call i32 @ceil(double %5)
%7 = mul nsw i32 128, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @gdSize(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 7.812500e-03
%4 = tail call i32 @ceil(double %3)
%5 = shl nsw i32 %4, 7
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int system(char *);
int main(int argc, char *argv[]) {
  int retval = system(argv[1]);
  printf("return val = %d\n", retval);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <system@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <system@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"return val = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @system(i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"return val = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @system(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int check(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  printf("Enter the number:\n");
  scanf("%d", &x);
  return check(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <check@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <check@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [18 x i8] c"Enter the number:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @check(i32 %5)
ret i32 %6
}
/* Variables and functions */
int ldl_he_p(void const *);
int ldl_le_p(const void *ptr) { return (ldl_he_p(ptr)); }


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

x86 assembly (clang, -O2):
<ldl_le_p>:
jmp    1030 <ldl_he_p@plt>

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

LLVM IR (-O2):
define i32 @ldl_le_p(i8* %0) {
%2 = tail call i32 @ldl_he_p(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ sd_part(long);
int /*<<< orphan*/ sd_psupp(long);
long sd_part_psupp(long skip_count) {
  sd_part(skip_count);
  sd_psupp(skip_count * 4);
  return (0);
}


x86 assembly (clang, -O0):
<sd_part_psupp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sd_part@plt>
mov    -0x8(%rbp),%rdi
shl    $0x2,%rdi
call   1030 <sd_psupp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_part_psupp>:
push   %rbx
mov    %rdi,%rbx
call   1040 <sd_part@plt>
shl    $0x2,%rbx
mov    %rbx,%rdi
call   1030 <sd_psupp@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @sd_part_psupp(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @sd_part(i64 %3)
%5 = load i64, i64* %2
%6 = mul nsw i64 %5, 4
%7 = call i32 @sd_psupp(i64 %6)
ret i64 0
}

LLVM IR (-O2):
define i64 @sd_part_psupp(i64 %0) {
%2 = tail call i32 @sd_part(i64 %0)
%3 = shl nsw i64 %0, 2
%4 = tail call i32 @sd_psupp(i64 %3)
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int main(int ac, const char *av[]) {
  if (ac != 2)
    return -1;
  printf("Input size = %ld\n", strlen(av[1]));
  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)
cmpl   $0x2,-0x8(%rbp)
je     114c <main+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <main+0x4e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xffffffff,%eax
cmp    $0x2,%edi
jne    1148 <main+0x28>
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <strlen@plt>
lea    0xec5(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Input size = %ld\0A\00"
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 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 -1, i32* %3
br label %15
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %13)
store i32 0, i32* %3
br label %15
15: ; preds = %9, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [18 x i8] c"Input size = %ld\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strlen(i8* %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ 0, %4 ], [ -1, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
m_sub() {
  ol("SUB  BX,AX");
  ol("MOV  AX,BX");
}


x86 assembly (clang, -O0):
<m_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
lea    0xee0(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"SUB BX,AX\00"
@.str.1 = [11 x i8] c"MOV AX,BX\00"
define i32 @m_sub() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [11 x i8] c"SUB BX,AX\00"
@.str.1 = [11 x i8] c"MOV AX,BX\00"
define i32 @m_sub() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
unsigned int hamdist_uint(unsigned int x, unsigned int y) {
  unsigned dist = 0, val = x ^ y;
  while (val) {
    ++dist;
    val &= val - 1;
  }
  return dist;
}


x86 assembly (clang, -O0):
<hamdist_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     113e <hamdist_uint+0x3e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    111a <hamdist_uint+0x1a>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hamdist_uint>:
xor    %eax,%eax
xor    %esi,%edi
je     111c <hamdist_uint+0x1c>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <hamdist_uint+0x10>
ret

LLVM IR (-O0):
define i32 @hamdist_uint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = xor i32 %7, %8
store i32 %9, i32* %6
br label %10
10: ; preds = %13, %2
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add i32 %14, 1
store i32 %15, i32* %5
%16 = load i32, i32* %6
%17 = sub i32 %16, 1
%18 = load i32, i32* %6
%19 = and i32 %18, %17
store i32 %19, i32* %6
br label %10
20: ; preds = %10
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @hamdist_uint(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %10, %5 ], [ %3, %2 ]
%7 = phi i32 [ %8, %5 ], [ 0, %2 ]
%8 = add i32 %7, 1
%9 = add i32 %6, -1
%10 = and i32 %9, %6
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %13
}
int leapyear(int year) {
  if ((year & 3) == 0 && ((year % 25) != 0 || (year & 15) == 0)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<leapyear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
jne    1145 <leapyear+0x45>
mov    -0x8(%rbp),%eax
mov    $0x19,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1139 <leapyear+0x39>
mov    -0x8(%rbp),%eax
and    $0xf,%eax
cmp    $0x0,%eax
jne    1145 <leapyear+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <leapyear+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leapyear>:
test   $0x3,%dil
jne    1124 <leapyear+0x24>
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb851,%ecx
mov    $0x1,%eax
cmp    $0xa3d70a2,%ecx
ja     1126 <leapyear+0x26>
and    $0xf,%edi
je     1126 <leapyear+0x26>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @leapyear(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 25
%10 = icmp ne i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = and i32 %12, 15
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11, %7
store i32 1, i32* %2
br label %17
16: ; preds = %11, %1
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @leapyear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = srem i32 %0, 25
%6 = icmp ne i32 %5, 0
%7 = and i32 %0, 15
%8 = icmp eq i32 %7, 0
%9 = or i1 %6, %8
br i1 %9, label %11, label %10
10: ; preds = %4, %1
br label %11
11: ; preds = %4, %10
%12 = phi i32 [ 0, %10 ], [ 1, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void call_protocol() { fflush(stdout); }


x86 assembly (clang, -O0):
<call_protocol>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_protocol>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @call_protocol() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @call_protocol() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_qm_l_socket();
int /*<<< orphan*/ init_web_l_socket();
void init_sockets(void) {
  init_qm_l_socket();
  init_web_l_socket();
}


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

x86 assembly (clang, -O2):
<init_sockets>:
push   %rax
xor    %eax,%eax
call   1040 <init_qm_l_socket@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <init_web_l_socket@plt>

LLVM IR (-O0):
define void @init_sockets() {
%1 = call i32 (...) @init_qm_l_socket()
%2 = call i32 (...) @init_web_l_socket()
ret void
}

LLVM IR (-O2):
define void @init_sockets() {
%1 = tail call i32 (...) @init_qm_l_socket()
%2 = tail call i32 (...) @init_web_l_socket()
ret void
}
double pair_tailcorr_cut_ei(void *pair_data, long center_index,
                            long other_index, double rcut) {
  double t1 = 0.0;
  return t1;
}


x86 assembly (clang, -O0):
<pair_tailcorr_cut_ei>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @pair_tailcorr_cut_ei(i8* %0, i64 %1, i64 %2, double %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca double
%9 = alloca double
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store double %3, double* %8
store double 0.000000e+00, double* %9
%10 = load double, double* %9
ret double %10
}

LLVM IR (-O2):
define double @pair_tailcorr_cut_ei(i8* nocapture readnone %0, i64 %1, i64 %2, double %3) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void bitwise_toggle(int number, int bitshift) {
  int newnumber = number;
  printf("bitwise toggle %i ^= 1 << %i : %i\n", number, bitshift,
         newnumber ^= 1 << bitshift);
}


x86 assembly (clang, -O0):
<bitwise_toggle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    -0xc(%rbp),%ecx
mov    %ecx,-0xc(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitwise_toggle>:
mov    %esi,%edx
mov    %edi,%ecx
btc    %esi,%ecx
lea    0xee2(%rip),%rax
mov    %edi,%esi
mov    %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"bitwise toggle %i ^= 1 << %i : %i\0A\00"
define void @bitwise_toggle(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
store i32 %6, i32* %5
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = load i32, i32* %4
%10 = shl i32 1, %9
%11 = load i32, i32* %5
%12 = xor i32 %11, %10
store i32 %12, i32* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"bitwise toggle %i ^= 1 << %i : %i\0A\00"
define void @bitwise_toggle(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %4)
ret void
}