xunge/DecIR huggingface dataset:
char *getenv(name)
char *name;
{
  int offset;
  char *_findenv();
  return (_findenv(name, &offset));
}


x86 assembly (clang, -O0):
<getenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1030 <_findenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getenv>:
push   %rax
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <_findenv@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @getenv(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* (i8*, i32*, ...) bitcast (i8* (...)* @_findenv to i8* (i8*, i32*, ...)*)(i8* %4, i32* %3)
ret i8* %5
}

LLVM IR (-O2):
define i8* @getenv(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i8* (i8*, i32*, ...) bitcast (i8* (...)* @_findenv to i8* (i8*, i32*, ...)*)(i8* %0, i32* %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ I2CStatsHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void I2CStatsLogging() { UAVObjLogging(I2CStatsHandle()); }


x86 assembly (clang, -O0):
<I2CStatsLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <I2CStatsHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CStatsLogging>:
push   %rax
xor    %eax,%eax
call   1040 <I2CStatsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @I2CStatsLogging() {
%1 = call i32 (...) @I2CStatsHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @I2CStatsLogging() {
%1 = tail call i32 (...) @I2CStatsHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void timefunc(int val) {
  fprintf(stderr, "Exiting on timeout.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<timefunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<timefunc>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Exiting on timeout.\0A\00"
define void @timefunc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Exiting on timeout.\0A\00"
define void @timefunc(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
char *strcpy(char *strDest, char *strSource) {
  char *res;
  res = strDest;
  while (*strDest++ == strSource++)
    ;
  return res;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbq (%rax),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
cmp    %rcx,%rax
jne    1144 <strcpy+0x44>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned %0, i8* readnone %1) {
ret i8* %0
}
void av_mallocz_array() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_accel_map_lock_path() {
ret void
}
/* Type definitions */
struct adpcm_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct adpcm_context *);
void adpcm_free_context(void *p) {
  struct adpcm_context *pcnxt = (struct adpcm_context *)p;
  free(pcnxt);
}


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

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

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

LLVM IR (-O2):
%struct.adpcm_context = type { i32 }
define void @adpcm_free_context(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.adpcm_context*
%3 = tail call i32 @free(%struct.adpcm_context* %2)
ret void
}
void ff_hevc_put_hevc_qpel_hv16_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_hv16_8_sse4() {
ret void
}
/* Variables and functions */
int tst_fs_fill_hardlinks_(void (*)(), char const *);
int tst_fs_fill_hardlinks(void (*cleanup)(void), const char *dir) {
  return tst_fs_fill_hardlinks_(cleanup, dir);
}


x86 assembly (clang, -O0):
<tst_fs_fill_hardlinks>:
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 <tst_fs_fill_hardlinks_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_fs_fill_hardlinks>:
jmp    1030 <tst_fs_fill_hardlinks_@plt>

LLVM IR (-O0):
define i32 @tst_fs_fill_hardlinks(void ()* %0, i8* %1) {
%3 = alloca void ()*
%4 = alloca i8*
store void ()* %0, void ()** %3
store i8* %1, i8** %4
%5 = load void ()*, void ()** %3
%6 = bitcast void ()* %5 to void (...)*
%7 = load i8*, i8** %4
%8 = call i32 @tst_fs_fill_hardlinks_(void (...)* %6, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @tst_fs_fill_hardlinks(void ()* %0, i8* %1) {
%3 = bitcast void ()* %0 to void (...)*
%4 = tail call i32 @tst_fs_fill_hardlinks_(void (...)* %3, i8* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ init();
int /*<<< orphan*/ unlock();
int main() {
  init();
  int x = 5;
  unlock();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <init@plt>
movl   $0x5,-0x8(%rbp)
mov    $0x0,%al
call   1030 <unlock@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @init()
store i32 5, i32* %2
%4 = call i32 (...) @unlock()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @unlock()
ret i32 0
}
/* Variables and functions */
int hash(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char sentence[200];
  scanf("%s", sentence);
  int hash_n = hash(sentence);
  printf("%ld", hash_n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <hash@plt>
mov    %eax,-0xd4(%rbp)
mov    -0xd4(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <hash@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%7 = call i32 @hash(i8* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @hash(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int getch();
int /*<<< orphan*/ ungetch(int);
void eat(void) {
  int c;
  c = getch();
  if (c != '\n')
    ungetch(c);
}


x86 assembly (clang, -O0):
<eat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
je     1144 <eat+0x24>
mov    -0x4(%rbp),%edi
call   1030 <ungetch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eat>:
push   %rax
xor    %eax,%eax
call   1040 <getch@plt>
cmp    $0xa,%eax
jne    112f <eat+0xf>
pop    %rax
ret
mov    %eax,%edi
pop    %rax
jmp    1030 <ungetch@plt>

LLVM IR (-O0):
define void @eat() {
%1 = alloca i32
%2 = call i32 (...) @getch()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* %1
%7 = call i32 @ungetch(i32 %6)
br label %8
8: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @eat() {
%1 = tail call i32 (...) @getch()
%2 = icmp eq i32 %1, 10
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @ungetch(i32 %1)
br label %5
5: ; preds = %3, %0
ret void
}
float power(float x, float y) {
  int i;
  float k = 1;
  for (i = 1; i <= y; i++) {
    k = k * x;
  }
  return k;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  0xeea(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1152 <power+0x52>
movss  -0x10(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <power+0x22>
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
movss  0xef8(%rip),%xmm2
ucomiss %xmm2,%xmm1
jb     1133 <power+0x33>
movss  0xeeb(%rip),%xmm2
mov    $0x2,%eax
nopw   0x0(%rax,%rax,1)
xorps  %xmm3,%xmm3
cvtsi2ss %eax,%xmm3
mulss  %xmm0,%xmm2
add    $0x1,%eax
ucomiss %xmm3,%xmm1
jae    1120 <power+0x20>
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @power(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i32
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
store float 1.000000e+00, float* %6
store i32 1, i32* %5
br label %7
7: ; preds = %16, %2
%8 = load i32, i32* %5
%9 = sitofp i32 %8 to float
%10 = load float, float* %4
%11 = fcmp ole float %9, %10
br i1 %11, label %12, label %19
12: ; preds = %7
%13 = load float, float* %6
%14 = load float, float* %3
%15 = fmul float %13, %14
store float %15, float* %6
br label %16
16: ; preds = %12
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %7
19: ; preds = %7
%20 = load float, float* %6
ret float %20
}

LLVM IR (-O2):
define float @power(float %0, float %1) {
%3 = fcmp ult float %1, 1.000000e+00
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi float [ %7, %4 ], [ 1.000000e+00, %2 ]
%6 = phi i32 [ %8, %4 ], [ 1, %2 ]
%7 = fmul float %5, %0
%8 = add nuw nsw i32 %6, 1
%9 = sitofp i32 %8 to float
%10 = fcmp ugt float %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = phi float [ 1.000000e+00, %2 ], [ %7, %4 ]
ret float %12
}
double sc_c(double L, double T) { return -L / T; }


x86 assembly (clang, -O0):
<sc_c>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc_c>:
xorpd  0xef8(%rip),%xmm0
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sc_c(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fneg double %5
%7 = load double, double* %4
%8 = fdiv double %6, %7
ret double %8
}

LLVM IR (-O2):
define double @sc_c(double %0, double %1) {
%3 = fneg double %0
%4 = fdiv double %3, %1
ret double %4
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t swap16(register uint16_t d) { return ((d & 0xff) << 8) | (d >> 8); }


x86 assembly (clang, -O0):
<swap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap16>:
mov    %edi,%eax
shl    $0x8,%eax
movzwl %ax,%eax
sar    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @swap16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 8
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @swap16(i32 %0) {
%2 = shl i32 %0, 8
%3 = and i32 %2, 65280
%4 = ashr i32 %0, 8
%5 = or i32 %3, %4
ret i32 %5
}
void foo_1_1_2_1_2_1_2_1_2() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @EVP_DigestUpdate() {
ret void
}
void test54() {
  int a;
  int b = a;
  ;
  int c;
  int d = c;
  ;
}


x86 assembly (clang, -O0):
<test54>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test54() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = load i32, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %3
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @test54() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __NR_set_mempolicy;
long syscall(int /*<<< orphan*/, int, unsigned long const *, unsigned long);
long set_mempolicy(int mode, const unsigned long *nodemask,
                   unsigned long maxnode) {
  return syscall(__NR_set_mempolicy, mode, nodemask, maxnode);
}


x86 assembly (clang, -O0):
<set_mempolicy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_mempolicy>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
@__NR_set_mempolicy = global i32 0
define i64 @set_mempolicy(i32 %0, i64* %1, i64 %2) {
%4 = load i32, i32* @__NR_set_mempolicy
%5 = tail call i64 @syscall(i32 %4, i32 %0, i64* %1, i64 %2)
ret i64 %5
}
void CFGMR3InsertStringN(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3InsertStringN() {
ret void
}
int num_matches_id(const unsigned int num, const unsigned int ugid) {
  return num == ugid || num == -1U;
}


x86 assembly (clang, -O0):
<num_matches_id>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
cmp    -0x8(%rbp),%ecx
mov    %al,-0x9(%rbp)
je     1125 <num_matches_id+0x25>
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_matches_id>:
cmp    %esi,%edi
sete   %al
cmp    $0xffffffff,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @num_matches_id(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 = icmp eq i32 %5, %6
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, -1
br label %11
11: ; preds = %8, %2
%12 = phi i1 [ true, %2 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @num_matches_id(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = icmp eq i32 %0, -1
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
double scalbn(double, int);
double ldexp(double x, int n) { return scalbn(x, n); }


x86 assembly (clang, -O0):
<ldexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1030 <scalbn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexp>:
jmp    1030 <scalbn@plt>

LLVM IR (-O0):
define double @ldexp(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 double @scalbn(double %5, i32 %6)
ret double %7
}

LLVM IR (-O2):
define double @ldexp(double %0, i32 %1) {
%3 = tail call double @scalbn(double %0, i32 %1)
ret double %3
}
/* Variables and functions */
int partition(char **, int, int);
void str_qsort(char **A, int s, int t) {
  if (s < t - 1) {
    int m = partition(A, s, t);
    str_qsort(A, s, m);
    str_qsort(A, m + 1, t);
  }
}


x86 assembly (clang, -O0):
<str_qsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1176 <str_qsort+0x56>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <str_qsort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <str_qsort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_qsort>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
lea    -0x1(%r14),%r12d
cmp    %esi,%r12d
jle    1165 <str_qsort+0x45>
mov    %esi,%ebx
mov    %rdi,%r15
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebp
mov    %r15,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <str_qsort@plt>
add    $0x1,%ebp
mov    %ebp,%ebx
cmp    %ebp,%r12d
jg     1140 <str_qsort+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @str_qsort(i8** %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = icmp sgt i32 %4, %1
br i1 %5, label %6, label %11
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ %1, %3 ]
%8 = tail call i32 @partition(i8** %0, i32 %7, i32 %2)
tail call void @str_qsort(i8** %0, i32 %7, i32 %8)
%9 = add nsw i32 %8, 1
%10 = icmp sgt i32 %4, %9
br i1 %10, label %6, label %11
11: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *, char *);
scalar_t__ pthread_self();
int /*<<< orphan*/ stderr;
void *busy(void *arg) {
  fprintf(stderr, "thread tid %p is %s\n", (void *)pthread_self(), (char *)arg);
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<busy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rdx
mov    -0x8(%rbp),%rcx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1155 <busy+0x35>

x86 assembly (clang, -O2):
<busy>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xec3(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
mov    %rbx,%rcx
call   1030 <fprintf@plt>
nopw   0x0(%rax,%rax,1)
jmp    1150 <busy+0x30>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"thread tid %p is %s\0A\00"
define i8* @busy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i64 (...) @pthread_self()
%5 = inttoptr i64 %4 to i8*
%6 = load i8*, i8** %2
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
br label %8
8: ; preds = %8, %1
br label %8
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"thread tid %p is %s\0A\00"
define noalias i8* @busy(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i64 (...) @pthread_self()
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %0)
br label %6
6: ; preds = %6, %1
br label %6
}
/* Variables and functions */
void *_glp_lib_xmalloc(int);
void *glp_malloc(int size) {
  void *ptr;
  ptr = _glp_lib_xmalloc(size);
  return ptr;
}


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

x86 assembly (clang, -O2):
<glp_malloc>:
jmp    1030 <_glp_lib_xmalloc@plt>

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

LLVM IR (-O2):
define i8* @glp_malloc(i32 %0) {
%2 = tail call i8* @_glp_lib_xmalloc(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *calloc(size_t, size_t);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *rfcdown_calloc(size_t nmemb, size_t size) {
  void *ret = calloc(nmemb, size);
  if (!ret) {
    fprintf(stderr, "Allocation failed.\n");
    abort();
  }
  return ret;
}


x86 assembly (clang, -O0):
<rfcdown_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1178 <rfcdown_calloc+0x48>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfcdown_calloc>:
push   %rax
call   1040 <calloc@plt>
test   %rax,%rax
je     113d <rfcdown_calloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Allocation failed.\0A\00"
define i8* @rfcdown_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Allocation failed.\0A\00"
define noalias i8* @rfcdown_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t hchartoi(char c) {
  switch (c) {
  case '0':
    return 0;
  case '1':
    return 1;
  case '2':
    return 2;
  case '3':
    return 3;
  case '4':
    return 4;
  case '5':
    return 5;
  case '6':
    return 6;
  case '7':
    return 7;
  case '8':
    return 8;
  case '9':
    return 9;
  default:
    return 255;
  }
}


x86 assembly (clang, -O0):
<hchartoi>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x9,%eax
ja     11ac <hchartoi+0xac>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    11b3 <hchartoi+0xb3>
movl   $0x1,-0x4(%rbp)
jmp    11b3 <hchartoi+0xb3>
movl   $0x2,-0x4(%rbp)
jmp    11b3 <hchartoi+0xb3>
movl   $0x3,-0x4(%rbp)
jmp    11b3 <hchartoi+0xb3>
movl   $0x4,-0x4(%rbp)
jmp    11b3 <hchartoi+0xb3>
movl   $0x5,-0x4(%rbp)
jmp    11b3 <hchartoi+0xb3>
movl   $0x6,-0x4(%rbp)
jmp    11b3 <hchartoi+0xb3>
movl   $0x7,-0x4(%rbp)
jmp    11b3 <hchartoi+0xb3>
movl   $0x8,-0x4(%rbp)
jmp    11b3 <hchartoi+0xb3>
movl   $0x9,-0x4(%rbp)
jmp    11b3 <hchartoi+0xb3>
movl   $0xff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hchartoi>:
lea    -0x30(%rdi),%ecx
cmp    $0xa,%ecx
mov    $0xff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hchartoi(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %16 [
i32 48, label %6
i32 49, label %7
i32 50, label %8
i32 51, label %9
i32 52, label %10
i32 53, label %11
i32 54, label %12
i32 55, label %13
i32 56, label %14
i32 57, label %15
]
6: ; preds = %1
store i32 0, i32* %2
br label %17
7: ; preds = %1
store i32 1, i32* %2
br label %17
8: ; preds = %1
store i32 2, i32* %2
br label %17
9: ; preds = %1
store i32 3, i32* %2
br label %17
10: ; preds = %1
store i32 4, i32* %2
br label %17
11: ; preds = %1
store i32 5, i32* %2
br label %17
12: ; preds = %1
store i32 6, i32* %2
br label %17
13: ; preds = %1
store i32 7, i32* %2
br label %17
14: ; preds = %1
store i32 8, i32* %2
br label %17
15: ; preds = %1
store i32 9, i32* %2
br label %17
16: ; preds = %1
store i32 255, i32* %2
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @hchartoi(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
%4 = icmp ult i32 %3, 10
%5 = select i1 %4, i32 %3, i32 255
ret i32 %5
}
double _J_4(void) { return 0.25; }


x86 assembly (clang, -O0):
<_J_4>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_J_4>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @_J_4() {
ret double 2.500000e-01
}

LLVM IR (-O2):
define double @_J_4() {
ret double 2.500000e-01
}
void testClosureBSrV(void (*closure)(char, short), char a1, short a2) {
  (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureBSrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %ax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x9(%rbp),%cl
movsbl %cl,%edi
movswl -0xc(%rbp),%esi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureBSrV>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %edx,%esi
jmp    *%rax

LLVM IR (-O0):
define void @testClosureBSrV(void (i8, i16)* %0, i8 signext %1, i16 signext %2) {
%4 = alloca void (i8, i16)*
%5 = alloca i8
%6 = alloca i16
store void (i8, i16)* %0, void (i8, i16)** %4
store i8 %1, i8* %5
store i16 %2, i16* %6
%7 = load void (i8, i16)*, void (i8, i16)** %4
%8 = load i8, i8* %5
%9 = load i16, i16* %6
ret void
}

LLVM IR (-O2):
define void @testClosureBSrV(void (i8, i16)* nocapture %0, i8 signext %1, i16 signext %2) {
tail call void %0(i8 signext %1, i16 signext %2)
ret void
}
/* Type definitions */
typedef long long time_t;
typedef long long int64_t;

/* Variables and functions */
time_t ns1_time_to_unix(int64_t wtime) {
  time_t tm;
  wtime -= 116444736000000000LL;
  wtime /= 10000000LL;
  tm = wtime;
  return (time_t)tm;
}


x86 assembly (clang, -O0):
<ns1_time_to_unix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movabs $0x19db1ded53e8000,%rcx
b1 9d 01
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x989680,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns1_time_to_unix>:
movabs $0xfe624e212ac18000,%rcx
4e 62 fe
add    %rdi,%rcx
movabs $0xd6bf94d5e57a42bd,%rdx
94 bf d6
mov    %rcx,%rax
imul   %rdx
add    %rdx,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x17,%rcx
add    %rax,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @ns1_time_to_unix(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sub nsw i64 %4, 116444736000000000
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = sdiv i64 %6, 10000000
store i64 %7, i64* %2
%8 = load i64, i64* %2
store i64 %8, i64* %3
%9 = load i64, i64* %3
ret i64 %9
}

LLVM IR (-O2):
define i64 @ns1_time_to_unix(i64 %0) {
%2 = add nsw i64 %0, -116444736000000000
%3 = sdiv i64 %2, 10000000
ret i64 %3
}
void foo3() {
  int local;
  { int local; }
}


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

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

LLVM IR (-O0):
define void @foo3() {
%1 = alloca i32
%2 = alloca i32
ret void
}

LLVM IR (-O2):
define void @foo3() {
ret void
}
/* Variables and functions */
char *db_strerror(int);
int /*<<< orphan*/ printf(char *, char *);
void print_error(int ret) {
  if (ret != 0)
    printf("ERROR: %s\n", db_strerror(ret));
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114c <print_error+0x2c>
mov    -0x4(%rbp),%edi
call   1040 <db_strerror@plt>
mov    %rax,%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
test   %edi,%edi
je     113a <print_error+0x1a>
push   %rax
call   1040 <db_strerror@plt>
lea    0xecf(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @print_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i8* @db_strerror(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @print_error(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i8* @db_strerror(i32 %0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
br label %6
6: ; preds = %3, %1
ret void
}
void insl(unsigned short port, void *addr, unsigned long count) {
  asm volatile("cld ; rep ; insl"
               : "=D"(addr), "=c"(count)
               : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<insl>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
cld
rep insl (%dx),%es:(%rdi)
mov    %rdi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insl>:
mov    %rdx,%rcx
mov    %edi,%edx
mov    %rsi,%rdi
cld
rep insl (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insl(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call { i8*, i64 } asm sideeffect "cld ; rep ; insl", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %7, i8* %8, i64 %9)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @insl(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "cld ; rep ; insl", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
/* Type definitions */
struct ScriptHTML {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ScriptHTML *);
void ScriptHTMLFree(struct ScriptHTML *ptr) {
  if (ptr == NULL)
    return;
  free(ptr);
}


x86 assembly (clang, -O0):
<ScriptHTMLFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <ScriptHTMLFree+0x1c>
jmp    1135 <ScriptHTMLFree+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ScriptHTML = type { i32 }
define void @ScriptHTMLFree(%struct.ScriptHTML* %0) {
%2 = alloca %struct.ScriptHTML*
store %struct.ScriptHTML* %0, %struct.ScriptHTML** %2
%3 = load %struct.ScriptHTML*, %struct.ScriptHTML** %2
%4 = icmp eq %struct.ScriptHTML* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load %struct.ScriptHTML*, %struct.ScriptHTML** %2
%8 = call i32 @free(%struct.ScriptHTML* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.ScriptHTML = type { i32 }
define void @ScriptHTMLFree(%struct.ScriptHTML* %0) {
%2 = icmp eq %struct.ScriptHTML* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.ScriptHTML* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, int *, scalar_t__);
void c_func_4_(int *n, int64_t *i) {
  printf("[%s:%i] n = %p = %li\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/FreeON/spammpack/refs/heads/master/src-C/"
         "tests/fortran_C_backend.c",
         25, n, (int64_t)n);
  *i = (int64_t)n;
}


x86 assembly (clang, -O0):
<c_func_4_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0xed1(%rip),%rdi
lea    0xee0(%rip),%rsi
mov    $0x19,%edx
call   1030 <printf@plt>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_func_4_>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rdi
lea    0xeee(%rip),%rsi
mov    $0x19,%edx
mov    %rbx,%rcx
mov    %rbx,%r8
call   1030 <printf@plt>
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"[%s:%i] n = %p = %li\0A\00"
@.str.1 = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FreeON/spammpack/refs/heads/master/src-C/tests/fortran_C_backend.c\00"
define void @c_func_4_(i32* %0, i64* %1) {
%3 = alloca i32*
%4 = alloca i64*
store i32* %0, i32** %3
store i64* %1, i64** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %3
%7 = ptrtoint i32* %6 to i64
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i32 25, i32* %5, i64 %7)
%9 = load i32*, i32** %3
%10 = ptrtoint i32* %9 to i64
%11 = load i64*, i64** %4
store i64 %10, i64* %11
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"[%s:%i] n = %p = %li\0A\00"
@.str.1 = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FreeON/spammpack/refs/heads/master/src-C/tests/fortran_C_backend.c\00"
define void @c_func_4_(i32* %0, i64* nocapture writeonly %1) {
%3 = ptrtoint i32* %0 to i64
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i32 25, i32* %0, i64 %3)
store i64 %3, i64* %1
ret void
}
void outsw(unsigned short port, const void *addr, int cnt) {
  asm volatile("rep; outsw" : "+S"(addr), "+c"(cnt) : "d"(port));
}


x86 assembly (clang, -O0):
<outsw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
mov    -0x2(%rbp),%dx
rep outsw %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsw>:
mov    %edx,%ecx
mov    %edi,%edx
rep outsw %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsw(i16 zeroext %0, i8* %1, i32 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i32
store i16 %0, i16* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = load i16, i16* %4
%10 = call { i8*, i32 } asm sideeffect "rep; outsw", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %9, i8* %7, i32 %8)
%11 = extractvalue { i8*, i32 } %10, 0
%12 = extractvalue { i8*, i32 } %10, 1
store i8* %11, i8** %5
store i32 %12, i32* %6
ret void
}

LLVM IR (-O2):
define void @outsw(i16 zeroext %0, i8* %1, i32 %2) {
%4 = tail call { i8*, i32 } asm sideeffect "rep; outsw", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ malloc(unsigned int);
int /*<<< orphan*/ printf(char *);
float *alloc_1d_dbl(int n) {
  float *new_alloc;
  new_alloc = (float *)malloc((unsigned)(n * sizeof(float)));
  if (new_alloc == NULL) {
    printf("ALLOC_1D_DBL: Couldn't allocate array of floats\n");
    return (NULL);
  }
  return (new_alloc);
}


x86 assembly (clang, -O0):
<alloc_1d_dbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1162 <alloc_1d_dbl+0x42>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x8(%rbp)
jmp    116a <alloc_1d_dbl+0x4a>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_1d_dbl>:
push   %rax
shl    $0x2,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1130 <alloc_1d_dbl+0x10>
pop    %rcx
ret
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"ALLOC_1D_DBL: Couldn't allocate array of floats\0A\00"
define float* @alloc_1d_dbl(i32 %0) {
%2 = alloca float*
%3 = alloca i32
%4 = alloca float*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = mul i64 %6, 4
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to float*
store float* %10, float** %4
%11 = load float*, float** %4
%12 = icmp eq float* %11, null
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
store float* null, float** %2
br label %17
15: ; preds = %1
%16 = load float*, float** %4
store float* %16, float** %2
br label %17
17: ; preds = %15, %13
%18 = load float*, float** %2
ret float* %18
}

LLVM IR (-O2):
@str = [48 x i8] c"ALLOC_1D_DBL: Couldn't allocate array of floats\00"
define float* @alloc_1d_dbl(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = inttoptr i64 %3 to float*
br label %9
9: ; preds = %7, %5
%10 = phi float* [ null, %5 ], [ %8, %7 ]
ret float* %10
}
/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *strdup(char const *);
void args_usage(const char *argv0) {
  char *argv0_copy = strdup(argv0);
  char *argv0_base = basename(argv0_copy);
  printf("Usage: %s [OPTION] \n", argv0_base);
  printf("Try `%s --help' for more information.\n", argv0_base);
  free(argv0_copy);
}


x86 assembly (clang, -O0):
<args_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <basename@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<args_usage>:
push   %r14
push   %rbx
push   %rax
call   1060 <strdup@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1050 <basename@plt>
mov    %rax,%rbx
lea    0xea2(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
lea    0xea8(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Usage: %s [OPTION] \0A\00"
@.str.1 = [39 x i8] c"Try `%s --help' for more information.\0A\00"
define void @args_usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strdup(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @basename(i8* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %4
%12 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %3
%14 = call i32 @free(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Usage: %s [OPTION] \0A\00"
@.str.1 = [39 x i8] c"Try `%s --help' for more information.\0A\00"
define void @args_usage(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i8* @basename(i8* %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = tail call i32 @free(i8* %2)
ret void
}
unsigned short random_u16(unsigned int seed) { return seed; }


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

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

LLVM IR (-O0):
define zeroext i16 @random_u16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @random_u16(i32 %0) {
%2 = trunc i32 %0 to i16
ret i16 %2
}
/* Variables and functions */
double fabs(double const);
int fEqual(const double b, const double a) { return fabs(a - b) < 1.0e-6; }


x86 assembly (clang, -O0):
<fEqual>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
movaps 0xef1(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xed5(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fEqual>:
subsd  %xmm0,%xmm1
andpd  0xef4(%rip),%xmm1
movsd  0xefc(%rip),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @fEqual(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fsub double %5, %6
%8 = call double @llvm.fabs.f64(double %7)
%9 = fcmp olt double %8, 0x3EB0C6F7A0B5ED8D
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @fEqual(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call double @llvm.fabs.f64(double %3)
%5 = fcmp olt double %4, 0x3EB0C6F7A0B5ED8D
%6 = zext i1 %5 to i32
ret i32 %6
}