xunge/DecIR huggingface dataset:
unsigned long hash1(const char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hash1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash1+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash1+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash1>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash1+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash1+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ restore_global_attribute_values();
int /*<<< orphan*/ restore_global_param_values();
void param_injector_end_passes_callback(void *gcc_data, void *data) {
  restore_global_param_values();
  restore_global_attribute_values();
}


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

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

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

LLVM IR (-O2):
define void @param_injector_end_passes_callback(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @restore_global_param_values()
%4 = tail call i32 (...) @restore_global_attribute_values()
ret void
}
/* Variables and functions */
void *instruction_pointer();
void *FIPS_text_end() { return instruction_pointer(); }


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

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

LLVM IR (-O0):
define i8* @FIPS_text_end() {
%1 = call i8* (...) @instruction_pointer()
ret i8* %1
}

LLVM IR (-O2):
define i8* @FIPS_text_end() {
%1 = tail call i8* (...) @instruction_pointer()
ret i8* %1
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
double rtclock() {
  struct timezone tzp;
  struct timeval tp;
  int stat;
  gettimeofday(&tp, &tzp);
  return (tp.tv_sec + tp.tv_usec * 1.0e-6);
}


x86 assembly (clang, -O0):
<rtclock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <gettimeofday@plt>
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtclock>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0xed1(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timezone = type { i32 }
%struct.timeval = type { double, double }
define double @rtclock() {
%1 = alloca %struct.timezone
%2 = alloca %struct.timeval
%3 = alloca i32
%4 = call i32 @gettimeofday(%struct.timeval* %2, %struct.timezone* %1)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%8 = load double, double* %7
%9 = call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %6)
ret double %9
}

LLVM IR (-O2):
%struct.timezone = type { i32 }
%struct.timeval = type { double, double }
define double @rtclock() {
%1 = alloca %struct.timezone
%2 = alloca %struct.timeval
%3 = bitcast %struct.timezone* %1 to i8*
%4 = bitcast %struct.timeval* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %2, %struct.timezone* %1)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%9 = load double, double* %8
%10 = tail call double @llvm.fmuladd.f64(double %9, double 0x3EB0C6F7A0B5ED8D, double %7)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int task_parse(int, int, char **);
int main(int argc, char **argv) {
  int task_exit;
  task_exit = task_parse(1, argc, argv);
  exit(task_exit);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
call   1030 <task_parse@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x1,%edi
call   1030 <task_parse@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @task_parse(i32 1, i32 %7, i8** %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @task_parse(i32 1, i32 %0, i8** %1)
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_PURPOSE;
typedef int /*<<< orphan*/ X509;

/* Variables and functions */
int no_check(const X509_PURPOSE *xp, const X509 *x, int ca) { return 1; }


x86 assembly (clang, -O0):
<no_check>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @no_check(i32* nocapture readnone %0, i32* nocapture readnone %1, i32 %2) {
ret i32 1
}
void dumpRAM(void) {
  char volatile *IO = (char *)(0x3c000000 + 4 * 0x00000020);
  *(IO + 7) = 1;
}


x86 assembly (clang, -O0):
<dumpRAM>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3c000080,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x1,0x7(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpRAM>:
movb   $0x1,0x3c000087
01
ret

LLVM IR (-O0):
define void @dumpRAM() {
%1 = alloca i8*
store i8* inttoptr (i64 1006633088 to i8*), i8** %1
%2 = load i8*, i8** %1
%3 = getelementptr inbounds i8, i8* %2, i64 7
store volatile i8 1, i8* %3
ret void
}

LLVM IR (-O2):
define void @dumpRAM() {
store volatile i8 1, i8* inttoptr (i64 1006633095 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOCK_EX;
int resctrl_lock(int /*<<< orphan*/);
int resctrl_lock_exclusive(void) { return resctrl_lock(LOCK_EX); }


x86 assembly (clang, -O0):
<resctrl_lock_exclusive>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <resctrl_lock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<resctrl_lock_exclusive>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <resctrl_lock@plt>

LLVM IR (-O0):
@LOCK_EX = global i32 0
define i32 @resctrl_lock_exclusive() {
%1 = load i32, i32* @LOCK_EX
%2 = call i32 @resctrl_lock(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@LOCK_EX = global i32 0
define i32 @resctrl_lock_exclusive() {
%1 = load i32, i32* @LOCK_EX
%2 = tail call i32 @resctrl_lock(i32 %1)
ret i32 %2
}
/* Type definitions */
struct timeval {
  int tv_sec;
  unsigned long tv_usec;
};

/* Variables and functions */
unsigned long timediff(const struct timeval *t1, const struct timeval *t2) {
  return (t1->tv_sec - t2->tv_sec) * 1000000 + (t1->tv_usec - t2->tv_usec);
}


x86 assembly (clang, -O0):
<timediff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
imul   $0xf4240,%eax,%eax
cltq
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
mov    -0x10(%rbp),%rdx
sub    0x8(%rdx),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timediff>:
movslq (%rdi),%rax
movslq (%rsi),%rcx
sub    %rcx,%rax
imul   $0xf4240,%rax,%rcx
mov    0x8(%rdi),%rax
sub    0x8(%rsi),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @timediff(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timeval*, %struct.timeval** %4
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = mul nsw i32 %11, 1000000
%13 = sext i32 %12 to i64
%14 = load %struct.timeval*, %struct.timeval** %3
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 1
%16 = load i64, i64* %15
%17 = load %struct.timeval*, %struct.timeval** %4
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 1
%19 = load i64, i64* %18
%20 = sub i64 %16, %19
%21 = add i64 %13, %20
ret i64 %21
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @timediff(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, 1000000
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%11 = load i64, i64* %10
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%13 = load i64, i64* %12
%14 = sub i64 %11, %13
%15 = add i64 %14, %9
ret i64 %15
}
ans(i) { puts(i ? "yes" : "no"); }


x86 assembly (clang, -O0):
<ans>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
lea    0xedf(%rip),%rdi
lea    0xed4(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ans>:
test   %edi,%edi
lea    0xeeb(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"yes\00"
@.str.1 = [3 x i8] c"no\00"
define i32 @ans(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %7)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str = [4 x i8] c"yes\00"
@.str.1 = [3 x i8] c"no\00"
define i32 @ans(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %3)
ret i32 undef
}
/* Variables and functions */
scalar_t__ errno;
int Stty(int fd, const char *mode) {
  errno = 0;
  return -1;
}


x86 assembly (clang, -O0):
<Stty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ece(%rip),%rax
movq   $0x0,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Stty>:
mov    0x2ed9(%rip),%rax
movq   $0x0,(%rax)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@errno = global i64 0
define i32 @Stty(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
store i64 0, i64* @errno
ret i32 -1
}

LLVM IR (-O2):
@errno = global i64 0
define i32 @Stty(i32 %0, i8* nocapture readnone %1) {
store i64 0, i64* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int reverse_function(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num, reverse_number;
  printf("\nEnter any number:");
  scanf("%d", &num);
  reverse_number = reverse_function(num);
  printf("\nAfter reverse the number is :%d", reverse_number);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <reverse_function@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\0AEnter any number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [33 x i8] c"\0AAfter reverse the number is :%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @reverse_function(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0AEnter any number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [33 x i8] c"\0AAfter reverse the number is :%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @reverse_function(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ bell_percent;
};
typedef TYPE_1__ XKeyboardControl;

/* Variables and functions */
int get_XKeyboardControl_bell_percent(void *_p) {
  return (int)((XKeyboardControl *)_p)->bell_percent;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XKeyboardControl_bell_percent(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exec_shrd(int, int, int);
void test_shrd(void) {
  int i;
  for (i = 0; i < 32; i++)
    exec_shrd(0x21ad3d34, 0x12345678, i);
  for (i = 0; i < 32; i++)
    exec_shrd(0x813f3421, 0x82345678, i);
}


x86 assembly (clang, -O0):
<test_shrd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    1149 <test_shrd+0x39>
mov    -0x4(%rbp),%edx
mov    $0x21ad3d34,%edi
mov    $0x12345678,%esi
call   1030 <exec_shrd@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test_shrd+0xf>
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    117a <test_shrd+0x6a>
mov    -0x4(%rbp),%edx
mov    $0x813f3421,%edi
mov    $0x82345678,%esi
call   1030 <exec_shrd@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <test_shrd+0x40>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_shrd>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x21ad3d34,%edi
mov    $0x12345678,%esi
mov    %ebx,%edx
call   1030 <exec_shrd@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1120 <test_shrd+0x10>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x813f3421,%edi
mov    $0x82345678,%esi
mov    %ebx,%edx
call   1030 <exec_shrd@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1140 <test_shrd+0x30>
pop    %rbx
ret

LLVM IR (-O0):
define void @test_shrd() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 32
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @exec_shrd(i32 565001524, i32 305419896, i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
store i32 0, i32* %1
br label %12
12: ; preds = %18, %11
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 32
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %1
%17 = call i32 @exec_shrd(i32 -2126564319, i32 -2110499208, i32 %16)
br label %18
18: ; preds = %15
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %12
21: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @test_shrd() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @exec_shrd(i32 565001524, i32 305419896, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 32
br i1 %5, label %6, label %1
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ 0, %1 ]
%8 = tail call i32 @exec_shrd(i32 -2126564319, i32 -2110499208, i32 %7)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, 32
br i1 %10, label %11, label %6
11: ; preds = %6
ret void
}
int _cmpeq2(int src1, int src2) {
  short s1[2], s2[2];
  int r0, r1;
  int result;
  *((int *)s1) = src1;
  *((int *)s2) = src2;
  r0 = s1[0] == s2[0] ? 1 : 0;
  r1 = s1[1] == s2[1] ? 1 : 0;
  result = (r1 << 1) | r0;
  return result;
}


x86 assembly (clang, -O0):
<_cmpeq2>:
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,-0x10(%rbp)
movswl -0xc(%rbp),%edx
movswl -0x10(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x14(%rbp)
movswl -0xa(%rbp),%edx
movswl -0xe(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x1,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cmpeq2>:
xor    %esi,%edi
xor    %eax,%eax
test   %di,%di
sete   %al
xor    %ecx,%ecx
cmp    $0x10000,%edi
setb   %cl
lea    (%rax,%rcx,2),%eax
ret

LLVM IR (-O0):
define i32 @_cmpeq2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i16]
%6 = alloca [2 x i16]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%10 = load i32, i32* %3
%11 = getelementptr inbounds [2 x i16], [2 x i16]* %5, i64 0, i64 0
%12 = bitcast i16* %11 to i32*
store i32 %10, i32* %12
%13 = load i32, i32* %4
%14 = getelementptr inbounds [2 x i16], [2 x i16]* %6, i64 0, i64 0
%15 = bitcast i16* %14 to i32*
store i32 %13, i32* %15
%16 = getelementptr inbounds [2 x i16], [2 x i16]* %5, i64 0, i64 0
%17 = load i16, i16* %16
%18 = sext i16 %17 to i32
%19 = getelementptr inbounds [2 x i16], [2 x i16]* %6, i64 0, i64 0
%20 = load i16, i16* %19
%21 = sext i16 %20 to i32
%22 = icmp eq i32 %18, %21
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 1, i32 0
store i32 %24, i32* %7
%25 = getelementptr inbounds [2 x i16], [2 x i16]* %5, i64 0, i64 1
%26 = load i16, i16* %25
%27 = sext i16 %26 to i32
%28 = getelementptr inbounds [2 x i16], [2 x i16]* %6, i64 0, i64 1
%29 = load i16, i16* %28
%30 = sext i16 %29 to i32
%31 = icmp eq i32 %27, %30
%32 = zext i1 %31 to i64
%33 = select i1 %31, i32 1, i32 0
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = shl i32 %34, 1
%36 = load i32, i32* %7
%37 = or i32 %35, %36
store i32 %37, i32* %9
%38 = load i32, i32* %9
ret i32 %38
}

LLVM IR (-O2):
define i32 @_cmpeq2(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = and i32 %3, 65535
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = icmp ult i32 %3, 65536
%8 = select i1 %7, i32 2, i32 0
%9 = or i32 %8, %6
ret i32 %9
}
__attribute__((always_)) unsigned short inw(unsigned short port) {
  unsigned short _v;
  asm volatile("in"
               "w"
               " %"
               "w"
               "1,%"
               ""
               "0"
               : "=a"(_v)
               : "Nd"(port));
  return _v;
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
mov    %edi,%edx
in     (%dx),%ax
ret

LLVM IR (-O0):
define zeroext i16 @inw(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i16 asm sideeffect "inw ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @inw(i16 zeroext %0) {
%2 = tail call i16 asm sideeffect "inw ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, size_t);
char *strncpy(char *, char const *, size_t);
char *ya_strcpy(char *dest, const char *src, size_t n) {
  assert(dest && src);
  memset(dest, 0, n);
  return strncpy(dest, src, n - 1);
}


x86 assembly (clang, -O0):
<ya_strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x19(%rbp)
je     115f <ya_strcpy+0x2f>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ya_strcpy>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
mov    %r15,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <memset@plt>
add    $0xffffffffffffffff,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
define i8* @ya_strcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br label %12
12: ; preds = %9, %3
%13 = phi i1 [ false, %3 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i8*, i8** %4
%17 = load i64, i64* %6
%18 = call i32 @memset(i8* %16, i32 0, i64 %17)
%19 = load i8*, i8** %4
%20 = load i8*, i8** %5
%21 = load i64, i64* %6
%22 = sub i64 %21, 1
%23 = call i8* @strncpy(i8* %19, i8* %20, i64 %22)
ret i8* %23
}

LLVM IR (-O2):
define i8* @ya_strcpy(i8* returned %0, i8* %1, i64 %2) {
%4 = icmp ne i8* %0, null
%5 = icmp ne i8* %1, null
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @memset(i8* %0, i32 0, i64 %2)
%10 = add i64 %2, -1
%11 = tail call i8* @strncpy(i8* dereferenceable(1) %0, i8* %1, i64 %10)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_chars(const char *str) {
  while (*(str++))
    printf("%c", *(str - 1));
  printf("\n");
}


x86 assembly (clang, -O0):
<print_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     114f <print_chars+0x3f>
mov    -0x8(%rbp),%rax
movsbl -0x1(%rax),%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    111c <print_chars+0xc>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_chars>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <print_chars+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <print_chars+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @print_chars(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ strlen(char *);
char *sayHi(char *s) {
  char *hi = (char *)malloc(strlen(s) + 5);
  sprintf(hi, "Hi, %s.", s);
  return hi;
}


x86 assembly (clang, -O0):
<sayHi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
add    $0x5,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe9c(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sayHi>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x5(%rax),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xeb1(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Hi, %s.\00"
define i8* @sayHi(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 5
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [8 x i8] c"Hi, %s.\00"
define i8* @sayHi(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 5
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_subsurface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_get_version(struct wl_proxy *);
uint32_t wl_subsurface_get_version(struct wl_subsurface *wl_subsurface) {
  return wl_proxy_get_version((struct wl_proxy *)wl_subsurface);
}


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

x86 assembly (clang, -O2):
<wl_subsurface_get_version>:
jmp    1030 <wl_proxy_get_version@plt>

LLVM IR (-O0):
%struct.wl_subsurface = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_subsurface_get_version(%struct.wl_subsurface* %0) {
%2 = alloca %struct.wl_subsurface*
store %struct.wl_subsurface* %0, %struct.wl_subsurface** %2
%3 = load %struct.wl_subsurface*, %struct.wl_subsurface** %2
%4 = bitcast %struct.wl_subsurface* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_get_version(%struct.wl_proxy* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.wl_subsurface = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_subsurface_get_version(%struct.wl_subsurface* %0) {
%2 = bitcast %struct.wl_subsurface* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_get_version(%struct.wl_proxy* %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ value;
typedef union sigval {
  int dummy;
} sigval;
typedef int /*<<< orphan*/ thread;
typedef union sigval pthread_t;

/* Variables and functions */
int /*<<< orphan*/ SIGKILL;
int /*<<< orphan*/ memset(union sigval *, int /*<<< orphan*/, int);
int pthread_sigqueue(union sigval, int /*<<< orphan*/, union sigval);
int main(void) {
  pthread_t thread;
  union sigval value;
  (void)memset(&thread, 0, sizeof(thread));
  (void)memset(&value, 0, sizeof(value));
  return pthread_sigqueue(thread, SIGKILL, value);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%edx
call   1040 <pthread_sigqueue@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    0x8(%rsp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%edx
call   1040 <pthread_sigqueue@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%union.sigval = type { i32 }
@SIGKILL = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.sigval
%3 = alloca %union.sigval
store i32 0, i32* %1
%4 = call i32 @memset(%union.sigval* %2, i32 0, i32 4)
%5 = call i32 @memset(%union.sigval* %3, i32 0, i32 4)
%6 = load i32, i32* @SIGKILL
%7 = getelementptr inbounds %union.sigval, %union.sigval* %2, i32 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %union.sigval, %union.sigval* %3, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @pthread_sigqueue(i32 %8, i32 %6, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%union.sigval = type { i32 }
@SIGKILL = global i32 0
define i32 @main() {
%1 = alloca %union.sigval
%2 = alloca %union.sigval
%3 = bitcast %union.sigval* %1 to i8*
%4 = bitcast %union.sigval* %2 to i8*
%5 = call i32 @memset(%union.sigval* %1, i32 0, i32 4)
%6 = call i32 @memset(%union.sigval* %2, i32 0, i32 4)
%7 = load i32, i32* @SIGKILL
%8 = getelementptr inbounds %union.sigval, %union.sigval* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = getelementptr inbounds %union.sigval, %union.sigval* %2, i64 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @pthread_sigqueue(i32 %9, i32 %7, i32 %11)
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error(char *s) { fprintf(stderr, "sld: error: %s\n", s); }


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"sld: error: %s\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"sld: error: %s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int ssl3_handshake_mac(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *,
                       int /*<<< orphan*/, unsigned char *);
int ssl3_cert_verify_mac(SSL *s, int md_nid, unsigned char *p) {
  return (ssl3_handshake_mac(s, md_nid, NULL, 0, p));
}


x86 assembly (clang, -O0):
<ssl3_cert_verify_mac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%r8
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <ssl3_handshake_mac@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl3_cert_verify_mac>:
mov    %rdx,%r8
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <ssl3_handshake_mac@plt>

LLVM IR (-O0):
define i32 @ssl3_cert_verify_mac(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @ssl3_handshake_mac(i32* %7, i32 %8, i32* null, i32 0, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @ssl3_cert_verify_mac(i32* %0, i32 %1, i8* %2) {
%4 = tail call i32 @ssl3_handshake_mac(i32* %0, i32 %1, i32* null, i32 0, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dec_only(unsigned char);
int /*<<< orphan*/ write_only(unsigned char);
void dec_write(unsigned char what) {
  dec_only(what);
  write_only(what);
}


x86 assembly (clang, -O0):
<dec_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <dec_only@plt>
movzbl -0x1(%rbp),%edi
call   1040 <write_only@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec_write>:
push   %rbx
mov    %edi,%ebx
call   1030 <dec_only@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <write_only@plt>

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

LLVM IR (-O2):
define void @dec_write(i8 zeroext %0) {
%2 = tail call i32 @dec_only(i8 zeroext %0)
%3 = tail call i32 @write_only(i8 zeroext %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(void const *, int, int, int /*<<< orphan*/ *);
int inflate_raw_file_callback(const void *pBuf, int len, void *pUser) {
  if (fwrite(pBuf, 1, len, (FILE *)pUser) == len) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<inflate_raw_file_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
cmp    -0x14(%rbp),%eax
jne    114d <inflate_raw_file_callback+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1154 <inflate_raw_file_callback+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inflate_raw_file_callback>:
push   %rbx
mov    %rdx,%rcx
mov    %esi,%ebx
mov    $0x1,%esi
mov    %ebx,%edx
call   1030 <fwrite@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @inflate_raw_file_callback(i8* nocapture %0, i32 %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = tail call i32 @fwrite(i8* %0, i32 1, i32 %1, i32* %4)
%6 = icmp eq i32 %5, %1
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int simdl_create(void **gen, const char *seed) {
  printf("In simdl_create, seed=\"%s\"\n", NULL == seed ? "NULL" : seed);
  return 0;
}


x86 assembly (clang, -O0):
<simdl_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    113c <simdl_create+0x2c>
lea    0xee9(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1144 <simdl_create+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simdl_create>:
push   %rax
test   %rsi,%rsi
lea    0xf01(%rip),%rax
cmove  %rax,%rsi
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"In simdl_create, seed=\22%s\22\0A\00"
@.str.1 = [5 x i8] c"NULL\00"
define i32 @simdl_create(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp eq i8* null, %5
br i1 %6, label %7, label %8
7: ; preds = %2
br label %10
8: ; preds = %2
%9 = load i8*, i8** %4
br label %10
10: ; preds = %8, %7
%11 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %7 ], [ %9, %8 ]
%12 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"In simdl_create, seed=\22%s\22\0A\00"
@.str.1 = [5 x i8] c"NULL\00"
define i32 @simdl_create(i8** nocapture readnone %0, i8* %1) {
%3 = icmp eq i8* %1, null
%4 = select i1 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
long get_num(char const **);
int /*<<< orphan*/ skip_space(char const **);
long get_mul(const char **s) {
  long v;
  v = get_num(s);
  while ((**s) == '*') {
    (*s)++;
    skip_space(s);
    v *= get_num(s);
  }
  return v;
}


x86 assembly (clang, -O0):
<get_mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_num@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
jne    117a <get_mul+0x5a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
call   1040 <skip_space@plt>
mov    -0x8(%rbp),%rdi
call   1030 <get_num@plt>
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1139 <get_mul+0x19>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mul>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <get_num@plt>
mov    %rax,%rbx
nop
mov    (%r14),%rax
cmpb   $0x2a,(%rax)
jne    1155 <get_mul+0x35>
add    $0x1,%rax
mov    %rax,(%r14)
mov    %r14,%rdi
call   1040 <skip_space@plt>
mov    %r14,%rdi
call   1030 <get_num@plt>
imul   %rax,%rbx
jmp    1130 <get_mul+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @get_mul(i8** %0) {
%2 = alloca i8**
%3 = alloca i64
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = call i64 @get_num(i8** %4)
store i64 %5, i64* %3
br label %6
6: ; preds = %12, %1
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 42
br i1 %11, label %12, label %22
12: ; preds = %6
%13 = load i8**, i8*** %2
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %13
%16 = load i8**, i8*** %2
%17 = call i32 @skip_space(i8** %16)
%18 = load i8**, i8*** %2
%19 = call i64 @get_num(i8** %18)
%20 = load i64, i64* %3
%21 = mul nsw i64 %20, %19
store i64 %21, i64* %3
br label %6
22: ; preds = %6
%23 = load i64, i64* %3
ret i64 %23
}

LLVM IR (-O2):
define i64 @get_mul(i8** %0) {
%2 = tail call i64 @get_num(i8** %0)
%3 = load i8*, i8** %0
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 42
br i1 %5, label %6, label %16
6: ; preds = %1, %6
%7 = phi i8* [ %13, %6 ], [ %3, %1 ]
%8 = phi i64 [ %12, %6 ], [ %2, %1 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %9, i8** %0
%10 = tail call i32 @skip_space(i8** %0)
%11 = tail call i64 @get_num(i8** %0)
%12 = mul nsw i64 %11, %8
%13 = load i8*, i8** %0
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 42
br i1 %15, label %6, label %16
16: ; preds = %6, %1
%17 = phi i64 [ %2, %1 ], [ %12, %6 ]
ret i64 %17
}
double azNtoS(double azFromNorth) {
  double azFromSouth;
  azFromSouth = azFromNorth + 180.0;
  if (azFromSouth > 360.0)
    azFromSouth -= 360.0;
  return azFromSouth;
}


x86 assembly (clang, -O0):
<azNtoS>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1148 <azNtoS+0x48>
movsd  -0x10(%rbp),%xmm0
movsd  0xec1(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<azNtoS>:
addsd  0xef8(%rip),%xmm0
movsd  0xef8(%rip),%xmm2
addsd  %xmm0,%xmm2
movsd  0xef4(%rip),%xmm1
cmpltsd %xmm0,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @azNtoS(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fadd double %4, 1.800000e+02
store double %5, double* %3
%6 = load double, double* %3
%7 = fcmp ogt double %6, 3.600000e+02
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load double, double* %3
%10 = fsub double %9, 3.600000e+02
store double %10, double* %3
br label %11
11: ; preds = %8, %1
%12 = load double, double* %3
ret double %12
}

LLVM IR (-O2):
define double @azNtoS(double %0) {
%2 = fadd double %0, 1.800000e+02
%3 = fcmp ogt double %2, 3.600000e+02
%4 = fadd double %2, -3.600000e+02
%5 = select i1 %3, double %4, double %2
ret double %5
}
int test_imm_74uint8_reg(unsigned char val) {
  return ((val) & (0x74 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_74uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x74,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_74uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 116
%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_74uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 116
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}