xunge/DecIR huggingface dataset:
/* Type definitions */
struct DynArr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fabs(double);
int /*<<< orphan*/ popDynArr(struct DynArr *);
int /*<<< orphan*/ pushDynArr(struct DynArr *, int /*<<< orphan*/);
double topDynArr(struct DynArr *);
void abs_val(struct DynArr *stack) {
  double i = topDynArr(stack);
  popDynArr(stack);
  pushDynArr(stack, fabs(i));
}


x86 assembly (clang, -O0):
<abs_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <popDynArr@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <fabs@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1060 <pushDynArr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_val>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <topDynArr@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1050 <popDynArr@plt>
movsd  0x8(%rsp),%xmm0
call   1040 <fabs@plt>
mov    %rbx,%rdi
mov    %eax,%esi
add    $0x10,%rsp
pop    %rbx
jmp    1060 <pushDynArr@plt>

LLVM IR (-O0):
%struct.DynArr = type { i32 }
define void @abs_val(%struct.DynArr* %0) {
%2 = alloca %struct.DynArr*
%3 = alloca double
store %struct.DynArr* %0, %struct.DynArr** %2
%4 = load %struct.DynArr*, %struct.DynArr** %2
%5 = call double @topDynArr(%struct.DynArr* %4)
store double %5, double* %3
%6 = load %struct.DynArr*, %struct.DynArr** %2
%7 = call i32 @popDynArr(%struct.DynArr* %6)
%8 = load %struct.DynArr*, %struct.DynArr** %2
%9 = load double, double* %3
%10 = call i32 @fabs(double %9)
%11 = call i32 @pushDynArr(%struct.DynArr* %8, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.DynArr = type { i32 }
define void @abs_val(%struct.DynArr* %0) {
%2 = tail call double @topDynArr(%struct.DynArr* %0)
%3 = tail call i32 @popDynArr(%struct.DynArr* %0)
%4 = tail call i32 @fabs(double %2)
%5 = tail call i32 @pushDynArr(%struct.DynArr* %0, i32 %4)
ret void
}
/* Variables and functions */
char const *gettext(char const *);
__attribute__((format_arg(1))) const char *_(const char *msgid) {
  if (!*msgid)
    return "";
  return gettext(msgid);
}


x86 assembly (clang, -O0):
<_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1139 <_+0x29>
lea    0xed0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <_+0x36>
mov    -0x10(%rbp),%rdi
call   1030 <gettext@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_>:
cmpb   $0x0,(%rdi)
je     111a <_+0xa>
jmp    1030 <gettext@plt>
lea    0xedf(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @_(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @gettext(i8* %9)
store i8* %10, i8** %2
br label %11
11: ; preds = %8, %7
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @_(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i8* @gettext(i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %7
}
int d_size_strmat(int m, int n) {
  int tmp = m < n ? m : n;
  int size = (m * n + tmp) * sizeof(double);
  return size;
}


x86 assembly (clang, -O0):
<d_size_strmat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <d_size_strmat+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <d_size_strmat+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_size_strmat>:
cmp    %esi,%edi
mov    %esi,%eax
cmovl  %edi,%eax
imul   %edi,%esi
add    %esi,%eax
shl    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @d_size_strmat(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %14
12: ; preds = %2
%13 = load i32, i32* %4
br label %14
14: ; preds = %12, %10
%15 = phi i32 [ %11, %10 ], [ %13, %12 ]
store i32 %15, i32* %5
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = mul nsw i32 %16, %17
%19 = load i32, i32* %5
%20 = add nsw i32 %18, %19
%21 = sext i32 %20 to i64
%22 = mul i64 %21, 8
%23 = trunc i64 %22 to i32
store i32 %23, i32* %6
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
define i32 @d_size_strmat(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = mul nsw i32 %1, %0
%6 = add nsw i32 %4, %5
%7 = shl i32 %6, 3
ret i32 %7
}
int _is_hex(int x) {
  return (x >= '0' && x <= '9') || (x >= 'a' && x <= 'f') ||
         (x >= 'A' && x <= 'F');
}


x86 assembly (clang, -O0):
<_is_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1120 <_is_hex+0x20>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <_is_hex+0x58>
cmpl   $0x61,-0x4(%rbp)
jl     1139 <_is_hex+0x39>
mov    $0x1,%al
cmpl   $0x66,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <_is_hex+0x58>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <_is_hex+0x52>
cmpl   $0x46,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_hex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x6,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @_is_hex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 102
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 65
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 70
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @_is_hex(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
unsigned int down(unsigned int maze) { return (maze >> 5); }


x86 assembly (clang, -O0):
<down>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<down>:
mov    %edi,%eax
shr    $0x5,%eax
ret

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

LLVM IR (-O2):
define i32 @down(i32 %0) {
%2 = lshr i32 %0, 5
ret i32 %2
}
/* Variables and functions */
bool malloc_lock_nop() { return true; }


x86 assembly (clang, -O0):
<malloc_lock_nop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_lock_nop>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @malloc_lock_nop() {
ret i32 1
}

LLVM IR (-O2):
define i32 @malloc_lock_nop() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ int2bin(int, char *, int);
int /*<<< orphan*/ printf(char *, char *);
void printBitVector(int bitVector) {
  char buffer[33];
  buffer[32] = '\0';
  int2bin(bitVector, buffer, 32);
  printf("\n==> BitVector = %s \n", buffer);
}


x86 assembly (clang, -O0):
<printBitVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x20,%edx
call   1030 <int2bin@plt>
lea    -0x30(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBitVector>:
push   %rbx
sub    $0x30,%rsp
movb   $0x0,0x20(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rsi
mov    $0x20,%edx
call   1030 <int2bin@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"\0A==> BitVector = %s \0A\00"
define void @printBitVector(i32 %0) {
%2 = alloca i32
%3 = alloca [33 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 32
store i8 0, i8* %4
%5 = load i32, i32* %2
%6 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 0
%7 = call i32 @int2bin(i32 %5, i8* %6, i32 32)
%8 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"\0A==> BitVector = %s \0A\00"
define void @printBitVector(i32 %0) {
%2 = alloca [33 x i8]
%3 = getelementptr inbounds [33 x i8], [33 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds [33 x i8], [33 x i8]* %2, i64 0, i64 32
store i8 0, i8* %4
%5 = call i32 @int2bin(i32 %0, i8* %3, i32 32)
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GC_new(void *);
void *malloc(int);
void *GC_malloc(int length, int size) {
  void *res = malloc(length * size);
  GC_new(res);
  return res;
}


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

x86 assembly (clang, -O2):
<GC_malloc>:
push   %rbx
imul   %esi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <GC_new@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @GC_malloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
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 = call i8* @malloc(i32 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = call i32 @GC_new(i8* %10)
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
define i8* @GC_malloc(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @GC_new(i8* %4)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void reap_periodic_cleanup(void *arg) { free(arg); }


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

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

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

LLVM IR (-O2):
define void @reap_periodic_cleanup(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void RGBAToUVRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @RGBAToUVRow_Any_NEON() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int file_exists(const char *filename) {
  FILE *file;
  if (file = fopen(filename, "r")) {
    fclose(file);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     115f <file_exists+0x3f>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1166 <file_exists+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <file_exists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @file_exists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
void pixie_delete_critical_section(void *cs) {}


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

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

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

LLVM IR (-O2):
define void @pixie_delete_critical_section(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void PerformanceAPI_BeginEvent_N(const char *inID, uint16_t inIDLength,
                                 const char *inData, uint16_t inDataLength,
                                 uint32_t inColor) {}


x86 assembly (clang, -O0):
<PerformanceAPI_BeginEvent_N>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @PerformanceAPI_BeginEvent_N(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
define void @PerformanceAPI_BeginEvent_N(i8* nocapture %0, i32 %1, i8* nocapture %2, i32 %3, i32 %4) {
ret void
}
/* Variables and functions */
double EcontourNNNAlt(double const, double const, double const, double const);
double EtrivAlt(double const, double const, double const);
double EnergyDifferenceNNN(const double k1, const double k3, const double k4,
                           const double eta) {
  return EtrivAlt(k1, k3, k4) * EcontourNNNAlt(k1, k3, k4, eta);
}


x86 assembly (clang, -O0):
<EnergyDifferenceNNN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <EtrivAlt@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1040 <EcontourNNNAlt@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EnergyDifferenceNNN>:
sub    $0x28,%rsp
movsd  %xmm3,0x20(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
call   1030 <EtrivAlt@plt>
movsd  %xmm0,0x18(%rsp)
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
call   1040 <EcontourNNNAlt@plt>
mulsd  0x18(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @EnergyDifferenceNNN(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = call double @EtrivAlt(double %9, double %10, double %11)
%13 = load double, double* %5
%14 = load double, double* %6
%15 = load double, double* %7
%16 = load double, double* %8
%17 = call double @EcontourNNNAlt(double %13, double %14, double %15, double %16)
%18 = fmul double %12, %17
ret double %18
}

LLVM IR (-O2):
define double @EnergyDifferenceNNN(double %0, double %1, double %2, double %3) {
%5 = tail call double @EtrivAlt(double %0, double %1, double %2)
%6 = tail call double @EcontourNNNAlt(double %0, double %1, double %2, double %3)
%7 = fmul double %5, %6
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int setregid(int /*<<< orphan*/, int);
int setrgid(gid_t rgid) { return (setregid(rgid, -1)); }


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

x86 assembly (clang, -O2):
<setrgid>:
mov    $0xffffffff,%esi
jmp    1030 <setregid@plt>

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

LLVM IR (-O2):
define i32 @setrgid(i32 %0) {
%2 = tail call i32 @setregid(i32 %0, i32 -1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ M_ILLEGAL();
void illegal(void) { M_ILLEGAL(); }


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

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

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

LLVM IR (-O2):
define void @illegal() {
%1 = tail call i32 (...) @M_ILLEGAL()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
main() {
  foo(3);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/ *);
void print_spaces(FILE *f, unsigned int spaces) {
  while (spaces--)
    putc(' ', f);
}


x86 assembly (clang, -O0):
<print_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1146 <print_spaces+0x36>
mov    -0x8(%rbp),%rsi
mov    $0x20,%edi
call   1030 <putc@plt>
jmp    111f <print_spaces+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_spaces>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
je     1132 <print_spaces+0x22>
mov    %esi,%ebx
mov    %rdi,%r14
nopl   (%rax)
mov    $0x20,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
add    $0xffffffff,%ebx
jne    1120 <print_spaces+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @print_spaces(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add i32 %6, -1
store i32 %7, i32* %4
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32*, i32** %3
%11 = call i32 @putc(i8 signext 32, i32* %10)
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @print_spaces(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = add i32 %5, -1
%7 = tail call i32 @putc(i8 signext 32, i32* %0)
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
int XGetAtomNames() {}


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

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

LLVM IR (-O0):
define i32 @XGetAtomNames() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XGetAtomNames() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ __lsan_ignore_object(void **);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void **);
void *malloc(int);
int /*<<< orphan*/ stderr;
int main() {
  void **p = malloc(sizeof(void *));
  *p = malloc(666);
  volatile void *q = malloc(1337);
  fprintf(stderr, "Test alloc: %p.\n", p);
  __lsan_ignore_object(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x29a,%edi
call   1050 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x539,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe7d(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <__lsan_ignore_object@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0x29a,%edi
call   1050 <malloc@plt>
mov    %rax,(%rbx)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <__lsan_ignore_object@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"Test alloc: %p.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8**
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i8* @malloc(i32 8)
%5 = bitcast i8* %4 to i8**
store i8** %5, i8*** %2
%6 = call i8* @malloc(i32 666)
%7 = load i8**, i8*** %2
store i8* %6, i8** %7
%8 = call i8* @malloc(i32 1337)
store i8* %8, i8** %3
%9 = load i32, i32* @stderr
%10 = load i8**, i8*** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8** %10)
%12 = load i8**, i8*** %2
%13 = call i32 @__lsan_ignore_object(i8** %12)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"Test alloc: %p.\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(8) i8* @malloc(i32 8)
%2 = bitcast i8* %1 to i8**
%3 = tail call dereferenceable_or_null(666) i8* @malloc(i32 666)
store i8* %3, i8** %2
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8** %2)
%6 = tail call i32 @__lsan_ignore_object(i8** %2)
ret i32 0
}
int vtom(int value) { return (1 << (value - 1)); }


x86 assembly (clang, -O0):
<vtom>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vtom>:
lea    -0x1(%rdi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @vtom(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = shl i32 1, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @vtom(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = shl nuw i32 1, %2
ret i32 %3
}
char *stpcpy(char *dst, const char *src) {
  do {
    *(dst++) = *src;
  } while (*(src++));
  return dst - 1;
}


x86 assembly (clang, -O0):
<stpcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    110c <stpcpy+0xc>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stpcpy>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rsi),%ecx
mov    %cl,0x1(%rax)
add    $0x1,%rax
cmpb   $0x0,(%rsi)
lea    0x1(%rsi),%rsi
jne    1110 <stpcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @stpcpy(i8* writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = phi i8* [ %1, %2 ], [ %8, %3 ]
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %6, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %5
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3
ret i8* %4
}
int f1(int a) {
  int v1 = (a == 3);
  int v2 = (a == 1);
  int v3 = (a == 4);
  int v4 = (a == 2);
  return v1 || v2 || v3 || v4;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x4,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x15(%rbp)
jne    117a <f1+0x7a>
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x15(%rbp)
jne    117a <f1+0x7a>
mov    $0x1,%al
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x15(%rbp)
jne    117a <f1+0x7a>
cmpl   $0x0,-0x14(%rbp)
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
cmp    $0x4,%edi
ja     1115 <f1+0x15>
mov    $0x1,%eax
mov    $0x1a,%ecx
bt     %edi,%ecx
jae    1115 <f1+0x15>
ret
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @f1(i32 %0) {
switch i32 %0, label %2 [
i32 4, label %5
i32 3, label %5
i32 1, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 2
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
void Con_Open(void) {}


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

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

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

LLVM IR (-O2):
define void @Con_Open() {
ret void
}
/* Variables and functions */
int product(int, int, int);
int factorial(int n) { return product(1, n, 1); }


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

x86 assembly (clang, -O2):
<factorial>:
mov    %edi,%esi
mov    $0x1,%edi
mov    $0x1,%edx
jmp    1030 <product@plt>

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

LLVM IR (-O2):
define i32 @factorial(i32 %0) {
%2 = tail call i32 @product(i32 1, i32 %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ my_strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void my_puterr(char *str) { write(2, str, my_strlen(str)); }


x86 assembly (clang, -O0):
<my_puterr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1040 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_puterr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <my_strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <write@plt>

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

LLVM IR (-O2):
define void @my_puterr(i8* %0) {
%2 = tail call i32 @my_strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
long tree_walker(void *, int, int, long (*)(), int /*<<< orphan*/);
long tree_walk(void *tree, int label_offset, int link_offset, long((*func)())) {
  return tree_walker(tree, label_offset, link_offset, func, 0);
}


x86 assembly (clang, -O0):
<tree_walk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <tree_walker@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tree_walk>:
xor    %r8d,%r8d
jmp    1030 <tree_walker@plt>

LLVM IR (-O0):
define i64 @tree_walk(i8* %0, i32 %1, i32 %2, i64 (...)* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64 (...)*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 (...)* %3, i64 (...)** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i64 (...)*, i64 (...)** %8
%13 = call i64 @tree_walker(i8* %9, i32 %10, i32 %11, i64 (...)* %12, i32 0)
ret i64 %13
}

LLVM IR (-O2):
define i64 @tree_walk(i8* %0, i32 %1, i32 %2, i64 (...)* %3) {
%5 = tail call i64 @tree_walker(i8* %0, i32 %1, i32 %2, i64 (...)* %3, i32 0)
ret i64 %5
}
int mustquote_inhdrq(int c) {
  if (c != '\n' && (c <= 040 || c == '=' || c == '?' || c == '_' || c >= 0177))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<mustquote_inhdrq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
je     114f <mustquote_inhdrq+0x4f>
cmpl   $0x20,-0x8(%rbp)
jle    1143 <mustquote_inhdrq+0x43>
cmpl   $0x3d,-0x8(%rbp)
je     1143 <mustquote_inhdrq+0x43>
cmpl   $0x3f,-0x8(%rbp)
je     1143 <mustquote_inhdrq+0x43>
cmpl   $0x5f,-0x8(%rbp)
je     1143 <mustquote_inhdrq+0x43>
cmpl   $0x7f,-0x8(%rbp)
jl     114f <mustquote_inhdrq+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <mustquote_inhdrq+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mustquote_inhdrq>:
cmp    $0xa,%edi
je     1121 <mustquote_inhdrq+0x21>
mov    $0x1,%eax
cmp    $0x7e,%edi
jg     1123 <mustquote_inhdrq+0x23>
cmp    $0x5f,%edi
je     1123 <mustquote_inhdrq+0x23>
cmp    $0x21,%edi
jl     1123 <mustquote_inhdrq+0x23>
and    $0xfffffffd,%edi
cmp    $0x3d,%edi
je     1123 <mustquote_inhdrq+0x23>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @mustquote_inhdrq(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %22
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 32
br i1 %8, label %21, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 61
br i1 %11, label %21, label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 63
br i1 %14, label %21, label %15
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 95
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp sge i32 %19, 127
br i1 %20, label %21, label %22
21: ; preds = %18, %15, %12, %9, %6
store i32 1, i32* %2
br label %23
22: ; preds = %18, %1
store i32 0, i32* %2
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @mustquote_inhdrq(i32 %0) {
%2 = icmp eq i32 %0, 10
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, 33
%5 = and i32 %0, -3
%6 = icmp eq i32 %5, 61
%7 = or i1 %4, %6
%8 = icmp eq i32 %0, 95
%9 = or i1 %8, %7
%10 = icmp sgt i32 %0, 126
%11 = or i1 %10, %9
br i1 %11, label %13, label %12
12: ; preds = %3, %1
br label %13
13: ; preds = %3, %12
%14 = phi i32 [ 0, %12 ], [ 1, %3 ]
ret i32 %14
}
int test_imm_C9int16_reg(short val) {
  return ((val) & (0xC9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C9int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xc9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C9int16_reg>:
test   $0xc9,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C9int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 201
%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_C9int16_reg(i16 signext %0) {
%2 = and i16 %0, 201
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int centeredSquare(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  printf("%d", centeredSquare(num));
  return 0;
}


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

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

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

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 = call i32 @centeredSquare(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void RTP_set_timestamp(unsigned char *p, unsigned int v) {
  p[4] = (unsigned char)((unsigned int)(0x000000ff & v >> 24));
  p[5] = (unsigned char)((unsigned int)(0x000000ff & v >> 16));
  p[6] = (unsigned char)((unsigned int)(0x000000ff & v >> 8));
  p[7] = (unsigned char)(0x000000ff & v);
}


x86 assembly (clang, -O0):
<RTP_set_timestamp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x4(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x5(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x6(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x7(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTP_set_timestamp>:
bswap  %esi
mov    %esi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @RTP_set_timestamp(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = lshr i32 %5, 24
%7 = and i32 255, %6
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 4
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = lshr i32 %11, 16
%13 = and i32 255, %12
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 5
store i8 %14, i8* %16
%17 = load i32, i32* %4
%18 = lshr i32 %17, 8
%19 = and i32 255, %18
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 6
store i8 %20, i8* %22
%23 = load i32, i32* %4
%24 = and i32 255, %23
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 7
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @RTP_set_timestamp(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %4, i8* %5
%6 = lshr i32 %1, 16
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 5
store i8 %7, i8* %8
%9 = lshr i32 %1, 8
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %10, i8* %11
%12 = trunc i32 %1 to i8
%13 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %12, i8* %13
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *str_dup(const char *s) {
  size_t len = strlen(s);
  char *r = malloc(len + 1);
  if (r)
    memcpy(r, s, len + 1);
  return r;
}


x86 assembly (clang, -O0):
<str_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117a <str_dup+0x4a>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
add    $0x1,%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_dup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rax,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
call   1050 <malloc@plt>
mov    %rax,%r15
test   %rax,%rax
je     1162 <str_dup+0x32>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @str_dup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %18
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = load i8*, i8** %2
%15 = load i64, i64* %3
%16 = add i64 %15, 1
%17 = call i32 @memcpy(i8* %13, i8* %14, i64 %16)
br label %18
18: ; preds = %12, %1
%19 = load i8*, i8** %4
ret i8* %19
}

LLVM IR (-O2):
define i8* @str_dup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %3)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Variables and functions */
void *hs_typed_realloc(void *, int /*<<< orphan*/, size_t);
void *realloc(void *p, size_t n) { return hs_typed_realloc(p, 0, n); }


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

x86 assembly (clang, -O2):
<realloc>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <hs_typed_realloc@plt>

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

LLVM IR (-O2):
define i8* @realloc(i8* %0, i64 %1) {
%3 = tail call i8* @hs_typed_realloc(i8* %0, i32 0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int fourtytwo() {
  printf("42\n");
  return 42;
}


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

x86 assembly (clang, -O2):
<fourtytwo>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2a,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [3 x i8] c"42\00"
define i32 @fourtytwo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 42
}
/* Variables and functions */
int f_int();
int /*<<< orphan*/ f_void();
main() {
  int i;
  i = f_int(), f_void();
  return i;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <f_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <f_void@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f_int()
%2 = tail call i32 (...) @f_void()
ret i32 %1
}
char *langRomTypeTurborTimer() { return "Turbo-R Timer"; }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Turbo-R Timer\00"
define i8* @langRomTypeTurborTimer() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
float quick_trig_acos(float);
float quick_trig_asin(float x) {
  return (3.141592653589793f / 2.0f - quick_trig_acos(x));
}


x86 assembly (clang, -O0):
<quick_trig_asin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <quick_trig_acos@plt>
movaps %xmm0,%xmm1
movss  0xece(%rip),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_trig_asin>:
push   %rax
call   1030 <quick_trig_acos@plt>
movss  0xee2(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @quick_trig_asin(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @quick_trig_acos(float %3)
%5 = fsub float 0x3FF921FB60000000, %4
ret float %5
}

LLVM IR (-O2):
define float @quick_trig_asin(float %0) {
%2 = tail call float @quick_trig_acos(float %0)
%3 = fsub float 0x3FF921FB60000000, %2
ret float %3
}
/* Variables and functions */
long *malloc(int);
long *lptr(long value) {
  long *p = malloc(sizeof(long));
  *p = value;
  return p;
}


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

x86 assembly (clang, -O2):
<lptr>:
push   %rbx
mov    %rdi,%rbx
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rbx,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i64* @lptr(i64 %0) {
%2 = tail call i64* @malloc(i32 8)
store i64 %0, i64* %2
ret i64* %2
}