xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int rand();
void *null_ptr(void) {
  unsigned int x = rand();
  unsigned int y = x * x;
  if (y & 2)
    return (void *)-1;
  else
    return (void *)0;
}


x86 assembly (clang, -O0):
<null_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     114b <null_ptr+0x3b>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <null_ptr+0x43>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @null_ptr() {
%1 = tail call i32 (...) @rand()
%2 = mul i32 %1, %1
%3 = and i32 %2, 2
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i8* null, i8* inttoptr (i64 -1 to i8*)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ __mmask8;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm128_cmp_ps_mask(int /*<<< orphan*/, int /*<<< orphan*/,
                                      int /*<<< orphan*/);
__mmask8 test_mm128_cmp_ps_mask(__m128 __A, __m128 __B) {
  return (__mmask8)_mm128_cmp_ps_mask(__A, __B, 0);
}


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

x86 assembly (clang, -O2):
<test_mm128_cmp_ps_mask>:
xor    %edx,%edx
jmp    1030 <_mm128_cmp_ps_mask@plt>

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

LLVM IR (-O2):
define i32 @test_mm128_cmp_ps_mask(i32 %0, i32 %1) {
%3 = tail call i32 @_mm128_cmp_ps_mask(i32 %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int demo(void) {
  static int a = 42;
  printf("%d\n", a++);
}


x86 assembly (clang, -O0):
<demo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2f0a(%rip),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,0x2eff(%rip)
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<demo>:
mov    0x2f12(%rip),%esi
lea    0x1(%rsi),%eax
mov    %eax,0x2f09(%rip)
lea    0xeda(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@demo.a = internal global i32 42
@.str = [4 x i8] c"%d\0A\00"
define i32 @demo() {
%1 = alloca i32
%2 = load i32, i32* @demo.a
%3 = add nsw i32 %2, 1
store i32 %3, i32* @demo.a
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@demo.a = internal unnamed_addr global i32 42
@.str = [4 x i8] c"%d\0A\00"
define i32 @demo() {
%1 = load i32, i32* @demo.a
%2 = add nsw i32 %1, 1
store i32 %2, i32* @demo.a
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ wt1(double *, unsigned long, int,
                       void (*)(double *, unsigned long, int));
void Ddwt1(double a[], unsigned long n, int isign,
           void (*wtstep)(double[], unsigned long, int)) {
  double *b;
  b = a - 1;
  wt1(b, n, isign, wtstep);
  return;
}


x86 assembly (clang, -O0):
<Ddwt1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1030 <wt1@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ddwt1>:
add    $0xfffffffffffffff8,%rdi
jmp    1030 <wt1@plt>

LLVM IR (-O0):
define void @Ddwt1(double* %0, i64 %1, i32 %2, void (double*, i64, i32)* %3) {
%5 = alloca double*
%6 = alloca i64
%7 = alloca i32
%8 = alloca void (double*, i64, i32)*
%9 = alloca double*
store double* %0, double** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store void (double*, i64, i32)* %3, void (double*, i64, i32)** %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 -1
store double* %11, double** %9
%12 = load double*, double** %9
%13 = load i64, i64* %6
%14 = load i32, i32* %7
%15 = load void (double*, i64, i32)*, void (double*, i64, i32)** %8
%16 = call i32 @wt1(double* %12, i64 %13, i32 %14, void (double*, i64, i32)* %15)
ret void
}

LLVM IR (-O2):
define void @Ddwt1(double* %0, i64 %1, i32 %2, void (double*, i64, i32)* %3) {
%5 = getelementptr inbounds double, double* %0, i64 -1
%6 = tail call i32 @wt1(double* %5, i64 %1, i32 %2, void (double*, i64, i32)* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *exename) {
  fprintf(stderr, " Usage: %s <file name> <-r/-w> [<num events>]\n", exename);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
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 = [47 x i8] c" Usage: %s <file name> <-r/-w> [<num events>]\0A\00"
define void @usage(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 ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c" Usage: %s <file name> <-r/-w> [<num events>]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void four(const float value) {
  if ((value > 0) && (value < 1))
    printf("The value is between zero and one.\n");
  else
    printf("The value is not between zero and one.\n");
}


x86 assembly (clang, -O0):
<four>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1151 <four+0x41>
movss  0xeca(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1151 <four+0x41>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
jmp    115d <four+0x4d>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<four>:
movss  0xee8(%rip),%xmm1
ucomiss %xmm0,%xmm1
lea    0xf09(%rip),%rdi
lea    0xedb(%rip),%rax
cmovbe %rax,%rdi
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
cmovbe %rax,%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"The value is between zero and one.\0A\00"
@.str.1 = [40 x i8] c"The value is not between zero and one.\0A\00"
define void @four(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 0.000000e+00
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load float, float* %2
%7 = fcmp olt float %6, 1.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %5, %1
%11 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret void
}

LLVM IR (-O2):
@str = [39 x i8] c"The value is not between zero and one.\00"
@str.2 = [35 x i8] c"The value is between zero and one.\00"
define void @four(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = fcmp olt float %0, 1.000000e+00
%4 = and i1 %2, %3
%5 = select i1 %4, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret void
}
/* Variables and functions */
int abs(unsigned int);
int /*<<< orphan*/ printf(char *, int, int);
void gotoxy(unsigned int x, unsigned int y) {
  printf("\e[%u;%uH", abs(x), abs(y));
}


x86 assembly (clang, -O0):
<gotoxy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotoxy>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
mov    %esi,%edx
neg    %edx
cmovs  %esi,%edx
lea    0xedb(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%u;%uH\00"
define void @gotoxy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @abs(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @abs(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%u;%uH\00"
define void @gotoxy(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_apcmd_read_eeprom_usage(void) {
  printf("\nUsage: rdeeprom <offset> <bytecount>\n");
  printf("    offset    : 0,4,8,..., multiple of 4\n");
  printf("    bytecount : 4-20, multiple of 4\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_apcmd_read_eeprom_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1f(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"\0AUsage: rdeeprom <offset> <bytecount>\0A\00"
@.str.1 = [42 x i8] c" offset : 0,4,8,..., multiple of 4\0A\00"
@.str.2 = [37 x i8] c" bytecount : 4-20, multiple of 4\0A\00"
define void @print_apcmd_read_eeprom_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"\0AUsage: rdeeprom <offset> <bytecount>\00"
@str.3 = [41 x i8] c" offset : 0,4,8,..., multiple of 4\00"
@str.4 = [36 x i8] c" bytecount : 4-20, multiple of 4\00"
define void @print_apcmd_read_eeprom_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ msg_out(int, char *, char *, int, char *);
void parse_err(int sev, int line, char *msg) {
  msg_out(sev, "%s: line %d: %s\n",
          "/usr/local/etc"
          "/srelay.conf",
          line, msg);
}


x86 assembly (clang, -O0):
<parse_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%r8
lea    0xecd(%rip),%rsi
lea    0xed7(%rip),%rdx
call   1030 <msg_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_err>:
mov    %rdx,%r8
mov    %esi,%ecx
lea    0xee4(%rip),%rsi
lea    0xeee(%rip),%rdx
jmp    1030 <msg_out@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%s: line %d: %s\0A\00"
@.str.1 = [27 x i8] c"/usr/local/etc/srelay.conf\00"
define void @parse_err(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @msg_out(i32 %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s: line %d: %s\0A\00"
@.str.1 = [27 x i8] c"/usr/local/etc/srelay.conf\00"
define void @parse_err(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @msg_out(i32 %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgbool(void) {
  gen("negl\t%eax");
  gen("sbbl\t%eax,%eax");
  gen("negl\t%eax");
}


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

x86 assembly (clang, -O2):
<cgbool>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <gen@plt>
lea    0xee3(%rip),%rdi
call   1030 <gen@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <gen@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"negl\09%eax\00"
@.str.1 = [15 x i8] c"sbbl\09%eax,%eax\00"
define void @cgbool() {
%1 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"negl\09%eax\00"
@.str.1 = [15 x i8] c"sbbl\09%eax,%eax\00"
define void @cgbool() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ send_event;
};
struct TYPE_4__ {
  TYPE_1__ xclient;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xclient_send_event(void *_p) {
  return (int)((XEvent *)_p)->xclient.send_event;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XEvent_xclient_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
double pathcon_nm3_twice(double x) { return x + x; }


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

x86 assembly (clang, -O2):
<pathcon_nm3_twice>:
addsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @pathcon_nm3_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ _hardlibc_atexit_add(void (*)());
int atexit(void (*action)(void)) { _hardlibc_atexit_add(action); }


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

x86 assembly (clang, -O2):
<atexit>:
jmp    1030 <_hardlibc_atexit_add@plt>

LLVM IR (-O0):
define i32 @atexit(void ()* %0) {
%2 = alloca i32
%3 = alloca void ()*
store void ()* %0, void ()** %3
%4 = load void ()*, void ()** %3
%5 = bitcast void ()* %4 to void (...)*
%6 = call i32 @_hardlibc_atexit_add(void (...)* %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @atexit(void ()* %0) {
%2 = bitcast void ()* %0 to void (...)*
%3 = tail call i32 @_hardlibc_atexit_add(void (...)* %2)
ret i32 undef
}
int lh_ptr_equal(const void *k1, const void *k2) { return (k1 == k2); }


x86 assembly (clang, -O0):
<lh_ptr_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lh_ptr_equal>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @lh_ptr_equal(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, double);
double te_interp(char const *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  const char *c = "sqrt(5^2+7^2+11^2+(8-2)^2)";
  double r = te_interp(c, 0);
  printf("The expression:\n\t%s\nevaluates to:\n\t%f\n", c, r);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <te_interp@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
movsd  -0x20(%rbp),%xmm0
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <te_interp@plt>
lea    0xee2(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"sqrt(5^2+7^2+11^2+(8-2)^2)\00"
@.str.1 = [39 x i8] c"The expression:\0A\09%s\0Aevaluates to:\0A\09%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8** %6
%8 = load i8*, i8** %6
%9 = call double @te_interp(i8* %8, i32 0)
store double %9, double* %7
%10 = load i8*, i8** %6
%11 = load double, double* %7
%12 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %10, double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"sqrt(5^2+7^2+11^2+(8-2)^2)\00"
@.str.1 = [39 x i8] c"The expression:\0A\09%s\0Aevaluates to:\0A\09%f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double @te_interp(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void Test(void) {
  char *str = (char *)malloc(100);
  strcpy(str, "hello");
  free(str);
  if (str != NULL) {
    strcpy(str, "world");
    printf("%s\n", str);
  }
}


x86 assembly (clang, -O0):
<Test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1060 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x8(%rbp)
je     119a <Test+0x5a>
mov    -0x8(%rbp),%rdi
lea    0xe81(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rsi
lea    0xe77(%rip),%rdi
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Test>:
push   %rbx
mov    $0x64,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
test   %rbx,%rbx
je     1189 <Test+0x49>
lea    0xe95(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcpy@plt>
lea    0xe8c(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1050 <printf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @Test() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 100)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = call i32 @free(i8* %6)
%8 = load i8*, i8** %1
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %0
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%13 = load i8*, i8** %1
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %10, %0
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @Test() {
%1 = tail call i64 @malloc(i32 100)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @free(i8* %2)
%5 = icmp eq i64 %1, 0
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %2)
br label %9
9: ; preds = %6, %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void fprint_message_to_stdout(const char *format, va_list arg_ptr) {
  printf("<<<MSG>>> ");
  (void)vfprintf(stdout, format, arg_ptr);
}


x86 assembly (clang, -O0):
<fprint_message_to_stdout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <vfprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_message_to_stdout>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <vfprintf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"<<<MSG>>> \00"
@stdout = global i32 0
define void @fprint_message_to_stdout(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @vfprintf(i32 %6, i8* %7, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"<<<MSG>>> \00"
@stdout = global i32 0
define void @fprint_message_to_stdout(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = tail call i32 @vfprintf(i32 %4, i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fix_token_names();
int /*<<< orphan*/ init_macros();
void bt_initialize(void) {
  fix_token_names();
  init_macros();
}


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

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

LLVM IR (-O0):
define void @bt_initialize() {
%1 = call i32 (...) @fix_token_names()
%2 = call i32 (...) @init_macros()
ret void
}

LLVM IR (-O2):
define void @bt_initialize() {
%1 = tail call i32 (...) @fix_token_names()
%2 = tail call i32 (...) @init_macros()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_poly1305_sub(uintptr_t, uintptr_t, uintptr_t);
void fiat_poly1305_sub(uint32_t out1[5], const uint32_t arg1[5],
                       const uint32_t arg2[5]) {
  internal_fiat_poly1305_sub((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_poly1305_sub>:
jmp    1030 <internal_fiat_poly1305_sub@plt>

LLVM IR (-O0):
define void @fiat_poly1305_sub(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 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_poly1305_sub(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_poly1305_sub(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_poly1305_sub(i64 %4, i64 %5, i64 %6)
ret void
}
void ipu_pre_free(unsigned int *id) {}


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

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

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

LLVM IR (-O2):
define void @ipu_pre_free(i32* nocapture %0) {
ret void
}
int main() {
  char ss[5][20] = {"shanghai", "beijing", "guangzhou", "shengzheng",
                    "tianjing"};
  int n, i;
  n = fun(ss);
  printf("%s\n", ss[n]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x64,%edx
call   1050 <memcpy@plt>
lea    -0x70(%rbp),%rdi
mov    $0x0,%al
call   1030 <fun@plt>
mov    %eax,-0x74(%rbp)
movslq -0x74(%rbp),%rax
lea    -0x70(%rbp),%rsi
imul   $0x14,%rax,%rax
add    %rax,%rsi
lea    0xee9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
mov    0xf36(%rip),%eax
mov    %eax,0x60(%rsp)
movaps 0xf1b(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeff(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xee3(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec7(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeab(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe8f(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1040 <fun@plt>
cltq
lea    (%rax,%rax,4),%rax
lea    (%rsp,%rax,4),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
@__const.main.ss = [5 x [20 x i8]] [[20 x i8] c"shanghai\00\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"beijing\00\00\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"guangzhou\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"shengzheng\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"tianjing\00\00\00\00\00\00\00\00\00\00\00\00"]
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x [20 x i8]]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [5 x [20 x i8]]* %2 to i8*
%6 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %2, i64 0, i64 0
%7 = call i32 ([20 x i8]*, ...) bitcast (i32 (...)* @fun to i32 ([20 x i8]*, ...)*)([20 x i8]* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %2, i64 0, i64 %9
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.ss = [5 x [20 x i8]] [[20 x i8] c"shanghai\00\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"beijing\00\00\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"guangzhou\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"shengzheng\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"tianjing\00\00\00\00\00\00\00\00\00\00\00\00"]
define i32 @main() {
%1 = alloca [5 x [20 x i8]]
%2 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %1, i64 0, i64 0, i64 0
%3 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %1, i64 0, i64 0
%4 = call i32 ([20 x i8]*, ...) bitcast (i32 (...)* @fun to i32 ([20 x i8]*, ...)*)([20 x i8]* %3)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %1, i64 0, i64 %5, i64 0
%7 = call i32 @puts(i8* %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ ncpu;

/* Variables and functions */
int /*<<< orphan*/ sysctlbyname(char *, int *, size_t *, int /*<<< orphan*/ *,
                                int /*<<< orphan*/);
uint16_t get_numproc(void) {
  size_t len;
  int ncpu;
  len = sizeof(ncpu);
  sysctlbyname("hw.ncpu", &ncpu, &len, NULL, 0);
  return (uint16_t)ncpu;
}


x86 assembly (clang, -O0):
<get_numproc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x4,-0x8(%rbp)
lea    0xed9(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1030 <sysctlbyname@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_numproc>:
sub    $0x18,%rsp
movq   $0x4,0x10(%rsp)
lea    0xedc(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <sysctlbyname@plt>
mov    0xc(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"hw.ncpu\00"
define i32 @get_numproc() {
%1 = alloca i64
%2 = alloca i32
store i64 4, i64* %1
%3 = call i32 @sysctlbyname(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %2, i64* %1, i32* null, i32 0)
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"hw.ncpu\00"
define i32 @get_numproc() {
%1 = alloca i64
%2 = alloca i32
%3 = bitcast i64* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i64 4, i64* %1
%5 = call i32 @sysctlbyname(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %2, i64* %1, i32* null, i32 0)
%6 = load i32, i32* %2
ret i32 %6
}
/* Variables and functions */
unsigned long get_error_values(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *, int /*<<< orphan*/ *);
unsigned long ERR_get_error(void) {
  return (get_error_values(1, NULL, NULL, NULL, NULL));
}


x86 assembly (clang, -O0):
<ERR_get_error>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rsi
mov    %r8,%rdx
mov    %r8,%rcx
call   1030 <get_error_values@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ERR_get_error>:
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <get_error_values@plt>

LLVM IR (-O0):
define i64 @ERR_get_error() {
%1 = call i64 @get_error_values(i32 1, i32* null, i32* null, i32* null, i32* null)
ret i64 %1
}

LLVM IR (-O2):
define i64 @ERR_get_error() {
%1 = tail call i64 @get_error_values(i32 1, i32* null, i32* null, i32* null, i32* null)
ret i64 %1
}
/* Type definitions */
struct bitpack__clump {
  int dummy;
};

/* Variables and functions */
int decode_big_endian(char *, struct bitpack__clump *);
int decode_little_endian(char *, struct bitpack__clump *);
int bitpack__decode(char *source, struct bitpack__clump *target,
                    int little_endian) {
  if (little_endian)
    return decode_little_endian(source, target);
  else
    return decode_big_endian(source, target);
}


x86 assembly (clang, -O0):
<bitpack__decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1152 <bitpack__decode+0x32>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <decode_little_endian@plt>
mov    %eax,-0x4(%rbp)
jmp    1162 <bitpack__decode+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <decode_big_endian@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitpack__decode>:
test   %edx,%edx
je     1129 <bitpack__decode+0x9>
jmp    1040 <decode_little_endian@plt>
jmp    1030 <decode_big_endian@plt>

LLVM IR (-O0):
%struct.bitpack__clump = type { i32 }
define i32 @bitpack__decode(i8* %0, %struct.bitpack__clump* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.bitpack__clump*
%7 = alloca i32
store i8* %0, i8** %5
store %struct.bitpack__clump* %1, %struct.bitpack__clump** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i8*, i8** %5
%12 = load %struct.bitpack__clump*, %struct.bitpack__clump** %6
%13 = call i32 @decode_little_endian(i8* %11, %struct.bitpack__clump* %12)
store i32 %13, i32* %4
br label %18
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = load %struct.bitpack__clump*, %struct.bitpack__clump** %6
%17 = call i32 @decode_big_endian(i8* %15, %struct.bitpack__clump* %16)
store i32 %17, i32* %4
br label %18
18: ; preds = %14, %10
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
%struct.bitpack__clump = type { i32 }
define i32 @bitpack__decode(i8* %0, %struct.bitpack__clump* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @decode_little_endian(i8* %0, %struct.bitpack__clump* %1)
br label %9
7: ; preds = %3
%8 = tail call i32 @decode_big_endian(i8* %0, %struct.bitpack__clump* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool adts_get_home(const uint8_t *p_adts) { return !!(p_adts[3] & 0x10); }


x86 assembly (clang, -O0):
<adts_get_home>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
and    $0x10,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adts_get_home>:
mov    0xc(%rdi),%eax
shr    $0x4,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @adts_get_home(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
%6 = and i32 %5, 16
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @adts_get_home(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = lshr i32 %3, 4
%5 = and i32 %4, 1
ret i32 %5
}
/* Type definitions */
struct patricia_node {
  int dummy;
};

/* Variables and functions */
int *ptree_search_data_r_p(struct patricia_node *, char *, size_t, size_t);
int *ptree_search_data_nearest_ptr(char *str, size_t sstr,
                                   struct patricia_node *root) {
  return ptree_search_data_r_p(root, str, sstr, sstr * 8);
}


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

x86 assembly (clang, -O2):
<ptree_search_data_nearest_ptr>:
mov    %rdx,%rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0x0(,%rdx,8),%rcx
mov    %rax,%rdi
jmp    1030 <ptree_search_data_r_p@plt>

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

LLVM IR (-O2):
%struct.patricia_node = type { i32 }
define i32* @ptree_search_data_nearest_ptr(i8* %0, i64 %1, %struct.patricia_node* %2) {
%4 = shl i64 %1, 3
%5 = tail call i32* @ptree_search_data_r_p(%struct.patricia_node* %2, i8* %0, i64 %1, i64 %4)
ret i32* %5
}
/* Variables and functions */
float tgamma(float);
float tgammaf(float x) { return (tgamma(x)); }


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

x86 assembly (clang, -O2):
<tgammaf>:
jmp    1030 <tgamma@plt>

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

LLVM IR (-O2):
define float @tgammaf(float %0) {
%2 = tail call float @tgamma(float %0)
ret float %2
}
unsigned char glk_char_to_upper(unsigned char ch) {
  if (ch >= 'a' && ch <= 'z')
    return ch - ('a' - 'A');
  if (ch >= 0xe0 && ch <= 0xFE && ch != 0xF7)
    return ch - 0x20;
  return ch;
}


x86 assembly (clang, -O0):
<glk_char_to_upper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1133 <glk_char_to_upper+0x33>
movzbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     1133 <glk_char_to_upper+0x33>
movzbl -0x2(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1175 <glk_char_to_upper+0x75>
movzbl -0x2(%rbp),%eax
cmp    $0xe0,%eax
jl     116f <glk_char_to_upper+0x6f>
movzbl -0x2(%rbp),%eax
cmp    $0xfe,%eax
jg     116f <glk_char_to_upper+0x6f>
movzbl -0x2(%rbp),%eax
cmp    $0xf7,%eax
je     116f <glk_char_to_upper+0x6f>
movzbl -0x2(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1175 <glk_char_to_upper+0x75>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<glk_char_to_upper>:
mov    %edi,%eax
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     110d <glk_char_to_upper+0xd>
add    $0xe0,%al
ret
lea    0x20(%rax),%ecx
lea    -0x20(%rax),%edx
cmp    $0x1f,%cl
movzbl %al,%ecx
movzbl %dl,%edx
cmovae %ecx,%edx
cmp    $0xf7,%al
cmove  %ecx,%edx
mov    %edx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @glk_char_to_upper(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = sub nsw i32 %13, 32
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %35
16: ; preds = %7, %1
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = icmp sge i32 %18, 224
br i1 %19, label %20, label %33
20: ; preds = %16
%21 = load i8, i8* %3
%22 = zext i8 %21 to i32
%23 = icmp sle i32 %22, 254
br i1 %23, label %24, label %33
24: ; preds = %20
%25 = load i8, i8* %3
%26 = zext i8 %25 to i32
%27 = icmp ne i32 %26, 247
br i1 %27, label %28, label %33
28: ; preds = %24
%29 = load i8, i8* %3
%30 = zext i8 %29 to i32
%31 = sub nsw i32 %30, 32
%32 = trunc i32 %31 to i8
store i8 %32, i8* %2
br label %35
33: ; preds = %24, %20, %16
%34 = load i8, i8* %3
store i8 %34, i8* %2
br label %35
35: ; preds = %33, %28, %11
%36 = load i8, i8* %2
ret i8 %36
}

LLVM IR (-O2):
define zeroext i8 @glk_char_to_upper(i8 zeroext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = add nsw i8 %0, -32
br label %13
6: ; preds = %1
%7 = add i8 %0, 32
%8 = icmp ult i8 %7, 31
%9 = icmp ne i8 %0, -9
%10 = and i1 %9, %8
%11 = add i8 %0, -32
%12 = select i1 %10, i8 %11, i8 %0
br label %13
13: ; preds = %6, %4
%14 = phi i8 [ %5, %4 ], [ %12, %6 ]
ret i8 %14
}
int main() {
  int i = 0;
  while (i < 100000000) {
    i += 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5f5e100,-0x8(%rbp)
jge    112d <main+0x2d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ctest_fin();
int /*<<< orphan*/ ctest_init();
int /*<<< orphan*/ ctest_test(char *, int);
int main(void) {
  ctest_init();
  ctest_test("suite working", 1);
  ctest_fin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <ctest_init@plt>
lea    0xeb3(%rip),%rdi
mov    $0x1,%esi
call   1050 <ctest_test@plt>
mov    $0x0,%al
call   1040 <ctest_fin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <ctest_init@plt>
lea    0xec1(%rip),%rdi
mov    $0x1,%esi
call   1050 <ctest_test@plt>
xor    %eax,%eax
call   1040 <ctest_fin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"suite working\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @ctest_init()
%3 = call i32 @ctest_test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 (...) @ctest_fin()
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"suite working\00"
define i32 @main() {
%1 = tail call i32 (...) @ctest_init()
%2 = tail call i32 @ctest_test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 (...) @ctest_fin()
ret i32 0
}
/* Variables and functions */
int error(int, char *);
int b_nohup(int argc, char *argv[]) {
  if (argc > 1)
    return error(1, argv[0]);
  return error(49, argv[0]);
}


x86 assembly (clang, -O0):
<b_nohup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1142 <b_nohup+0x32>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x1,%edi
call   1030 <error@plt>
mov    %eax,-0x4(%rbp)
jmp    1156 <b_nohup+0x46>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x31,%edi
call   1030 <error@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_nohup>:
cmp    $0x2,%edi
mov    (%rsi),%rsi
mov    $0x1,%eax
mov    $0x31,%edi
cmovge %eax,%edi
jmp    1030 <error@plt>

LLVM IR (-O0):
define i32 @b_nohup(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @error(i32 1, i8* %11)
store i32 %12, i32* %3
br label %18
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = call i32 @error(i32 49, i8* %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %13, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @b_nohup(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
%4 = load i8*, i8** %1
%5 = select i1 %3, i32 1, i32 49
%6 = tail call i32 @error(i32 %5, i8* %4)
ret i32 %6
}
const char *leenux() { return "leenux"; }


x86 assembly (clang, -O0):
<leenux>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leenux>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"leenux\00"
define i8* @leenux() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"leenux\00"
define i8* @leenux() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ op_low(char **, int *);
char *remove_spaces(char *);
int eval_expr(char *str) {
  int result;
  char *rs_str;
  result = 0;
  rs_str = remove_spaces(str);
  op_low(&rs_str, &result);
  return (result);
}


x86 assembly (clang, -O0):
<eval_expr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <remove_spaces@plt>
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <op_low@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_expr>:
sub    $0x18,%rsp
movl   $0x0,0xc(%rsp)
call   1040 <remove_spaces@plt>
mov    %rax,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1030 <op_low@plt>
mov    0xc(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @eval_expr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
%6 = call i8* @remove_spaces(i8* %5)
store i8* %6, i8** %4
%7 = call i32 @op_low(i8** %4, i32* %3)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @eval_expr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = bitcast i32* %2 to i8*
%5 = bitcast i8** %3 to i8*
store i32 0, i32* %2
%6 = tail call i8* @remove_spaces(i8* %0)
store i8* %6, i8** %3
%7 = call i32 @op_low(i8** %3, i32* %2)
%8 = load i32, i32* %2
ret i32 %8
}