xunge/DecIR huggingface dataset:
void touch_long(long *x) {}


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

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

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

LLVM IR (-O2):
define void @touch_long(i64* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int S_IRUSR;
int S_IWUSR;
int shm_open(char *, int /*<<< orphan*/, int);
int my_fb_open() {
  int shm_fd = shm_open("shared_fb", O_RDWR, S_IRUSR | S_IWUSR);
  return shm_fd;
}


x86 assembly (clang, -O0):
<my_fb_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
mov    0x2eaf(%rip),%rax
or     (%rax),%edx
lea    0xec6(%rip),%rdi
call   1030 <shm_open@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fb_open>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
lea    0xece(%rip),%rdi
jmp    1030 <shm_open@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"shared_fb\00"
@O_RDWR = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
define i32 @my_fb_open() {
%1 = alloca i32
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @S_IRUSR
%4 = load i32, i32* @S_IWUSR
%5 = or i32 %3, %4
%6 = call i32 @shm_open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %5)
store i32 %6, i32* %1
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"shared_fb\00"
@O_RDWR = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
define i32 @my_fb_open() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @S_IRUSR
%3 = load i32, i32* @S_IWUSR
%4 = or i32 %3, %2
%5 = tail call i32 @shm_open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %4)
ret i32 %5
}
/* Type definitions */
struct imv_viewport {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct imv_viewport *);
void imv_viewport_free(struct imv_viewport *view) { free(view); }


x86 assembly (clang, -O0):
<imv_viewport_free>:
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):
<imv_viewport_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.imv_viewport = type { i32 }
define void @imv_viewport_free(%struct.imv_viewport* %0) {
%2 = alloca %struct.imv_viewport*
store %struct.imv_viewport* %0, %struct.imv_viewport** %2
%3 = load %struct.imv_viewport*, %struct.imv_viewport** %2
%4 = call i32 @free(%struct.imv_viewport* %3)
ret void
}

LLVM IR (-O2):
%struct.imv_viewport = type { i32 }
define void @imv_viewport_free(%struct.imv_viewport* nocapture %0) {
%2 = tail call i32 @free(%struct.imv_viewport* %0)
ret void
}
int is_valid_uri(const char *uri) {
  return (uri[0] == '/' || (uri[0] == '*' && uri[1] == '\0'));
}


x86 assembly (clang, -O0):
<is_valid_uri>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x2f,%ecx
mov    %al,-0x9(%rbp)
je     1149 <is_valid_uri+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2a,%ecx
mov    %al,-0xa(%rbp)
jne    1143 <is_valid_uri+0x43>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_uri>:
mov    (%rdi),%al
cmp    $0x2f,%al
je     1114 <is_valid_uri+0x14>
cmp    $0x2a,%al
jne    111a <is_valid_uri+0x1a>
xor    %eax,%eax
cmpb   $0x0,0x1(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_valid_uri(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 47
br i1 %7, label %22, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 42
br i1 %13, label %14, label %20
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 0
br label %20
20: ; preds = %14, %8
%21 = phi i1 [ false, %8 ], [ %19, %14 ]
br label %22
22: ; preds = %20, %1
%23 = phi i1 [ true, %1 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @is_valid_uri(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %8 [
i8 47, label %9
i8 42, label %3
]
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = zext i1 %6 to i32
br label %9
8: ; preds = %1
br label %9
9: ; preds = %1, %8, %3
%10 = phi i32 [ 1, %1 ], [ %7, %3 ], [ 0, %8 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ hello_call();
int main(int argc, char *argv[]) {
  hello_call();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @hello_call()
ret i32 0
}
/* Variables and functions */
int isatty(int);
int posixIsATTY(int fd) { return isatty(fd); }


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

x86 assembly (clang, -O2):
<posixIsATTY>:
jmp    1030 <isatty@plt>

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

LLVM IR (-O2):
define i32 @posixIsATTY(i32 %0) {
%2 = tail call i32 @isatty(i32 %0)
ret i32 %2
}
unsigned long long square_of_sum_efficient(int limit) {
  int sum = (limit * (limit + 1)) / 2;
  return (unsigned long long)sum * sum;
}


x86 assembly (clang, -O0):
<square_of_sum_efficient>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<square_of_sum_efficient>:
lea    0x1(%rdi),%eax
imul   %edi,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rax
imul   %rax,%rax
ret

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

LLVM IR (-O2):
define i64 @square_of_sum_efficient(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = mul nsw i32 %2, %0
%4 = sdiv i32 %3, 2
%5 = sext i32 %4 to i64
%6 = mul nsw i64 %5, %5
ret i64 %6
}
int venc_init_platform_driver(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @venc_init_platform_driver() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ IntDisable(unsigned long);
int /*<<< orphan*/ IntUnregister(unsigned long);
void ADCIntUnregister(unsigned long ulBase, unsigned long ulSequenceNum) {
  unsigned long ulInt;
  ;
  ;
  ulInt = 30 + ulSequenceNum;
  IntDisable(ulInt);
  IntUnregister(ulInt);
}


x86 assembly (clang, -O0):
<ADCIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1e,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <IntDisable@plt>
mov    -0x18(%rbp),%rdi
call   1040 <IntUnregister@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCIntUnregister>:
push   %rbx
lea    0x1e(%rsi),%rbx
mov    %rbx,%rdi
call   1030 <IntDisable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <IntUnregister@plt>

LLVM IR (-O0):
define void @ADCIntUnregister(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 30, %6
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = call i32 @IntDisable(i64 %8)
%10 = load i64, i64* %5
%11 = call i32 @IntUnregister(i64 %10)
ret void
}

LLVM IR (-O2):
define void @ADCIntUnregister(i64 %0, i64 %1) {
%3 = add i64 %1, 30
%4 = tail call i32 @IntDisable(i64 %3)
%5 = tail call i32 @IntUnregister(i64 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
char *mp_store_u8(char *data, uint8_t val) {
  struct __attribute__((packed)) cast {
    uint8_t val;
  };
  ((struct cast *)(data))->val = (val);
  return data + sizeof(uint8_t);
}


x86 assembly (clang, -O0):
<mp_store_u8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_store_u8>:
mov    %esi,(%rdi)
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
%struct.cast = type { i32 }
define i8* @mp_store_u8(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.cast*
%8 = getelementptr inbounds %struct.cast, %struct.cast* %7, i32 0, i32 0
store i32 %5, i32* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 4
ret i8* %10
}

LLVM IR (-O2):
define i8* @mp_store_u8(i8* writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
%4 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %4
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int32_t prv_not_equal_str_fn(const char *a, const char *b) {
  return strcmp(a, b) ? -1 : 0;
}


x86 assembly (clang, -O0):
<prv_not_equal_str_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_not_equal_str_fn>:
push   %rax
call   1030 <strcmp@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @prv_not_equal_str_fn(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 -1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @prv_not_equal_str_fn(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp ne i64 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
double ln_get_dynamical_time_diff(double);
double ln_get_jde(double JD) {
  double JDE;
  double secs_in_day = 24 * 60 * 60;
  JDE = JD + ln_get_dynamical_time_diff(JD) / secs_in_day;
  return JDE;
}


x86 assembly (clang, -O0):
<ln_get_jde>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ln_get_dynamical_time_diff@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_jde>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <ln_get_dynamical_time_diff@plt>
divsd  0xedd(%rip),%xmm0
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ln_get_jde(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 8.640000e+04, double* %4
%5 = load double, double* %2
%6 = load double, double* %2
%7 = call double @ln_get_dynamical_time_diff(double %6)
%8 = load double, double* %4
%9 = fdiv double %7, %8
%10 = fadd double %5, %9
store double %10, double* %3
%11 = load double, double* %3
ret double %11
}

LLVM IR (-O2):
define double @ln_get_jde(double %0) {
%2 = tail call double @ln_get_dynamical_time_diff(double %0)
%3 = fdiv double %2, 8.640000e+04
%4 = fadd double %3, %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void nrerror(const char error_text[]) {
  fprintf(stderr, "Numerical Recipes run-time error...\n");
  fprintf(stderr, "%s\n", error_text);
  fprintf(stderr, "...now exiting to system...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<nrerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xece(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<nrerror>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%edi
lea    0xec8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xedc(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Numerical Recipes run-time error...\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [29 x i8] c"...now exiting to system...\0A\00"
define void @nrerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %2
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Numerical Recipes run-time error...\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [29 x i8] c"...now exiting to system...\0A\00"
define void @nrerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int __u32;

/* Variables and functions */
int hea_u32_bit(int);
__u32 hea_set_u32_bit(__u32 v, int b) { return v | hea_u32_bit(b); }


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

x86 assembly (clang, -O2):
<hea_set_u32_bit>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <hea_u32_bit@plt>
or     %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @hea_set_u32_bit(i32 %0, i32 %1) {
%3 = tail call i32 @hea_u32_bit(i32 %1)
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int is_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  if (num < 1)
    return -1;
  printf("%d", is_prime(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>
cmpl   $0x1,-0x8(%rbp)
jge    1165 <main+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    1182 <main+0x52>
mov    -0x8(%rbp),%edi
call   1040 <is_prime@plt>
mov    %eax,%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
test   %edi,%edi
jle    1161 <main+0x31>
call   1040 <is_prime@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
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 = icmp slt i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %11
7: ; preds = %0
%8 = load i32, i32* %2
%9 = call i32 @is_prime(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
store i32 0, i32* %1
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %1
ret i32 %12
}

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 = icmp slt i32 %4, 1
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = call i32 @is_prime(i32 %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %0, %6
%10 = phi i32 [ 0, %6 ], [ -1, %0 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_file;

/* Variables and functions */
int SQLITE_OK;
int memShmUnmap(sqlite3_file *pFile, int deleteFlag) { return SQLITE_OK; }


x86 assembly (clang, -O0):
<memShmUnmap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memShmUnmap>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@SQLITE_OK = global i32 0
define i32 @memShmUnmap(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* @SQLITE_OK
ret i32 %5
}

LLVM IR (-O2):
@SQLITE_OK = global i32 0
define i32 @memShmUnmap(i32* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @SQLITE_OK
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ c(double, double, double);
double fmin(int /*<<< orphan*/, int /*<<< orphan*/);
double ey(double x, double y) {
  return fmin(c(x + 0.4, y + 0.35, 0.1), c(x + 0.15, y + 0.35, 0.1));
}


x86 assembly (clang, -O0):
<ey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xede(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xec1(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xeac(%rip),%xmm2
call   1040 <c@plt>
mov    %eax,-0x14(%rbp)
movsd  0xeac(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xe97(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xe82(%rip),%xmm2
call   1040 <c@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1030 <fmin@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ey>:
push   %rbx
sub    $0x10,%rsp
movapd %xmm0,%xmm2
movsd  %xmm0,0x8(%rsp)
movsd  0xec9(%rip),%xmm0
addsd  %xmm2,%xmm0
addsd  0xec5(%rip),%xmm1
movsd  %xmm1,(%rsp)
movsd  0xec0(%rip),%xmm2
call   1040 <c@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
addsd  0xeb3(%rip),%xmm0
movsd  (%rsp),%xmm1
movsd  0xe9e(%rip),%xmm2
call   1040 <c@plt>
mov    %ebx,%edi
mov    %eax,%esi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <fmin@plt>

LLVM IR (-O0):
define double @ey(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fadd double %5, 4.000000e-01
%7 = load double, double* %4
%8 = fadd double %7, 3.500000e-01
%9 = call i32 @c(double %6, double %8, double 1.000000e-01)
%10 = load double, double* %3
%11 = fadd double %10, 1.500000e-01
%12 = load double, double* %4
%13 = fadd double %12, 3.500000e-01
%14 = call i32 @c(double %11, double %13, double 1.000000e-01)
%15 = call double @fmin(i32 %9, i32 %14)
ret double %15
}

LLVM IR (-O2):
define double @ey(double %0, double %1) {
%3 = fadd double %0, 4.000000e-01
%4 = fadd double %1, 3.500000e-01
%5 = tail call i32 @c(double %3, double %4, double 1.000000e-01)
%6 = fadd double %0, 1.500000e-01
%7 = tail call i32 @c(double %6, double %4, double 1.000000e-01)
%8 = tail call double @fmin(i32 %5, i32 %7)
ret double %8
}
/* Variables and functions */
int strcmp(char *, char *);
int arrayStrcmp(char **s1, char **s2) { return strcmp(*s1, *s2); }


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

x86 assembly (clang, -O2):
<arrayStrcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @arrayStrcmp(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(1) %4)
ret i32 %5
}
/* Variables and functions */
int sin(double);
int sqrt(int);
double f(double x) { return (sqrt(1 + x) / (2 + sin(x))); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xecb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  0xecd(%rip),%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1040 <sqrt@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
mov    %eax,%ecx
add    $0x2,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double 1.000000e+00, %3
%5 = fptosi double %4 to i32
%6 = call i32 @sqrt(i32 %5)
%7 = load double, double* %2
%8 = call i32 @sin(double %7)
%9 = add nsw i32 2, %8
%10 = sdiv i32 %6, %9
%11 = sitofp i32 %10 to double
ret double %11
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fptosi double %2 to i32
%4 = tail call i32 @sqrt(i32 %3)
%5 = tail call i32 @sin(double %0)
%6 = add nsw i32 %5, 2
%7 = sdiv i32 %4, %6
%8 = sitofp i32 %7 to double
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "rill_dump -<h|s> <file>\n");
  fprintf(stderr, "rill_dump -<v|r> -<a|b> <file>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeda(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"rill_dump -<h|s> <file>\0A\00"
@.str.1 = [32 x i8] c"rill_dump -<v|r> -<a|b> <file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"rill_dump -<h|s> <file>\0A\00"
@.str.1 = [32 x i8] c"rill_dump -<v|r> -<a|b> <file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
void clr_keyboard_buffer() {
  char ch;
  scanf("%c", &ch);
  while (ch != '\n')
    scanf("%c", &ch);
}


x86 assembly (clang, -O0):
<clr_keyboard_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1030 <scanf@plt>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
je     114a <clr_keyboard_buffer+0x3a>
lea    0xec4(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1030 <scanf@plt>
jmp    1128 <clr_keyboard_buffer+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clr_keyboard_buffer>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1030 <scanf@plt>
cmpb   $0xa,0x7(%rsp)
je     1152 <clr_keyboard_buffer+0x42>
lea    0xecd(%rip),%r14
lea    0x7(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
cmpb   $0xa,0x7(%rsp)
jne    1140 <clr_keyboard_buffer+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @clr_keyboard_buffer() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %3
3: ; preds = %7, %0
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @clr_keyboard_buffer() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 10
br i1 %4, label %9, label %5
5: ; preds = %0, %5
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = load i8, i8* %1
%8 = icmp eq i8 %7, 10
br i1 %8, label %9, label %5
9: ; preds = %5, %0
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int);
void print_addr_dec(uint8_t *addr) {
  printf("%d.%d.%d.%d.%d.%d\n", addr[0], addr[1], addr[2], addr[3], addr[4],
         addr[5]);
}


x86 assembly (clang, -O0):
<print_addr_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%r8d
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%r9d
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
lea    0xeb2(%rip),%rdi
mov    %eax,(%rsp)
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_addr_dec>:
push   %rax
mov    (%rdi),%esi
mov    0x4(%rdi),%edx
mov    0x8(%rdi),%ecx
mov    0xc(%rdi),%r8d
mov    0x10(%rdi),%r9d
mov    0x14(%rdi),%eax
mov    %eax,(%rsp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"%d.%d.%d.%d.%d.%d\0A\00"
define void @print_addr_dec(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32, i32* %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 3
%14 = load i32, i32* %13
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 4
%17 = load i32, i32* %16
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 5
%20 = load i32, i32* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %8, i32 %11, i32 %14, i32 %17, i32 %20)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%d.%d.%d.%d.%d.%d\0A\00"
define void @print_addr_dec(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %0, i64 3
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %0, i64 4
%10 = load i32, i32* %9
%11 = getelementptr inbounds i32, i32* %0, i64 5
%12 = load i32, i32* %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4, i32 %6, i32 %8, i32 %10, i32 %12)
ret void
}
int little_endian(void) {
  static short one = 1;
  return *(char *)&one == 1;
}


x86 assembly (clang, -O0):
<little_endian>:
push   %rbp
mov    %rsp,%rbp
movsbl 0x2f15(%rip),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@little_endian.one = internal global i16 1
define i32 @little_endian() {
%1 = load i8, i8* bitcast (i16* @little_endian.one to i8*)
%2 = sext i8 %1 to i32
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @little_endian() {
ret i32 1
}
int ghmm_cseq_class(const double *O, int index, double *osum) { return 0; }


x86 assembly (clang, -O0):
<ghmm_cseq_class>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ghmm_cseq_class(double* %0, i32 %1, double* %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca double*
store double* %0, double** %4
store i32 %1, i32* %5
store double* %2, double** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @ghmm_cseq_class(double* nocapture readnone %0, i32 %1, double* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void mixed_eq_ne(int a) {
  char *b = ((void *)0);
  if (a == 1)
    b = malloc(1);
  if (a + 1U != 2)
    return;
  if (a - 1U != 0)
    return;
  free(b);
}


x86 assembly (clang, -O0):
<mixed_eq_ne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    114b <mixed_eq_ne+0x2b>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x2,%eax
je     115f <mixed_eq_ne+0x3f>
jmp    117c <mixed_eq_ne+0x5c>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cmp    $0x0,%eax
je     1173 <mixed_eq_ne+0x53>
jmp    117c <mixed_eq_ne+0x5c>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixed_eq_ne>:
cmp    $0x1,%edi
jne    1139 <mixed_eq_ne+0x19>
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @mixed_eq_ne(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%5 = tail call i32 @free(i8* %4)
br label %6
6: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IO(char, int /*<<< orphan*/);
int ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int msvd_enable_irq(int fd) { return ioctl(fd, _IO('m', 0), 0); }


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

x86 assembly (clang, -O2):
<msvd_enable_irq>:
push   %rbx
mov    %edi,%ebx
mov    $0x6d,%edi
xor    %esi,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @msvd_enable_irq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i8 signext 109, i32 0)
%5 = call i32 @ioctl(i32 %3, i32 %4, i32 0)
ret i32 %5
}

LLVM IR (-O2):
define i32 @msvd_enable_irq(i32 %0) {
%2 = tail call i32 @_IO(i8 signext 109, i32 0)
%3 = tail call i32 @ioctl(i32 %0, i32 %2, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void do_something_awesome(char *string) {
  printf("The string is: %s\n", string);
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"The string is: %s\0A\00"
define void @do_something_awesome(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"The string is: %s\0A\00"
define void @do_something_awesome(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void ERR_peek_last_error(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  enum Color { GREEN = 1, RED, BLUE, GREEN_RED = 10, GREEN_BLUE } ColorVal;
  ColorVal = GREEN;
  printf("sizeof %d\n", sizeof(ColorVal));
  printf("%d,", ColorVal);
  ColorVal = GREEN_BLUE;
  printf("%d,", ColorVal);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movl   $0xb,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xee2(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"sizeof %d\0A\00"
@.str.1 = [4 x i8] c"%d,\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 11)
ret void
}
void TraceInit(void) {}


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

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

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

LLVM IR (-O2):
define void @TraceInit() {
ret void
}
fn2() {
  if (1)
    return 2;
}


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

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

LLVM IR (-O0):
define i32 @fn2() {
ret i32 2
}

LLVM IR (-O2):
define i32 @fn2() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void success_or_failure(int res) {
  if (res == 1) {
    printf("\x1B[32m"
           "success!\n"
           "\x1B[0m");
  } else {
    printf("\x1B[31m"
           "failure!\n"
           "\x1B[0m");
  }
}


x86 assembly (clang, -O0):
<success_or_failure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1136 <success_or_failure+0x26>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <success_or_failure+0x32>
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<success_or_failure>:
cmp    $0x1,%edi
lea    0xee6(%rip),%rax
lea    0xef2(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\1B[32msuccess!\0A\1B[0m\00"
@.str.1 = [19 x i8] c"\1B[31mfailure!\0A\1B[0m\00"
define void @success_or_failure(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\1B[32msuccess!\0A\1B[0m\00"
@.str.1 = [19 x i8] c"\1B[31mfailure!\0A\1B[0m\00"
define void @success_or_failure(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret void
}
int maxval(int val1, int val2) { return val1 > val2 ? val1 : val2; }


x86 assembly (clang, -O0):
<maxval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <maxval+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <maxval+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxval>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @maxval(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void on_escape_release(union ui_state *state) {}


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

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

LLVM IR (-O0):
%union.ui_state = type opaque
define void @on_escape_release(%union.ui_state* %0) {
%2 = alloca %union.ui_state*
store %union.ui_state* %0, %union.ui_state** %2
ret void
}

LLVM IR (-O2):
%union.ui_state = type opaque
define void @on_escape_release(%union.ui_state* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned short VIM_HIF_GetReg16(int);
void VIM_IPP_GetImageSize(unsigned short *wWidth, unsigned short *wHeight) {
  *wWidth = VIM_HIF_GetReg16((0x1c00 + 0x002));
  *wHeight = VIM_HIF_GetReg16((0x1c00 + 0x004));
}


x86 assembly (clang, -O0):
<VIM_IPP_GetImageSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1c02,%edi
call   1030 <VIM_HIF_GetReg16@plt>
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
mov    $0x1c04,%edi
call   1030 <VIM_HIF_GetReg16@plt>
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_IPP_GetImageSize>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x1c02,%edi
call   1030 <VIM_HIF_GetReg16@plt>
mov    %ax,(%rbx)
mov    $0x1c04,%edi
call   1030 <VIM_HIF_GetReg16@plt>
mov    %ax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @VIM_IPP_GetImageSize(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
store i16* %0, i16** %3
store i16* %1, i16** %4
%5 = call zeroext i16 @VIM_HIF_GetReg16(i32 7170)
%6 = load i16*, i16** %3
store i16 %5, i16* %6
%7 = call zeroext i16 @VIM_HIF_GetReg16(i32 7172)
%8 = load i16*, i16** %4
store i16 %7, i16* %8
ret void
}

LLVM IR (-O2):
define void @VIM_IPP_GetImageSize(i16* nocapture writeonly %0, i16* nocapture writeonly %1) {
%3 = tail call zeroext i16 @VIM_HIF_GetReg16(i32 7170)
store i16 %3, i16* %0
%4 = tail call zeroext i16 @VIM_HIF_GetReg16(i32 7172)
store i16 %4, i16* %1
ret void
}
void auth_checkoptions(void) {}


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

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

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

LLVM IR (-O2):
define void @auth_checkoptions() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ forwpage(int, int);
int /*<<< orphan*/ nextwind(int /*<<< orphan*/, int);
int /*<<< orphan*/ prevwind(int /*<<< orphan*/, int);
nextdown(int f, int n) {
  nextwind(0, 1);
  forwpage(f, n);
  prevwind(0, 1);
}


x86 assembly (clang, -O0):
<nextdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <nextwind@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <forwpage@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1050 <prevwind@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextdown>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <nextwind@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <forwpage@plt>
xor    %edi,%edi
mov    $0x1,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <prevwind@plt>

LLVM IR (-O0):
define i32 @nextdown(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 @nextwind(i32 0, i32 1)
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 @forwpage(i32 %7, i32 %8)
%10 = call i32 @prevwind(i32 0, i32 1)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @nextdown(i32 %0, i32 %1) {
%3 = tail call i32 @nextwind(i32 0, i32 1)
%4 = tail call i32 @forwpage(i32 %0, i32 %1)
%5 = tail call i32 @prevwind(i32 0, i32 1)
ret i32 undef
}
void SwapWrong(int num1, int num2) {
  int temp = num1;
  num1 = num2;
  num2 = temp;
}


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

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

LLVM IR (-O0):
define void @SwapWrong(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
store i32 %6, i32* %5
%7 = load i32, i32* %4
store i32 %7, i32* %3
%8 = load i32, i32* %5
store i32 %8, i32* %4
ret void
}

LLVM IR (-O2):
define void @SwapWrong(i32 %0, i32 %1) {
ret void
}
int main() {
  struct mytype {
    double v[10];
  };
  struct mytype v2L;
  v2L.v[0] = 1.0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movsd  0xeed(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.mytype = type { [10 x double] }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.mytype
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.mytype, %struct.mytype* %2, i32 0, i32 0
%4 = getelementptr inbounds [10 x double], [10 x double]* %3, i64 0, i64 0
store double 1.000000e+00, double* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}