xunge/DecIR huggingface dataset:
void build_n(const double *u, const unsigned int k, double *n) {
  n[0] = u[0] * u[0] * 0.5 + u[1] * u[1] * 0.5 - 7.569;
}


x86 assembly (clang, -O0):
<build_n>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm1
movsd  0xecf(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xec3(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xeab(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_n>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
movsd  0xee7(%rip),%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  0xedb(%rip),%xmm0
movsd  %xmm0,(%rdx)
ret

LLVM IR (-O0):
define void @build_n(double* %0, i32 %1, double* %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca double*
store double* %0, double** %4
store i32 %1, i32* %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fmul double %9, %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = fmul double %16, %19
%21 = fmul double %20, 5.000000e-01
%22 = call double @llvm.fmuladd.f64(double %13, double 5.000000e-01, double %21)
%23 = fsub double %22, 0x401E46A7EF9DB22D
%24 = load double*, double** %6
%25 = getelementptr inbounds double, double* %24, i64 0
store double %23, double* %25
ret void
}

LLVM IR (-O2):
define void @build_n(double* nocapture %0, i32 %1, double* nocapture writeonly %2) {
%4 = load double, double* %0
%5 = fmul double %4, %4
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = fmul double %7, %7
%9 = fmul double %8, 5.000000e-01
%10 = tail call double @llvm.fmuladd.f64(double %5, double 5.000000e-01, double %9)
%11 = fadd double %10, 0xC01E46A7EF9DB22D
store double %11, double* %2
ret void
}
/* Variables and functions */
int *malloc(int);
int *realloc(int *, int /*<<< orphan*/);
void f2_realloc_1() {
  int *p = malloc(12);
  int *q = realloc(p, 0);
}


x86 assembly (clang, -O0):
<f2_realloc_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <realloc@plt>
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2_realloc_1>:
push   %rax
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,%rdi
xor    %esi,%esi
pop    %rax
jmp    1040 <realloc@plt>

LLVM IR (-O0):
define void @f2_realloc_1() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* @malloc(i32 12)
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32* @realloc(i32* %4, i32 0)
store i32* %5, i32** %2
ret void
}

LLVM IR (-O2):
define void @f2_realloc_1() {
%1 = tail call i32* @malloc(i32 12)
%2 = tail call i32* @realloc(i32* %1, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EC_KEY;

/* Variables and functions */
int /*<<< orphan*/ *EC_KEY_new_by_curve_name_ex(int /*<<< orphan*/ *, int);
EC_KEY *EC_KEY_new_by_curve_name(int nid) {
  return EC_KEY_new_by_curve_name_ex(NULL, nid);
}


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

x86 assembly (clang, -O2):
<EC_KEY_new_by_curve_name>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <EC_KEY_new_by_curve_name_ex@plt>

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

LLVM IR (-O2):
define i32* @EC_KEY_new_by_curve_name(i32 %0) {
%2 = tail call i32* @EC_KEY_new_by_curve_name_ex(i32* null, i32 %0)
ret i32* %2
}
void SHA256_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @SHA256_Init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void showViolatesModernConventionMessage(char *value) {
  fprintf(stderr, "Error. Numeral string '%s' violates modern convention.\n",
          value);
}


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

x86 assembly (clang, -O2):
<showViolatesModernConventionMessage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"Error. Numeral string '%s' violates modern convention.\0A\00"
define void @showViolatesModernConventionMessage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"Error. Numeral string '%s' violates modern convention.\0A\00"
define void @showViolatesModernConventionMessage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void DMA1_Channel2_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @DMA1_Channel2_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo(int /*<<< orphan*/);
int main(void) {
  if (foo(0) != -4)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <foo@plt>
cmp    $0xfffffffc,%eax
je     1146 <main+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <foo@plt>
cmp    $0xfffffffc,%eax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 0)
%3 = icmp ne i32 %2, -4
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0)
%2 = icmp eq i32 %1, -4
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
double strtod(char const *, char **);
double r_strtod(const char *s, char **endptr) { return strtod(s, endptr); }


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

x86 assembly (clang, -O2):
<r_strtod>:
jmp    1030 <strtod@plt>

LLVM IR (-O0):
define double @r_strtod(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 double @strtod(i8* %5, i8** %6)
ret double %7
}

LLVM IR (-O2):
define double @r_strtod(i8* %0, i8** nocapture %1) {
%3 = tail call double @strtod(i8* %0, i8** %1)
ret double %3
}
int Xor(int x, int y, int z) { return x ^ y; }


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

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

LLVM IR (-O0):
define i32 @Xor(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = xor i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @Xor(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, %0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void close_dmpfile(FILE *fp) { fclose(fp); }


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

x86 assembly (clang, -O2):
<close_dmpfile>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @close_dmpfile(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret void
}
/* Variables and functions */
int fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void bh_pager(void) {
  int c;
  fprintf(stdout, "\n<Press Enter for more>");
  while ((c = fgetc(stdin)) != '\n')
    ;
}


x86 assembly (clang, -O0):
<bh_pager>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %eax,-0x4(%rbp)
cmp    $0xa,%eax
je     115c <bh_pager+0x3c>
jmp    113d <bh_pager+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bh_pager>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2eab(%rip),%rbx
nopl   (%rax)
mov    (%rbx),%edi
call   1030 <fgetc@plt>
cmp    $0xa,%eax
jne    1140 <bh_pager+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [24 x i8] c"\0A<Press Enter for more>\00"
@stdin = global i32 0
define void @bh_pager() {
%1 = alloca i32
%2 = load i32, i32* @stdout
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* @stdin
%6 = call i32 @fgetc(i32 %5)
store i32 %6, i32* %1
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [24 x i8] c"\0A<Press Enter for more>\00"
@stdin = global i32 0
define void @bh_pager() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
%4 = load i32, i32* @stdin
%5 = tail call i32 @fgetc(i32 %4)
%6 = icmp eq i32 %5, 10
br i1 %6, label %7, label %3
7: ; preds = %3
ret void
}
/* Variables and functions */
unsigned char proto_assembleFrame(unsigned char *, unsigned short *,
                                  unsigned char *, int, int, int,
                                  unsigned char *);
unsigned char protoX_readOneMeter(unsigned char *buf, unsigned short *bufSize,
                                  unsigned char *gatewayId,
                                  unsigned short *pMeterId) {
  return proto_assembleFrame(buf, bufSize, gatewayId, 0x00, 0x06, 2,
                             (unsigned char *)pMeterId);
}


x86 assembly (clang, -O0):
<protoX_readOneMeter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
xor    %ecx,%ecx
mov    $0x6,%r8d
mov    $0x2,%r9d
mov    %rax,(%rsp)
call   1030 <proto_assembleFrame@plt>
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<protoX_readOneMeter>:
push   %rax
mov    %rcx,(%rsp)
xor    %ecx,%ecx
mov    $0x6,%r8d
mov    $0x2,%r9d
call   1030 <proto_assembleFrame@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @protoX_readOneMeter(i8* %0, i16* %1, i8* %2, i16* %3) {
%5 = alloca i8*
%6 = alloca i16*
%7 = alloca i8*
%8 = alloca i16*
store i8* %0, i8** %5
store i16* %1, i16** %6
store i8* %2, i8** %7
store i16* %3, i16** %8
%9 = load i8*, i8** %5
%10 = load i16*, i16** %6
%11 = load i8*, i8** %7
%12 = load i16*, i16** %8
%13 = bitcast i16* %12 to i8*
%14 = call zeroext i8 @proto_assembleFrame(i8* %9, i16* %10, i8* %11, i32 0, i32 6, i32 2, i8* %13)
ret i8 %14
}

LLVM IR (-O2):
define zeroext i8 @protoX_readOneMeter(i8* %0, i16* %1, i8* %2, i16* %3) {
%5 = bitcast i16* %3 to i8*
%6 = tail call zeroext i8 @proto_assembleFrame(i8* %0, i16* %1, i8* %2, i32 0, i32 6, i32 2, i8* %5)
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ showfile(char *);
void subfunc1(void) { showfile("..\\demos\\tui.c"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"..\\demos\\tui.c\00"
define void @subfunc1() {
%1 = call i32 @showfile(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"..\\demos\\tui.c\00"
define void @subfunc1() {
%1 = tail call i32 @showfile(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
void flex_free(ptr) void *ptr;
{
  if (ptr)
    free(ptr);
}


x86 assembly (clang, -O0):
<flex_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <flex_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flex_free>:
test   %rdi,%rdi
je     111a <flex_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @flex_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i8*, i8** %2
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @flex_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
tail call void @free(i8* %0)
br label %4
4: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *prg_name) {
  printf("\nUsage: %s [-r] [-c] [-h] [-v]"
         "\n\n"
         "Launch an alarm on your computer to wake up early on the morning.\n\n"
         "optional arguments:\n"
         "\t   -c   --challenge   switch challenge off. Only with god mod "
         "enabled ad compile time\n"
         "\t   -r   --robot       don't launch the challenge, don't stop the "
         "current alarm\n"
         "\t   -h   --help        print this help\n"
         "\t   -v   --version     get version and compile option\n"
         "\n",
         prg_name);
}


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

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

LLVM IR (-O0):
@.str = [381 x i8] c"\0AUsage: %s [-r] [-c] [-h] [-v]\0A\0ALaunch an alarm on your computer to wake up early on the morning.\0A\0Aoptional arguments:\0A\09 -c --challenge switch challenge off. Only with god mod enabled ad compile time\0A\09 -r --robot don't launch the challenge, don't stop the current alarm\0A\09 -h --help print this help\0A\09 -v --version get version and compile option\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([381 x i8], [381 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [381 x i8] c"\0AUsage: %s [-r] [-c] [-h] [-v]\0A\0ALaunch an alarm on your computer to wake up early on the morning.\0A\0Aoptional arguments:\0A\09 -c --challenge switch challenge off. Only with god mod enabled ad compile time\0A\09 -r --robot don't launch the challenge, don't stop the current alarm\0A\09 -h --help print this help\0A\09 -v --version get version and compile option\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([381 x i8], [381 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int /*<<< orphan*/ hea_set_u64_bits(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void hea_cq_aer_eq_disabled_err_reset(__u64 *aer) {
  *aer = hea_set_u64_bits(*aer, 0, 10, 10);
}


x86 assembly (clang, -O0):
<hea_cq_aer_eq_disabled_err_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    $0xa,%ecx
mov    %ecx,%edx
call   1030 <hea_set_u64_bits@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hea_cq_aer_eq_disabled_err_reset>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
xor    %esi,%esi
mov    $0xa,%edx
mov    $0xa,%ecx
call   1030 <hea_set_u64_bits@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @hea_cq_aer_eq_disabled_err_reset(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @hea_set_u64_bits(i32 %2, i32 0, i32 10, i32 10)
store i32 %3, i32* %0
ret void
}
int func(int n) {
  int sum = 0, i;
  for (i = 0; i < n; i++) {
    sum += i;
  }
  return sum;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <func+0x38>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <func+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
test   %edi,%edi
jle    1118 <func+0x18>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,1),%eax
add    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @func(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %13
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i33
%6 = add nsw i32 %0, -2
%7 = zext i32 %6 to i33
%8 = mul i33 %5, %7
%9 = lshr i33 %8, 1
%10 = trunc i33 %9 to i32
%11 = add i32 %10, %0
%12 = add i32 %11, -1
br label %13
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %12, %3 ]
ret i32 %14
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ text;
};
typedef TYPE_1__ XIMPreeditDrawCallbackStruct;

/* Variables and functions */
void *get_XIMPreeditDrawCallbackStruct_text(void *_p) {
  return (void *)((XIMPreeditDrawCallbackStruct *)_p)->text;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XIMPreeditDrawCallbackStruct_text(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 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XIMPreeditDrawCallbackStruct_text(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void debug_dummy(int dummy, ...) { (void)dummy; }


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

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

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

LLVM IR (-O2):
define void @debug_dummy(i32 %0, ...) {
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int nanosleep(struct timespec *, int /*<<< orphan*/ *);
int nanodelay(int sec, int nsec) {
  struct timespec t;
  t.tv_sec = sec;
  t.tv_nsec = nsec;
  return nanosleep(&t, NULL);
}


x86 assembly (clang, -O0):
<nanodelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nanodelay>:
push   %rax
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i32 @nanodelay(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.timespec
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
store i32 %6, i32* %7
%8 = load i32, i32* %4
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
store i32 %8, i32* %9
%10 = call i32 @nanosleep(%struct.timespec* %5, i32* null)
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i32 @nanodelay(i32 %0, i32 %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to i8*
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 1
store i32 %1, i32* %6
%7 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ ByteSwap64(int /*<<< orphan*/);
uint64_t ToBE64(uint64_t value) { return ByteSwap64(value); }


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

x86 assembly (clang, -O2):
<ToBE64>:
jmp    1030 <ByteSwap64@plt>

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

LLVM IR (-O2):
define i32 @ToBE64(i32 %0) {
%2 = tail call i32 @ByteSwap64(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
unsigned int UINT64_C(int);
void set_flag(uint64_t *array, unsigned int idx) {
  array[idx >> 6] |= (UINT64_C(1) << (idx & 0x3f));
}


x86 assembly (clang, -O0):
<set_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%edx
mov    -0xc(%rbp),%ecx
and    $0x3f,%ecx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x6,%ecx
mov    %ecx,%ecx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_flag>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    $0x1,%edi
call   1030 <UINT64_C@plt>
mov    %ebx,%ecx
shl    %cl,%eax
shr    $0x6,%ebx
or     %eax,(%r14,%rbx,4)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @set_flag(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 @UINT64_C(i32 1)
%6 = load i32, i32* %4
%7 = and i32 %6, 63
%8 = shl i32 %5, %7
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = lshr i32 %10, 6
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i32, i32* %13
%15 = or i32 %14, %8
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @set_flag(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @UINT64_C(i32 1)
%4 = and i32 %1, 63
%5 = shl i32 %3, %4
%6 = lshr i32 %1, 6
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = or i32 %9, %5
store i32 %10, i32* %8
ret void
}
/* Variables and functions */
double fmax(double, int /*<<< orphan*/);
int /*<<< orphan*/ fmin(double, double);
double fclamp(double v, double minv, double maxv) {
  return fmax(minv, fmin(v, maxv));
}


x86 assembly (clang, -O0):
<fclamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <fmin@plt>
movsd  -0x20(%rbp),%xmm0
mov    %eax,%edi
call   1040 <fmax@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fclamp>:
push   %rax
movsd  %xmm1,(%rsp)
movaps %xmm2,%xmm1
call   1030 <fmin@plt>
movsd  (%rsp),%xmm0
mov    %eax,%edi
pop    %rax
jmp    1040 <fmax@plt>

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

LLVM IR (-O2):
define double @fclamp(double %0, double %1, double %2) {
%4 = tail call i32 @fmin(double %0, double %2)
%5 = tail call double @fmax(double %1, i32 %4)
ret double %5
}
void gtk_table_get_default_col_spacing() {}


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

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

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

LLVM IR (-O2):
define void @gtk_table_get_default_col_spacing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int /*<<< orphan*/);
void io_wait(void) { outb(0x80, 0); }


x86 assembly (clang, -O0):
<io_wait>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%edi
xor    %esi,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_wait>:
mov    $0x80,%edi
xor    %esi,%esi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @io_wait() {
%1 = call i32 @outb(i32 128, i32 0)
ret void
}

LLVM IR (-O2):
define void @io_wait() {
%1 = tail call i32 @outb(i32 128, i32 0)
ret void
}
void XCheckWindowEvent() {}


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

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

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

LLVM IR (-O2):
define void @XCheckWindowEvent() {
ret void
}
/* Variables and functions */
int f(int);
g(int i) { return 2 * f(i); }


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

x86 assembly (clang, -O2):
<g>:
push   %rax
call   1030 <f@plt>
add    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = tail call i32 @f(i32 %0)
%3 = shl nsw i32 %2, 1
ret i32 %3
}
void EVP_DigestFinal(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_DigestFinal() {
ret void
}
/* Variables and functions */
float sqrt(float);
float length(float v[3]) {
  float r = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
  return r;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm0
mulss  %xmm0,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     113f <length+0x2f>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @length(float* %0) {
%2 = alloca float*
%3 = alloca float
store float* %0, float** %2
%4 = load float*, float** %2
%5 = getelementptr inbounds float, float* %4, i64 0
%6 = load float, float* %5
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %2
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
%13 = load float*, float** %2
%14 = getelementptr inbounds float, float* %13, i64 1
%15 = load float, float* %14
%16 = fmul float %12, %15
%17 = call float @llvm.fmuladd.f32(float %6, float %9, float %16)
%18 = load float*, float** %2
%19 = getelementptr inbounds float, float* %18, i64 2
%20 = load float, float* %19
%21 = load float*, float** %2
%22 = getelementptr inbounds float, float* %21, i64 2
%23 = load float, float* %22
%24 = call float @llvm.fmuladd.f32(float %20, float %23, float %17)
%25 = call float @sqrt(float %24)
store float %25, float* %3
%26 = load float, float* %3
ret float %26
}

LLVM IR (-O2):
define float @length(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %6)
%10 = tail call float @sqrt(float %9)
ret float %10
}
void __attribute__((
    warning("curl_easy_getinfo expects a pointer to char * for this info")))
__attribute__((unused)) __attribute__((no))
_curl_easy_getinfo_err_string(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_getinfo_err_string() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FooDouble();
int /*<<< orphan*/ FooFloat();
int main(void) {
  FooFloat();
  FooDouble();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <FooFloat@plt>
mov    $0x0,%al
call   1040 <FooDouble@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <FooFloat@plt>
xor    %eax,%eax
call   1040 <FooDouble@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @FooFloat()
%2 = call i32 (...) @FooDouble()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @FooFloat()
%2 = tail call i32 (...) @FooDouble()
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int _compare_strings(const char *strA, const char *strB) {
  return strcmp(strA, strB);
}


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

x86 assembly (clang, -O2):
<_compare_strings>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @_compare_strings(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 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @_compare_strings(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
void system_input_shutdown(void) { return; }


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

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

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

LLVM IR (-O2):
define void @system_input_shutdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void StrUTF8Free(char *pszStr) { free(pszStr); }


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

x86 assembly (clang, -O2):
<StrUTF8Free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @StrUTF8Free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glm_max(float, float);
float glm_min(int /*<<< orphan*/, float);
__attribute((always_)) float glm_clamp(float val, float minVal, float maxVal) {
  return glm_min(glm_max(val, minVal), maxVal);
}


x86 assembly (clang, -O0):
<glm_clamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <glm_max@plt>
mov    %eax,%edi
movss  -0xc(%rbp),%xmm0
call   1030 <glm_min@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glm_clamp>:
push   %rax
movss  %xmm2,0x4(%rsp)
call   1040 <glm_max@plt>
mov    %eax,%edi
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <glm_min@plt>

LLVM IR (-O0):
define float @glm_clamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = call i32 @glm_max(float %7, float %8)
%10 = load float, float* %6
%11 = call float @glm_min(i32 %9, float %10)
ret float %11
}

LLVM IR (-O2):
define float @glm_clamp(float %0, float %1, float %2) {
%4 = tail call i32 @glm_max(float %0, float %1)
%5 = tail call float @glm_min(i32 %4, float %2)
ret float %5
}
int startMonitoringConsoleBell(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @startMonitoringConsoleBell() {
ret i32 0
}
/* Variables and functions */
int computeSum(double *, int);
double computeMean(double data[], int length) {
  return computeSum(data, length) / length;
}


x86 assembly (clang, -O0):
<computeMean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <computeSum@plt>
cltd
idivl  -0xc(%rbp)
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeMean>:
push   %rbx
mov    %esi,%ebx
call   1030 <computeSum@plt>
cltd
idiv   %ebx
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @computeMean(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = call i32 @computeSum(double* %5, i32 %6)
%8 = load i32, i32* %4
%9 = sdiv i32 %7, %8
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @computeMean(double* %0, i32 %1) {
%3 = tail call i32 @computeSum(double* %0, i32 %1)
%4 = sdiv i32 %3, %1
%5 = sitofp i32 %4 to double
ret double %5
}
/* Variables and functions */
scalar_t__ calloc(unsigned int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
double *allocDoubles(unsigned int len) {
  double *d;
  if ((d = (double *)calloc(len, sizeof(double))) == NULL) {
    perror("calloc");
    exit(2);
  }
  return d;
}


x86 assembly (clang, -O0):
<allocDoubles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    116c <allocDoubles+0x3c>
lea    0xea3(%rip),%rdi
call   1040 <perror@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocDoubles>:
push   %rax
mov    $0x8,%esi
call   1030 <calloc@plt>
test   %rax,%rax
je     1142 <allocDoubles+0x12>
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
call   1040 <perror@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"calloc\00"
define double* @allocDoubles(i32 %0) {
%2 = alloca i32
%3 = alloca double*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @calloc(i32 %4, i32 8)
%6 = inttoptr i64 %5 to double*
store double* %6, double** %3
%7 = icmp eq double* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 2)
unreachable
11: ; preds = %1
%12 = load double*, double** %3
ret double* %12
}

LLVM IR (-O2):
@.str = [7 x i8] c"calloc\00"
define double* @allocDoubles(i32 %0) {
%2 = tail call i64 @calloc(i32 %0, i32 8)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 2)
unreachable
7: ; preds = %1
%8 = inttoptr i64 %2 to double*
ret double* %8
}
unsigned xrop3_123_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_123_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_123_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_123_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %6
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = xor i32 %30, -1
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = and i32 %36, %37
%39 = or i32 %35, %38
ret i32 %39
}

LLVM IR (-O2):
define i32 @xrop3_123_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = xor i32 %4, -1
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
locale_t uselocale(locale_t locale) { return (locale_t)NULL; }


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

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

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

LLVM IR (-O2):
define i32 @uselocale(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ rush(int, int);
int main(void) {
  rush(4, 5);
  ft_putchar('\n');
  rush(1, 6);
  ft_putchar('\n');
  rush(4, 1);
  ft_putchar('\n');
  rush(7, 1);
  ft_putchar('\n');
  rush(13, 14);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
mov    $0x5,%esi
call   1040 <rush@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    $0x1,%edi
mov    $0x6,%esi
call   1040 <rush@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    $0x4,%edi
mov    $0x1,%esi
call   1040 <rush@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    $0x7,%edi
mov    $0x1,%esi
call   1040 <rush@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    $0xd,%edi
mov    $0xe,%esi
call   1040 <rush@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
mov    $0x5,%esi
call   1040 <rush@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    $0x1,%edi
mov    $0x6,%esi
call   1040 <rush@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    $0x4,%edi
mov    $0x1,%esi
call   1040 <rush@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    $0x7,%edi
mov    $0x1,%esi
call   1040 <rush@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    $0xd,%edi
mov    $0xe,%esi
call   1040 <rush@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @rush(i32 4, i32 5)
%3 = call i32 @ft_putchar(i8 signext 10)
%4 = call i32 @rush(i32 1, i32 6)
%5 = call i32 @ft_putchar(i8 signext 10)
%6 = call i32 @rush(i32 4, i32 1)
%7 = call i32 @ft_putchar(i8 signext 10)
%8 = call i32 @rush(i32 7, i32 1)
%9 = call i32 @ft_putchar(i8 signext 10)
%10 = call i32 @rush(i32 13, i32 14)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @rush(i32 4, i32 5)
%2 = tail call i32 @ft_putchar(i8 signext 10)
%3 = tail call i32 @rush(i32 1, i32 6)
%4 = tail call i32 @ft_putchar(i8 signext 10)
%5 = tail call i32 @rush(i32 4, i32 1)
%6 = tail call i32 @ft_putchar(i8 signext 10)
%7 = tail call i32 @rush(i32 7, i32 1)
%8 = tail call i32 @ft_putchar(i8 signext 10)
%9 = tail call i32 @rush(i32 13, i32 14)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open_sysfs(char const *, char const *, int /*<<< orphan*/);
int read_sysfs_int_fd(int, char const *, char const *);
int read_sysfs_int(const char *sys_pfx, const char *node) {
  int fd, val;
  fd = open_sysfs(sys_pfx, node, O_RDONLY);
  val = read_sysfs_int_fd(fd, sys_pfx, node);
  close(fd);
  return val;
}


x86 assembly (clang, -O0):
<read_sysfs_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
call   1040 <open_sysfs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <read_sysfs_int_fd@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <close@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_sysfs_int>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
call   1040 <open_sysfs@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <read_sysfs_int_fd@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1050 <close@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define i32 @read_sysfs_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = load i32, i32* @O_RDONLY
%10 = call i32 @open_sysfs(i8* %7, i8* %8, i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i32 @read_sysfs_int_fd(i32 %11, i8* %12, i8* %13)
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = call i32 @close(i32 %15)
%17 = load i32, i32* %6
ret i32 %17
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i32 @read_sysfs_int(i8* %0, i8* %1) {
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open_sysfs(i8* %0, i8* %1, i32 %3)
%5 = tail call i32 @read_sysfs_int_fd(i32 %4, i8* %0, i8* %1)
%6 = tail call i32 @close(i32 %4)
ret i32 %5
}
/* Variables and functions */
int fork();
main() {
  switch (fork()) {
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
call   1030 <fork@plt>
jmp    1120 <main+0x10>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fork()
ret i32 0
}
void mu_noop(void) {}


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

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

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

LLVM IR (-O2):
define void @mu_noop() {
ret void
}