xunge/DecIR huggingface dataset:
adrreg0reg1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((p0[10000000]) <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrreg0reg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movswl 0x1312d00(%rax),%eax
movswl -0x8(%rbp),%ecx
cmp    %ecx,%eax
jg     1142 <adrreg0reg1+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1149 <adrreg0reg1+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0reg1>:
movswl 0x1312d00(%r8),%ecx
01
movswl %si,%edx
xor    %eax,%eax
cmp    %ecx,%edx
setge  %al
ret

LLVM IR (-O0):
define i32 @adrreg0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = getelementptr inbounds i16, i16* %16, i64 10000000
%18 = load i16, i16* %17
%19 = sext i16 %18 to i32
%20 = load i16, i16* %9
%21 = sext i16 %20 to i32
%22 = icmp sle i32 %19, %21
br i1 %22, label %23, label %24
23: ; preds = %6
store i32 1, i32* %7
br label %25
24: ; preds = %6
store i32 0, i32* %7
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @adrreg0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = getelementptr inbounds i16, i16* %4, i64 10000000
%8 = load i16, i16* %7
%9 = sext i16 %8 to i32
%10 = shl i32 %1, 16
%11 = ashr exact i32 %10, 16
%12 = icmp sge i32 %11, %9
%13 = zext i1 %12 to i32
ret i32 %13
}
void test_isdigit_macro(void) {
  int i, j;
  for (i = -127; i < 256;)
    j = i, printf("%s: %d -> %d\n", __FUNCTION__, j, isdigit(i++) ? 1 : 0);
}


x86 assembly (clang, -O0):
<test_isdigit_macro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffff81,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1184 <test_isdigit_macro+0x64>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
call   1030 <isdigit@plt>
mov    -0xc(%rbp),%edx
mov    %eax,%esi
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x0,%esi
cmovne %eax,%ecx
lea    0xe8f(%rip),%rdi
lea    0xe96(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    112f <test_isdigit_macro+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isdigit_macro>:
push   %r15
push   %r14
push   %rbx
mov    $0xffffff51,%ebx
lea    0xedf(%rip),%r14
lea    0xee6(%rip),%r15
nopl   0x0(%rax,%rax,1)
lea    0x30(%rbx),%edx
xor    %ecx,%ecx
cmp    $0xa,%ebx
setb   %cl
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0xd0,%ebx
jne    1130 <test_isdigit_macro+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_isdigit_macro = [19 x i8] c"test_isdigit_macro\00"
define void @test_isdigit_macro() {
%1 = alloca i32
%2 = alloca i32
store i32 -127, i32* %1
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 256
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
%11 = call i32 @isdigit(i32 %9)
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.test_isdigit_macro, i64 0, i64 0), i32 %8, i32 %14)
br label %3
16: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_isdigit_macro = [19 x i8] c"test_isdigit_macro\00"
define void @test_isdigit_macro() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ -127, %0 ], [ %3, %1 ]
%3 = add nsw i32 %2, 1
%4 = add nsw i32 %2, -48
%5 = icmp ult i32 %4, 10
%6 = zext i1 %5 to i32
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.test_isdigit_macro, i64 0, i64 0), i32 %2, i32 %6)
%8 = icmp eq i32 %3, 256
br i1 %8, label %9, label %1
9: ; preds = %1
ret void
}
/* Variables and functions */
void *__coverity_alloc__(int);
int /*<<< orphan*/ __coverity_mark_as_afm_allocated__(void *, char *);
void *H5Gopen(void *loc_id, const char *name, void *gapl_id) {
  void *id = __coverity_alloc__(10);
  __coverity_mark_as_afm_allocated__(id, "H5Gclose");
  return id;
}


x86 assembly (clang, -O0):
<H5Gopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xa,%edi
call   1040 <__coverity_alloc__@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xeb3(%rip),%rsi
call   1030 <__coverity_mark_as_afm_allocated__@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<H5Gopen>:
push   %rbx
mov    $0xa,%edi
call   1040 <__coverity_alloc__@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
call   1030 <__coverity_mark_as_afm_allocated__@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"H5Gclose\00"
define i8* @H5Gopen(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = call i8* @__coverity_alloc__(i32 10)
store i8* %8, i8** %7
%9 = load i8*, i8** %7
%10 = call i32 @__coverity_mark_as_afm_allocated__(i8* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %7
ret i8* %11
}

LLVM IR (-O2):
@.str = [9 x i8] c"H5Gclose\00"
define i8* @H5Gopen(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i8* @__coverity_alloc__(i32 10)
%5 = tail call i32 @__coverity_mark_as_afm_allocated__(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ preempt_disable();
void __rcu_read_lock(void) { preempt_disable(); }


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

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

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

LLVM IR (-O2):
define void @__rcu_read_lock() {
%1 = tail call i32 (...) @preempt_disable()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int pthread_cond_broadcast(int /*<<< orphan*/ *);
int pthread_cond_signal(int /*<<< orphan*/ *);
int evthread_posix_cond_signal(void *_cond, int broadcast) {
  pthread_cond_t *cond = _cond;
  int r;
  if (broadcast)
    r = pthread_cond_broadcast(cond);
  else
    r = pthread_cond_signal(cond);
  return r ? -1 : 0;
}


x86 assembly (clang, -O0):
<evthread_posix_cond_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1152 <evthread_posix_cond_signal+0x32>
mov    -0x18(%rbp),%rdi
call   1030 <pthread_cond_broadcast@plt>
mov    %eax,-0x1c(%rbp)
jmp    115e <evthread_posix_cond_signal+0x3e>
mov    -0x18(%rbp),%rdi
call   1040 <pthread_cond_signal@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evthread_posix_cond_signal>:
push   %rax
test   %esi,%esi
je     112c <evthread_posix_cond_signal+0xc>
call   1030 <pthread_cond_broadcast@plt>
jmp    1131 <evthread_posix_cond_signal+0x11>
call   1040 <pthread_cond_signal@plt>
neg    %eax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @evthread_posix_cond_signal(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32*, i32** %5
%13 = call i32 @pthread_cond_broadcast(i32* %12)
store i32 %13, i32* %6
br label %17
14: ; preds = %2
%15 = load i32*, i32** %5
%16 = call i32 @pthread_cond_signal(i32* %15)
store i32 %16, i32* %6
br label %17
17: ; preds = %14, %11
%18 = load i32, i32* %6
%19 = icmp ne i32 %18, 0
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 -1, i32 0
ret i32 %21
}

LLVM IR (-O2):
define i32 @evthread_posix_cond_signal(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @pthread_cond_broadcast(i32* %3)
br label %9
7: ; preds = %2
%8 = tail call i32 @pthread_cond_signal(i32* %3)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
%11 = icmp ne i32 %10, 0
%12 = sext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ c_wait_running_job_send();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
char *get_output_file(int *);
int /*<<< orphan*/ stderr;
int tail_file(char *, int);
int c_tail() {
  char *str;
  int pid;
  str = get_output_file(&pid);
  if (str == 0) {
    fprintf(stderr, "The output is not stored. Cannot tail.\n");
    exit(-1);
  }
  c_wait_running_job_send();
  return tail_file(str, 10);
}


x86 assembly (clang, -O0):
<c_tail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xc(%rbp),%rdi
call   1060 <get_output_file@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    118f <c_tail+0x3f>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
lea    0xe80(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    $0x0,%al
call   1040 <c_wait_running_job_send@plt>
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <tail_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_tail>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdi
call   1060 <get_output_file@plt>
test   %rax,%rax
je     1181 <c_tail+0x31>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <c_wait_running_job_send@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <tail_file@plt>
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
lea    0xe6f(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"The output is not stored. Cannot tail.\0A\00"
define i32 @c_tail() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i8* @get_output_file(i32* %2)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 -1)
unreachable
10: ; preds = %0
%11 = call i32 (...) @c_wait_running_job_send()
%12 = load i8*, i8** %1
%13 = call i32 @tail_file(i8* %12, i32 10)
ret i32 %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"The output is not stored. Cannot tail.\0A\00"
define i32 @c_tail() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i8* @get_output_file(i32* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 -1)
unreachable
9: ; preds = %0
%10 = call i32 (...) @c_wait_running_job_send()
%11 = call i32 @tail_file(i8* %3, i32 10)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int /*<<< orphan*/, int /*<<< orphan*/);
void C67_LDB_SP_A0(int r) { C67_asm("LDB.D *+SP[A0]", r, 0, 0); }


x86 assembly (clang, -O0):
<C67_LDB_SP_A0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_LDB_SP_A0>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"LDB.D *+SP[A0]\00"
define void @C67_LDB_SP_A0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @C67_asm(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"LDB.D *+SP[A0]\00"
define void @C67_LDB_SP_A0(i32 %0) {
%2 = tail call i32 @C67_asm(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0, i32 0, i32 0)
ret void
}
double dphicaley(const double x) {
  return 2 * (x - 1) * (x - 1) * (x - 1) * (x + 1) / (x * x * x);
}


x86 assembly (clang, -O0):
<dphicaley>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xeea(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xecd(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xeb8(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea8(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dphicaley>:
movsd  0xef8(%rip),%xmm2
addsd  %xmm0,%xmm2
movapd %xmm2,%xmm3
addsd  %xmm2,%xmm3
movsd  0xeec(%rip),%xmm1
addsd  %xmm0,%xmm1
unpcklpd %xmm0,%xmm2
unpcklpd %xmm0,%xmm3
mulpd  %xmm2,%xmm3
mulpd  %xmm2,%xmm3
mulsd  %xmm3,%xmm1
unpckhpd %xmm3,%xmm3
divsd  %xmm3,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dphicaley(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 1.000000e+00
%5 = fmul double 2.000000e+00, %4
%6 = load double, double* %2
%7 = fsub double %6, 1.000000e+00
%8 = fmul double %5, %7
%9 = load double, double* %2
%10 = fsub double %9, 1.000000e+00
%11 = fmul double %8, %10
%12 = load double, double* %2
%13 = fadd double %12, 1.000000e+00
%14 = fmul double %11, %13
%15 = load double, double* %2
%16 = load double, double* %2
%17 = fmul double %15, %16
%18 = load double, double* %2
%19 = fmul double %17, %18
%20 = fdiv double %14, %19
ret double %20
}

LLVM IR (-O2):
define double @dphicaley(double %0) {
%2 = fadd double %0, -1.000000e+00
%3 = fmul double %2, 2.000000e+00
%4 = fadd double %0, 1.000000e+00
%5 = insertelement <2 x double> poison, double %0, i64 1
%6 = insertelement <2 x double> %5, double %2, i64 0
%7 = insertelement <2 x double> %5, double %3, i64 0
%8 = fmul <2 x double> %6, %7
%9 = fmul <2 x double> %8, %6
%10 = extractelement <2 x double> %9, i64 0
%11 = fmul double %4, %10
%12 = extractelement <2 x double> %9, i64 1
%13 = fdiv double %11, %12
ret double %13
}
int videoinput_get_time_per_field(int norm) {
  if (norm == 0 || norm == 6 || norm == 4 || norm == 7) {
    return 16683;
  } else {
    return 20000;
  }
}


x86 assembly (clang, -O0):
<videoinput_get_time_per_field>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <videoinput_get_time_per_field+0x2f>
cmpl   $0x6,-0x8(%rbp)
je     112f <videoinput_get_time_per_field+0x2f>
cmpl   $0x4,-0x8(%rbp)
je     112f <videoinput_get_time_per_field+0x2f>
cmpl   $0x7,-0x8(%rbp)
jne    113b <videoinput_get_time_per_field+0x3b>
movl   $0x412b,-0x4(%rbp)
jmp    1142 <videoinput_get_time_per_field+0x42>
movl   $0x4e20,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@switch.table.videoinput_get_time_per_field = [8 x i32] [i32 16683, i32 20000, i32 20000, i32 20000, i32 16683, i32 20000, i32 16683, i32 16683]
define i32 @videoinput_get_time_per_field(i32 %0) {
%2 = icmp ult i32 %0, 8
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.videoinput_get_time_per_field, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 20000, %1 ]
ret i32 %8
}
int title_to_number(const char *s) {
  int i;
  int sum = 0;
  for (i = 0; *s != 0; ++s)
    sum = (sum * 26) + (*s - 'A' + 1);
  return sum;
}


x86 assembly (clang, -O0):
<title_to_number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <title_to_number+0x4d>
imul   $0x1a,-0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x41,%ecx
add    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1116 <title_to_number+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<title_to_number>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <title_to_number+0x2d>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %eax,%edx
lea    (%rcx,%rdx,1),%eax
add    $0xffffffc0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <title_to_number+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @title_to_number(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul nsw i32 %6, 26
%10 = add i32 %9, -64
%11 = add i32 %10, %8
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %16
}
int mode_set(int x, int try) { return ((x & try) == try); }


x86 assembly (clang, -O0):
<mode_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mode_set>:
not    %edi
xor    %eax,%eax
test   %edi,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @mode_set(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 = and i32 %5, %6
%8 = load i32, i32* %4
%9 = icmp eq i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mode_set(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp eq i32 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void LCDRasterACBiasIntCountSet(uint32_t ui32Base, uint8_t ui8Count) {
  uint32_t ui32Val;
  ;
  ;
  ui32Val = (*((volatile unsigned long *)(ui32Base + 0x00000034)));
  ui32Val &= ~0x000F0000;
  ui32Val |= ((ui8Count << 16) & 0x000F0000);
  (*((volatile unsigned long *)(ui32Base + 0x00000034))) = ui32Val;
}


x86 assembly (clang, -O0):
<LCDRasterACBiasIntCountSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x34,%eax
cltq
mov    (%rax),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xfff0ffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x10,%eax
and    $0xf0000,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x4(%rbp),%eax
add    $0x34,%eax
cltq
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDRasterACBiasIntCountSet>:
movslq %edi,%rax
mov    0x34(%rax),%rcx
and    $0xfff0ffff,%ecx
and    $0xf,%esi
shl    $0x10,%esi
or     %ecx,%esi
movslq %esi,%rcx
mov    %rcx,0x34(%rax)
ret

LLVM IR (-O0):
define void @LCDRasterACBiasIntCountSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 52
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = trunc i64 %10 to i32
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = and i32 %12, -983041
store i32 %13, i32* %5
%14 = load i32, i32* %4
%15 = shl i32 %14, 16
%16 = and i32 %15, 983040
%17 = load i32, i32* %5
%18 = or i32 %17, %16
store i32 %18, i32* %5
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 52
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i64*
store volatile i64 %20, i64* %24
ret void
}

LLVM IR (-O2):
define void @LCDRasterACBiasIntCountSet(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 52
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = and i32 %7, -983041
%9 = shl i32 %1, 16
%10 = and i32 %9, 983040
%11 = or i32 %8, %10
%12 = sext i32 %11 to i64
store volatile i64 %12, i64* %5
ret void
}
void dl_G_SETKEYR() {}


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

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

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

LLVM IR (-O2):
define void @dl_G_SETKEYR() {
ret void
}
void yy_1_ValueSqStar(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_ValueSqStar(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int u_int;

/* Variables and functions */
unsigned int hash_pointer(void *key) { return ((u_int)key) >> 2; }


x86 assembly (clang, -O0):
<hash_pointer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_pointer>:
mov    %rdi,%rax
sar    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @hash_pointer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = ashr i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @hash_pointer(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = ashr i32 %3, 2
ret i32 %4
}
void gtk_target_list_ref() {}


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

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

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

LLVM IR (-O2):
define void @gtk_target_list_ref() {
ret void
}
int test_imm_BCint8_reg(signed char val) {
  return ((val) & (-0xBC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_BCint8_reg>:
test   $0xffffff44,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BCint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -188
%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_BCint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -188
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello world\n");
  printf("hello world\n");
  printf("hello world\a");
  printf("hello world\t\v");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef3(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
@.str.1 = [13 x i8] c"hello world\07\00"
@.str.2 = [14 x i8] c"hello world\09\0B\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"hello world\07\00"
@.str.2 = [14 x i8] c"hello world\09\0B\00"
@str.3 = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.3, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;
typedef int __u32;
typedef int /*<<< orphan*/ __u16;

/* Variables and functions */
void gtx_out16(volatile __u8 *mmioaddr, __u32 reg, __u16 value) {
  *((volatile __u16 *)(mmioaddr + reg)) = value;
}


x86 assembly (clang, -O0):
<gtx_out16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtx_out16>:
movslq %esi,%rax
mov    %edx,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @gtx_out16(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
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
store volatile i32 %7, i32* %11
ret void
}

LLVM IR (-O2):
define void @gtx_out16(i32* %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
store volatile i32 %2, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xc7() {
  Assert_real((ispunct(199) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              1000, ("ispunct should be 0 for 0xc7"));
}


x86 assembly (clang, -O0):
<t_ispunct_0xc7>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc7,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3e8,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0xc7>:
push   %rax
mov    $0xc7,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3e8,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xc7\00"
define void @t_ispunct_0xc7() {
%1 = call i64 @ispunct(i32 199)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1000, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xc7\00"
define void @t_ispunct_0xc7() {
%1 = tail call i64 @ispunct(i32 199)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1000, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int cmpint(void *ap, void *bp) { return ((int)(ap)) - ((int)(bp)); }


x86 assembly (clang, -O0):
<cmpint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpint>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @cmpint(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 = ptrtoint i8* %5 to i32
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i32
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @cmpint(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ rst(int);
void op0xDF(void) { rst(0x18); }


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

x86 assembly (clang, -O2):
<op0xDF>:
mov    $0x18,%edi
jmp    1030 <rst@plt>

LLVM IR (-O0):
define void @op0xDF() {
%1 = call i32 @rst(i32 24)
ret void
}

LLVM IR (-O2):
define void @op0xDF() {
%1 = tail call i32 @rst(i32 24)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_short_wait_until(short *ivar, int cmp, short cmp_value) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_short_wait_until>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmem_short_wait_until>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_short_wait_until(i16* %0, i32 %1, i16 signext %2) {
%4 = alloca i16*
%5 = alloca i32
%6 = alloca i16
store i16* %0, i16** %4
store i32 %1, i32* %5
store i16 %2, i16* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_short_wait_until(i16* nocapture readnone %0, i32 %1, i16 signext %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
void main(int argc, char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @main(i32 %0, i8** nocapture %1) {
ret void
}
int memory_read_access() { return 600; }


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

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

LLVM IR (-O0):
define i32 @memory_read_access() {
ret i32 600
}

LLVM IR (-O2):
define i32 @memory_read_access() {
ret i32 600
}
/* Variables and functions */
int /*<<< orphan*/ InitVTFTStack();
int /*<<< orphan*/ ProcessVTFTStack();
void main() {
  InitVTFTStack();
  while (1) {
    ProcessVTFTStack();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <InitVTFTStack@plt>
mov    $0x0,%al
call   1040 <ProcessVTFTStack@plt>
jmp    112b <main+0xb>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <InitVTFTStack@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <ProcessVTFTStack@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @InitVTFTStack()
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @ProcessVTFTStack()
br label %2
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @InitVTFTStack()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @ProcessVTFTStack()
br label %2
}
/* Variables and functions */
char *utilStrLTrimChar(char *, char *);
char *utilStrRTrimChar(char *, char *);
char *utilStrTrimChar(char *sStr, char *sTrimChars) {
  char *sPtr;
  if (sStr == (0) || sTrimChars == (0))
    return (0);
  sPtr = utilStrLTrimChar(sStr, sTrimChars);
  sPtr = utilStrRTrimChar(sPtr, sTrimChars);
  return sPtr;
}


x86 assembly (clang, -O0):
<utilStrTrimChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <utilStrTrimChar+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1153 <utilStrTrimChar+0x33>
movq   $0x0,-0x8(%rbp)
jmp    117d <utilStrTrimChar+0x5d>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <utilStrLTrimChar@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <utilStrRTrimChar@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utilStrTrimChar>:
push   %rbx
test   %rdi,%rdi
je     1142 <utilStrTrimChar+0x22>
mov    %rsi,%rbx
test   %rsi,%rsi
je     1142 <utilStrTrimChar+0x22>
mov    %rbx,%rsi
call   1030 <utilStrLTrimChar@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <utilStrRTrimChar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @utilStrTrimChar(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i8* @utilStrLTrimChar(i8* %0, i8* %1)
%8 = tail call i8* @utilStrRTrimChar(i8* %7, i8* %1)
br label %9
9: ; preds = %2, %6
%10 = phi i8* [ %8, %6 ], [ null, %2 ]
ret i8* %10
}
/* Variables and functions */
int b();
int a(void) { return b() - 1; }


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <b@plt>
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
push   %rax
xor    %eax,%eax
call   1030 <b@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @a() {
%1 = call i32 (...) @b()
%2 = sub nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @a() {
%1 = tail call i32 (...) @b()
%2 = add nsw i32 %1, -1
ret i32 %2
}
/* Variables and functions */
char *cJSON_Version();
int /*<<< orphan*/ create_objects();
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  printf("Version: %s\n", cJSON_Version());
  create_objects();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <cJSON_Version@plt>
mov    %rax,%rsi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <create_objects@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <cJSON_Version@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <create_objects@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Version: %s\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i8* (...) @cJSON_Version()
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 (...) @create_objects()
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Version: %s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @cJSON_Version()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 (...) @create_objects()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pr_crit(char *, char const *);
void mark_hardware_unsupported(const char *msg) {
  pr_crit("Warning: %s - this hardware has not undergone testing by Red Hat "
          "and might not be certified. Please consult "
          "https://hardware.redhat.com for certified hardware.\n",
          msg);
}


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

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

LLVM IR (-O0):
@.str = [161 x i8] c"Warning: %s - this hardware has not undergone testing by Red Hat and might not be certified. Please consult https://hardware.redhat.com for certified hardware.\0A\00"
define void @mark_hardware_unsupported(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @pr_crit(i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [161 x i8] c"Warning: %s - this hardware has not undergone testing by Red Hat and might not be certified. Please consult https://hardware.redhat.com for certified hardware.\0A\00"
define void @mark_hardware_unsupported(i8* %0) {
%2 = tail call i32 @pr_crit(i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int sweep_set_dobldobl_start(int n, double *c) {
  int fail, ptos[2];
  ptos[0] = 1;
  ptos[1] = 0;
  fail = _ada_use_c2phc(618, ptos, &n, c);
  return fail;
}


x86 assembly (clang, -O0):
<sweep_set_dobldobl_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
lea    -0x1c(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x26a,%edi
lea    -0x4(%rbp),%rdx
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sweep_set_dobldobl_start>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %edi,0xc(%rsp)
movq   $0x1,0x10(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    $0x26a,%edi
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @sweep_set_dobldobl_start(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca [2 x i32]
store i32 %0, i32* %3
store double* %1, double** %4
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 1, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 0, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%10 = load double*, double** %4
%11 = call i32 @_ada_use_c2phc(i32 618, i32* %9, i32* %3, double* %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @sweep_set_dobldobl_start(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca [2 x i32]
store i32 %0, i32* %3
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 1, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 0, i32* %7
%8 = call i32 @_ada_use_c2phc(i32 618, i32* %6, i32* %3, double* %1)
ret i32 %8
}
unsigned long edf_buffersize(void) { return (512); }


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

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

LLVM IR (-O0):
define i64 @edf_buffersize() {
ret i64 512
}

LLVM IR (-O2):
define i64 @edf_buffersize() {
ret i64 512
}
int print_binlog_format_description_event(
    struct format_description_event *fmt_des_ev) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.format_description_event = type opaque
define i32 @print_binlog_format_description_event(%struct.format_description_event* %0) {
%2 = alloca %struct.format_description_event*
store %struct.format_description_event* %0, %struct.format_description_event** %2
ret i32 0
}

LLVM IR (-O2):
%struct.format_description_event = type opaque
define i32 @print_binlog_format_description_event(%struct.format_description_event* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mpq_t;

/* Variables and functions */
int /*<<< orphan*/ mpq_denref(int /*<<< orphan*/);
int /*<<< orphan*/ mpq_numref(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_addmul_ui(int /*<<< orphan*/, int /*<<< orphan*/,
                                 unsigned long);
extern void mpq_add_ui(mpq_t q, unsigned long u) {
  mpz_addmul_ui(mpq_numref(q), mpq_denref(q), u);
}


x86 assembly (clang, -O0):
<mpq_add_ui>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <mpq_numref@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <mpq_denref@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1030 <mpz_addmul_ui@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpq_add_ui>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1040 <mpq_numref@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1050 <mpq_denref@plt>
mov    %ebx,%edi
mov    %eax,%esi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <mpz_addmul_ui@plt>

LLVM IR (-O0):
define void @mpq_add_ui(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = call i32 @mpq_numref(i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @mpq_denref(i32 %7)
%9 = load i64, i64* %4
%10 = call i32 @mpz_addmul_ui(i32 %6, i32 %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @mpq_add_ui(i32 %0, i64 %1) {
%3 = tail call i32 @mpq_numref(i32 %0)
%4 = tail call i32 @mpq_denref(i32 %0)
%5 = tail call i32 @mpz_addmul_ui(i32 %3, i32 %4, i64 %1)
ret void
}
/* Type definitions */
struct mutex {
  int dummy;
};

/* Variables and functions */
scalar_t__ mutex_trylock(struct mutex *);
int /*<<< orphan*/ mutex_unlock(struct mutex *);
int mutex_is_locked(struct mutex *l) {
  if (mutex_trylock(l)) {
    mutex_unlock(l);
    return 0;
  } else
    return 1;
}


x86 assembly (clang, -O0):
<mutex_is_locked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <mutex_trylock@plt>
cmp    $0x0,%rax
je     1154 <mutex_is_locked+0x34>
mov    -0x10(%rbp),%rdi
call   1030 <mutex_unlock@plt>
movl   $0x0,-0x4(%rbp)
jmp    115b <mutex_is_locked+0x3b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutex_is_locked>:
push   %rbx
mov    %rdi,%rbx
call   1040 <mutex_trylock@plt>
test   %rax,%rax
je     113a <mutex_is_locked+0x1a>
mov    %rbx,%rdi
call   1030 <mutex_unlock@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mutex = type { i32 }
define i32 @mutex_is_locked(%struct.mutex* %0) {
%2 = alloca i32
%3 = alloca %struct.mutex*
store %struct.mutex* %0, %struct.mutex** %3
%4 = load %struct.mutex*, %struct.mutex** %3
%5 = call i64 @mutex_trylock(%struct.mutex* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load %struct.mutex*, %struct.mutex** %3
%9 = call i32 @mutex_unlock(%struct.mutex* %8)
store i32 0, i32* %2
br label %11
10: ; preds = %1
store i32 1, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.mutex = type { i32 }
define i32 @mutex_is_locked(%struct.mutex* %0) {
%2 = tail call i64 @mutex_trylock(%struct.mutex* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @mutex_unlock(%struct.mutex* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
void test(void) {
  char *buffer;
  time_t time;
  buffer = ctime(&time);
}


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

x86 assembly (clang, -O2):
<test>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <ctime@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i8* @ctime(i32* %2)
store i8* %3, i8** %1
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i8* @ctime(i32* %1)
ret void
}