xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ time_t;
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double timespec_diff(struct timespec const *ts0, struct timespec const *ts1) {
  time_t diff_sec;
  long diff_nsec;
  diff_sec = ts1->tv_sec - ts0->tv_sec;
  diff_nsec += ts1->tv_nsec - ts0->tv_nsec;
  return ((double)diff_sec) + (((double)diff_nsec) / 1.0e9);
}


x86 assembly (clang, -O0):
<timespec_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x8(%rbp),%rcx
sub    0x8(%rcx),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
cvtsi2sdq -0x18(%rbp),%xmm0
cvtsi2sdq -0x20(%rbp),%xmm1
movsd  0xeb6(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_diff>:
mov    0x8(%rsi),%rax
sub    0x8(%rdi),%rax
cvtsi2sd %rax,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define double @timespec_diff(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
%5 = alloca i64
%6 = alloca i64
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%7 = load %struct.timespec*, %struct.timespec** %4
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
%9 = load i64, i64* %8
%10 = load %struct.timespec*, %struct.timespec** %3
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 1
%12 = load i64, i64* %11
%13 = sub nsw i64 %9, %12
store i64 %13, i64* %5
%14 = load %struct.timespec*, %struct.timespec** %4
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %14, i32 0, i32 0
%16 = load i64, i64* %15
%17 = load %struct.timespec*, %struct.timespec** %3
%18 = getelementptr inbounds %struct.timespec, %struct.timespec* %17, i32 0, i32 0
%19 = load i64, i64* %18
%20 = sub nsw i64 %16, %19
%21 = load i64, i64* %6
%22 = add nsw i64 %21, %20
store i64 %22, i64* %6
%23 = load i64, i64* %5
%24 = sitofp i64 %23 to double
%25 = load i64, i64* %6
%26 = sitofp i64 %25 to double
%27 = fdiv double %26, 1.000000e+09
%28 = fadd double %24, %27
ret double %28
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define double @timespec_diff(%struct.timespec* nocapture %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = sitofp i64 %7 to double
ret double %8
}
/* Variables and functions */
int calc_gcd(int, int);
int calc_lcm(int u, int v) {
  int lcm = (u * v) / calc_gcd(u, v);
  return lcm;
}


x86 assembly (clang, -O0):
<calc_lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <calc_gcd@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_lcm>:
push   %rbx
mov    %esi,%ebx
imul   %edi,%ebx
call   1030 <calc_gcd@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @calc_lcm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @calc_gcd(i32 %9, i32 %10)
%12 = sdiv i32 %8, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @calc_lcm(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @calc_gcd(i32 %0, i32 %1)
%5 = sdiv i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ int_least8_t;

/* Variables and functions */
bool SHAREMIND_SET_KEY_LESS_THAN_int_least8_t(int_least8_t const k1,
                                              int_least8_t const k2) {
  return k1 < k2;
}


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

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

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_LESS_THAN_int_least8_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_LESS_THAN_int_least8_t(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_ABuint32_mem(unsigned int *val) {
  return ((*val) & (0xAB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ABuint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xab,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_ABuint32_mem>:
testb  $0xab,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_ABuint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 171
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_ABuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 171
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(unsigned char, unsigned char);
void SensorSetReg_OV7660(unsigned char uAddr, unsigned short uVal) {
  VIM_SIF_I2cWriteByte((unsigned char)uAddr, (unsigned char)uVal);
}


x86 assembly (clang, -O0):
<SensorSetReg_OV7660>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x4(%rbp),%ax
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetReg_OV7660>:
movzbl %sil,%esi
jmp    1030 <VIM_SIF_I2cWriteByte@plt>

LLVM IR (-O0):
define void @SensorSetReg_OV7660(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = load i16, i16* %4
%7 = trunc i16 %6 to i8
%8 = call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %5, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
define void @SensorSetReg_OV7660(i8 zeroext %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
%4 = tail call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %0, i8 zeroext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ok(char const *, unsigned int, int /*<<< orphan*/,
                      char const *);
int /*<<< orphan*/ putstr(char *);
void ptr_not_null(const char *file, unsigned int line, void *got,
                  const char *name) {
  ok(file, line, got != NULL, name);
  if (got == NULL) {
    putstr("#         got: "
           "NULL\n");
    putstr("#    expected: "
           "anything else\n");
  }
}


x86 assembly (clang, -O0):
<ptr_not_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edx
mov    -0x20(%rbp),%rcx
call   1030 <ok@plt>
cmpq   $0x0,-0x18(%rbp)
jne    1177 <ptr_not_null+0x57>
lea    0xe9a(%rip),%rdi
call   1040 <putstr@plt>
lea    0xea3(%rip),%rdi
call   1040 <putstr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr_not_null>:
push   %rbx
mov    %rdx,%rbx
xor    %edx,%edx
test   %rbx,%rbx
setne  %dl
call   1030 <ok@plt>
test   %rbx,%rbx
je     1138 <ptr_not_null+0x18>
pop    %rbx
ret
lea    0xec1(%rip),%rdi
call   1040 <putstr@plt>
lea    0xeca(%rip),%rdi
pop    %rbx
jmp    1040 <putstr@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"# got: NULL\0A\00"
@.str.1 = [30 x i8] c"# expected: anything else\0A\00"
define void @ptr_not_null(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = icmp ne i8* %11, null
%13 = zext i1 %12 to i32
%14 = load i8*, i8** %8
%15 = call i32 @ok(i8* %9, i32 %10, i32 %13, i8* %14)
%16 = load i8*, i8** %7
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %21
18: ; preds = %4
%19 = call i32 @putstr(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @putstr(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %18, %4
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"# got: NULL\0A\00"
@.str.1 = [30 x i8] c"# expected: anything else\0A\00"
define void @ptr_not_null(i8* %0, i32 %1, i8* readnone %2, i8* %3) {
%5 = icmp ne i8* %2, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @ok(i8* %0, i32 %1, i32 %6, i8* %3)
%8 = icmp eq i8* %2, null
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = tail call i32 @putstr(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @putstr(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %9, %4
ret void
}
/* Variables and functions */
unsigned int inl_local(int);
__attribute__((always_)) unsigned int inl(int port) { return inl_local(port); }


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

x86 assembly (clang, -O2):
<inl>:
jmp    1030 <inl_local@plt>

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

LLVM IR (-O2):
define i32 @inl(i32 %0) {
%2 = tail call i32 @inl_local(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ aucRef;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ contains_data(int /*<<< orphan*/ *, int, unsigned char *, int);
int is_lilo_br(FILE *fp) {
  unsigned char aucRef[] = {'L', 'I', 'L', 'O'};
  return (contains_data(fp, 0x6, aucRef, sizeof(aucRef)) ||
          contains_data(fp, 0x2, aucRef, sizeof(aucRef)));
}


x86 assembly (clang, -O0):
<is_lilo_br>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xede(%rip),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rdx
mov    $0x6,%esi
mov    $0x4,%ecx
call   1030 <contains_data@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0xd(%rbp)
jne    116f <is_lilo_br+0x5f>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rdx
mov    $0x2,%esi
mov    $0x4,%ecx
call   1030 <contains_data@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_lilo_br>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x4f4c494c,0xc(%rsp)
4f
lea    0xc(%rsp),%rdx
mov    $0x6,%esi
mov    $0x4,%ecx
call   1030 <contains_data@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1163 <is_lilo_br+0x53>
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x4,%ecx
call   1030 <contains_data@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.is_lilo_br.aucRef = [4 x i8] c"LILO"
define i32 @is_lilo_br(i32* %0) {
%2 = alloca i32*
%3 = alloca [4 x i8]
store i32* %0, i32** %2
%4 = bitcast [4 x i8]* %3 to i8*
%5 = load i32*, i32** %2
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%7 = call i64 @contains_data(i32* %5, i32 6, i8* %6, i32 4)
%8 = icmp ne i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = load i32*, i32** %2
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%12 = call i64 @contains_data(i32* %10, i32 2, i8* %11, i32 4)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %9, %1
%15 = phi i1 [ true, %1 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_lilo_br(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1330399564, i32* %2
%4 = call i64 @contains_data(i32* %0, i32 6, i8* %3, i32 4)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i64 @contains_data(i32* %0, i32 2, i8* %3, i32 4)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %1
%11 = phi i32 [ 1, %1 ], [ %9, %6 ]
ret i32 %11
}
int test_imm_4Dint64_lowword_mem(long long *val) {
  return ((*val) & (0x4D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Dint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0x4d,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Dint64_lowword_mem>:
testb  $0x4d,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Dint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 77
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_4Dint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 77
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct re {
  int dummy;
};

/* Variables and functions */
struct re *regexp(char const **, int);
struct re *parse(char const *s) {
  return regexp(&s, false);
}


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

x86 assembly (clang, -O2):
<parse>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <regexp@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.re = type { i32 }
define %struct.re* @parse(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call %struct.re* @regexp(i8** %2, i32 0)
ret %struct.re* %3
}

LLVM IR (-O2):
%struct.re = type { i32 }
define %struct.re* @parse(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call %struct.re* @regexp(i8** %2, i32 0)
ret %struct.re* %3
}
/* Variables and functions */
int gpio_dir(int, int);
int gpio_setsda_dir(int dir) { return gpio_dir(17, dir); }


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

x86 assembly (clang, -O2):
<gpio_setsda_dir>:
mov    %edi,%esi
mov    $0x11,%edi
jmp    1030 <gpio_dir@plt>

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

LLVM IR (-O2):
define i32 @gpio_setsda_dir(i32 %0) {
%2 = tail call i32 @gpio_dir(i32 17, i32 %0)
ret i32 %2
}
/* Variables and functions */
int getline(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int len;
  char line[1000];
  while ((len = getline(line)) > 0)
    if (len > 81) {
      printf("%s", line);
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
call   1040 <getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    116c <main+0x4c>
cmpl   $0x51,-0x8(%rbp)
jle    1167 <main+0x47>
lea    -0x3f0(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
call   1040 <getline@plt>
test   %eax,%eax
jle    116e <main+0x4e>
lea    0xec3(%rip),%r14
mov    %rsp,%rbx
jmp    115c <main+0x3c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <getline@plt>
test   %eax,%eax
jle    116e <main+0x4e>
cmp    $0x52,%eax
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %14, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @getline(i8* %5)
store i32 %6, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 81
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %8
br label %4
15: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 81
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @getline(i8* %2)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
/* Variables and functions */
double copysign(double, double);
double with_copysign(double x) { return copysign(x, x); }


x86 assembly (clang, -O0):
<with_copysign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movaps 0xee6(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xeeb(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @with_copysign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.copysign.f64(double %3, double %4)
ret double %5
}

LLVM IR (-O2):
define double @with_copysign(double returned %0) {
ret double %0
}
void numa_add_cpu(unsigned int cpu) {}


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

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

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

LLVM IR (-O2):
define void @numa_add_cpu(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ f(int *);
int main(void) {
  int t;
  f(&t);
  if (t != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <f@plt>
cmpl   $0x1,-0x8(%rbp)
je     1149 <main+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <f@plt>
cmpl   $0x1,0x4(%rsp)
jne    1136 <main+0x16>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @f(i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 1
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello world"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
void testTortureExecute(void) {
  f(100);
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1030 <f@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTortureExecute>:
mov    $0x64,%edi
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = call i32 @f(i32 100)
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 @f(i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_convert_matrix(float **b, int nrl, int nrh, int ncl, int nch) {
  free((char *)(b + nrl - 1));
}


x86 assembly (clang, -O0):
<free_convert_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_convert_matrix>:
movslq %esi,%rax
lea    (%rdi,%rax,8),%rdi
add    $0xfffffffffffffff8,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_convert_matrix(float** %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca float**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store float** %0, float*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load float**, float*** %6
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds float*, float** %11, i64 %13
%15 = getelementptr inbounds float*, float** %14, i64 -1
%16 = bitcast float** %15 to i8*
%17 = call i32 @free(i8* %16)
ret void
}

LLVM IR (-O2):
define void @free_convert_matrix(float** nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds float*, float** %0, i64 %6
%8 = getelementptr inbounds float*, float** %7, i64 -1
%9 = bitcast float** %8 to i8*
%10 = tail call i32 @free(i8* %9)
ret void
}
/* Variables and functions */
char *MayusculasMinusculas(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
main() {
  char cadena[100];
  printf("Introduzca una cadena de caracteres:\n");
  gets(cadena);
  printf("La cadena en minúsculas es:\n%s\n", MayusculasMinusculas(cadena));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x70(%rbp),%rdi
call   1030 <MayusculasMinusculas@plt>
mov    %rax,%rsi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    %rbx,%rdi
call   1040 <MayusculasMinusculas@plt>
lea    0xe95(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Introduzca una cadena de caracteres:\0A\00"
@.str.1 = [33 x i8] c"La cadena en min\C3\BAsculas es:\0A%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = call i8* @MayusculasMinusculas(i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [33 x i8] c"La cadena en min\C3\BAsculas es:\0A%s\0A\00"
@str = [37 x i8] c"Introduzca una cadena de caracteres:\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i8* @MayusculasMinusculas(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ loopagain();
void end(void) { loopagain(); }


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

x86 assembly (clang, -O2):
<end>:
xor    %eax,%eax
jmp    1030 <loopagain@plt>

LLVM IR (-O0):
define void @end() {
%1 = call i32 (...) @loopagain()
ret void
}

LLVM IR (-O2):
define void @end() {
%1 = tail call i32 (...) @loopagain()
ret void
}
/* Variables and functions */
int ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int);
void ft_putstr_fd(char const *s, int fd) {
  if (!s) {
    write(fd, "(null)", 6);
    return;
  }
  write(fd, s, ft_strlen(s));
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1153 <ft_putstr_fd+0x33>
mov    -0xc(%rbp),%edi
lea    0xebc(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
jmp    1178 <ft_putstr_fd+0x58>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
test   %rdi,%rdi
je     113b <ft_putstr_fd+0x1b>
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
jmp    1149 <ft_putstr_fd+0x29>
lea    0xebe(%rip),%rsi
mov    %ebp,%edi
mov    $0x6,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"(null)\00"
define void @ft_putstr_fd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = call i32 @write(i32 %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
br label %16
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i8*, i8** %3
%13 = load i8*, i8** %3
%14 = call i32 @ft_strlen(i8* %13)
%15 = call i32 @write(i32 %11, i8* %12, i32 %14)
br label %16
16: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"(null)\00"
define void @ft_putstr_fd(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
br label %9
6: ; preds = %2
%7 = tail call i32 @ft_strlen(i8* %0)
%8 = tail call i32 @write(i32 %1, i8* %0, i32 %7)
br label %9
9: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_permutation(int, int *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  int a[n];
  print_permutation(n, a, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
xor    %edx,%edx
call   1030 <print_permutation@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
lea    0xed3(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rsp,%rbx
mov    -0xc(%rbp),%eax
mov    %rsp,%rsi
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rsi
mov    %rsi,%rsp
mov    -0xc(%rbp),%edi
xor    %edx,%edx
call   1030 <print_permutation@plt>
mov    %rbx,%rsp
xor    %eax,%eax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i32, i64 %7
store i64 %7, i64* %4
%10 = load i32, i32* %2
%11 = call i32 @print_permutation(i32 %10, i32* %9, i32 0)
store i32 0, i32* %1
%12 = load i8*, i8** %3
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = zext i32 %4 to i64
%6 = call i8* @llvm.stacksave()
%7 = alloca i32, i64 %5
%8 = load i32, i32* %1
%9 = call i32 @print_permutation(i32 %8, i32* %7, i32 0)
ret i32 0
}
unsigned int extract_word_offset(unsigned int pattern) {
  unsigned int ret;
  ret =
      (pattern >> ((((sizeof(unsigned int)) * 8) -
                    (8 + (__builtin_ctz((1024 / (sizeof(unsigned int))))))))) &
      ((1 << (__builtin_ctz((1024 / (sizeof(unsigned int)))))) - 1);
  return ret;
}


x86 assembly (clang, -O0):
<extract_word_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_word_offset>:
shr    $0x10,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @extract_word_offset(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = lshr i32 %4, 16
%6 = and i32 %5, 255
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @extract_word_offset(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 255
ret i32 %3
}
__attribute((always_)) float glm_pow2(float x) { return x * x; }


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

x86 assembly (clang, -O2):
<glm_pow2>:
mulss  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define float @glm_pow2(float %0) {
%2 = fmul float %0, %0
ret float %2
}
int mspack_version(int entity) {
  switch (entity) {
  case (0):
  case (1):
  case (2):
  case (4):
  case (10):
  case (12):
    return 1;
  case (3):
  case (5):
  case (6):
  case (7):
  case (8):
  case (9):
  case (11):
  case (13):
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<mspack_version>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x3,%eax
jb     1195 <mspack_version+0x95>
jmp    111b <mspack_version+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     11a1 <mspack_version+0xa1>
jmp    112c <mspack_version+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
je     1195 <mspack_version+0x95>
jmp    113d <mspack_version+0x3d>
mov    -0xc(%rbp),%eax
add    $0xfffffffb,%eax
sub    $0x5,%eax
jb     11a1 <mspack_version+0xa1>
jmp    1151 <mspack_version+0x51>
mov    -0xc(%rbp),%eax
sub    $0xa,%eax
je     1195 <mspack_version+0x95>
jmp    1162 <mspack_version+0x62>
mov    -0xc(%rbp),%eax
sub    $0xb,%eax
je     11a1 <mspack_version+0xa1>
jmp    1173 <mspack_version+0x73>
mov    -0xc(%rbp),%eax
sub    $0xc,%eax
je     1195 <mspack_version+0x95>
jmp    1184 <mspack_version+0x84>
mov    -0xc(%rbp),%eax
sub    $0xd,%eax
je     11a1 <mspack_version+0xa1>
jmp    11ad <mspack_version+0xad>
movl   $0x1,-0x4(%rbp)
jmp    11b4 <mspack_version+0xb4>
movl   $0x0,-0x4(%rbp)
jmp    11b4 <mspack_version+0xb4>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mspack_version>:
mov    $0xffffffff,%eax
cmp    $0xd,%edi
ja     1117 <mspack_version+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.mspack_version = [14 x i32] [i32 1, i32 1, i32 1, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0]
define i32 @mspack_version(i32 %0) {
%2 = icmp ult i32 %0, 14
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [14 x i32], [14 x i32]* @switch.table.mspack_version, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ -1, %1 ]
ret i32 %8
}
int sys$find_held(struct _generic_64 *holder, unsigned int *id,
                  unsigned int *attrib, unsigned int *contxt) {
  return ({
    unsigned long resultvar;
    register long int _a4 asm("r10") = (long)(contxt);
    register long int _a3 asm("rdx") = (long)(attrib);
    register long int _a2 asm("rsi") = (long)(id);
    register long int _a1 asm("rdi") = (long)(holder);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(93), "r"(_a1), "r"(_a2), "r"(_a3), "r"(_a4)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$find_held>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x30(%rbp),%r10
mov    $0x5d,%rax
int    $0x81
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$find_held>:
mov    %rcx,%r10
mov    $0x5d,%rax
int    $0x81
ret

LLVM IR (-O0):
%struct._generic_64 = type opaque
define i32 @"sys$find_held"(%struct._generic_64* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca %struct._generic_64*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
store %struct._generic_64* %0, %struct._generic_64** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%15 = load i32*, i32** %8
%16 = ptrtoint i32* %15 to i64
store i64 %16, i64* %10
%17 = load i32*, i32** %7
%18 = ptrtoint i32* %17 to i64
store i64 %18, i64* %11
%19 = load i32*, i32** %6
%20 = ptrtoint i32* %19 to i64
store i64 %20, i64* %12
%21 = load %struct._generic_64*, %struct._generic_64** %5
%22 = ptrtoint %struct._generic_64* %21 to i64
store i64 %22, i64* %13
%23 = load i64, i64* %13
%24 = load i64, i64* %12
%25 = load i64, i64* %11
%26 = load i64, i64* %10
%27 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},{r10},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 93, i64 %23, i64 %24, i64 %25, i64 %26)
store i64 %27, i64* %9
%28 = load i64, i64* %9
store i64 %28, i64* %14
%29 = load i64, i64* %14
%30 = trunc i64 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
%struct._generic_64 = type opaque
define i32 @"sys$find_held"(%struct._generic_64* %0, i32* %1, i32* %2, i32* %3) {
%5 = ptrtoint i32* %3 to i64
%6 = ptrtoint i32* %2 to i64
%7 = ptrtoint i32* %1 to i64
%8 = ptrtoint %struct._generic_64* %0 to i64
%9 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},{r10},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 93, i64 %8, i64 %7, i64 %6, i64 %5)
%10 = trunc i64 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ get_clock();
int main() {
  get_clock();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @get_clock()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_key_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *malloc(int);
int /*<<< orphan*/ pthread_key_create(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *);
int main(void) {
  pthread_key_t *key = malloc(sizeof(pthread_key_t));
  pthread_key_t *key2 = malloc(sizeof(pthread_key_t));
  pthread_key_create((pthread_key_t *)((long)key + 1), NULL);
  free(key2);
  pthread_key_create(key2, NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_key_create@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_key_create@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
add    $0x1,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <pthread_key_create@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <pthread_key_create@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* @malloc(i32 4)
store i32* %4, i32** %2
%5 = call i32* @malloc(i32 4)
store i32* %5, i32** %3
%6 = load i32*, i32** %2
%7 = ptrtoint i32* %6 to i64
%8 = add nsw i64 %7, 1
%9 = inttoptr i64 %8 to i32*
%10 = call i32 @pthread_key_create(i32* %9, i32* null)
%11 = load i32*, i32** %3
%12 = call i32 @free(i32* %11)
%13 = load i32*, i32** %3
%14 = call i32 @pthread_key_create(i32* %13, i32* null)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32* @malloc(i32 4)
%3 = ptrtoint i32* %1 to i64
%4 = add nsw i64 %3, 1
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @pthread_key_create(i32* %5, i32* null)
%7 = tail call i32 @free(i32* %2)
%8 = tail call i32 @pthread_key_create(i32* %2, i32* null)
ret i32 0
}
int test_imm_BFint16_mem(short *val) {
  return ((*val) & (-0xBF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BFint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffff41,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BFint16_mem>:
movzwl (%rdi),%eax
test   $0xff41,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BFint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -191
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_BFint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -191
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void nodeinfo_freenode(int index) {}


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

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

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

LLVM IR (-O2):
define void @nodeinfo_freenode(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  int i = 1;
  int *p = &i;
  uintptr_t iptr;
  iptr = (uintptr_t)p - (uintptr_t)&iptr;
  p = (int *)((uintptr_t)&iptr + iptr);
  if (*p != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    -0x18(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x1,(%rax)
je     115d <main+0x4d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i64
store i32 0, i32* %1
store i32 1, i32* %2
store i32* %2, i32** %3
%5 = load i32*, i32** %3
%6 = ptrtoint i32* %5 to i64
%7 = ptrtoint i64* %4 to i64
%8 = sub i64 %6, %7
store i64 %8, i64* %4
%9 = ptrtoint i64* %4 to i64
%10 = load i64, i64* %4
%11 = add i64 %9, %10
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %3
%13 = load i32*, i32** %3
%14 = load i32, i32* %13
%15 = icmp ne i32 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %0
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void printStr(char str[]) {
  int i;
  for (i = 0; '\0' != str[i]; i++)
    printf("%c", str[i]);
}


x86 assembly (clang, -O0):
<printStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     115f <printStr+0x4f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xeb8(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printStr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printStr>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1146 <printStr+0x36>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xed8(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <printStr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @printStr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
ES_FAST_IRQ_HANDLER(myIRQ) {}


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

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

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

LLVM IR (-O2):
define i32 @ES_FAST_IRQ_HANDLER(i32 %0) {
ret i32 undef
}