xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strcasestr(char *, int /*<<< orphan*/ *);
scalar_t__ strdupa(char *);
scalar_t__ strndupa(char *, int);
void leakReturnValNotUsed() {
  char *ptr = (char *)strdupa("test");
  strdupa("test");
  char *ptr2 = (char *)strndupa("test", 1);
  strndupa("test", 1);
  strcasestr("test", NULL);
}


x86 assembly (clang, -O0):
<leakReturnValNotUsed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <strdupa@plt>
mov    %rax,-0x8(%rbp)
lea    0xeb1(%rip),%rdi
call   1040 <strdupa@plt>
lea    0xea5(%rip),%rdi
mov    $0x1,%esi
call   1030 <strndupa@plt>
mov    %rax,-0x10(%rbp)
lea    0xe90(%rip),%rdi
mov    $0x1,%esi
call   1030 <strndupa@plt>
lea    0xe7f(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <strcasestr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leakReturnValNotUsed>:
push   %rbx
lea    0xec8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strdupa@plt>
mov    %rbx,%rdi
call   1040 <strdupa@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <strndupa@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <strndupa@plt>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1050 <strcasestr@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
define void @leakReturnValNotUsed() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i64 @strdupa(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = call i64 @strdupa(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = call i64 @strndupa(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %2
%8 = call i64 @strndupa(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
%9 = call i32 @strcasestr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
define void @leakReturnValNotUsed() {
%1 = tail call i64 @strdupa(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 @strdupa(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @strndupa(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = tail call i64 @strndupa(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = tail call i32 @strcasestr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* null)
ret void
}
void ff_hevc_put_hevc_uni_qpel_h16_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_h16_8_sse4() {
ret void
}
/* Variables and functions */
int prj_find_package(char const *);
const char *filterLinks(const char *name) {
  int i = prj_find_package(name);
  if (i >= 0) {
    return NULL;
  } else {
    return name;
  }
}


x86 assembly (clang, -O0):
<filterLinks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <prj_find_package@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     113f <filterLinks+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    1147 <filterLinks+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filterLinks>:
push   %rbx
mov    %rdi,%rbx
call   1030 <prj_find_package@plt>
xor    %ecx,%ecx
test   %eax,%eax
cmovs  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @filterLinks(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @prj_find_package(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i8* null, i8** %2
br label %12
10: ; preds = %1
%11 = load i8*, i8** %3
store i8* %11, i8** %2
br label %12
12: ; preds = %10, %9
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
define i8* @filterLinks(i8* %0) {
%2 = tail call i32 @prj_find_package(i8* %0)
%3 = icmp sgt i32 %2, -1
%4 = select i1 %3, i8* null, i8* %0
ret i8* %4
}
/* Variables and functions */
scalar_t__ get_float(float *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  float a;
  if (get_float(&a)) {
    printf("%g\n", a);
  } else {
    printf("error occured when reading float\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <get_float@plt>
cmp    $0x0,%rax
je     115e <main+0x3e>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeae(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    116c <main+0x4c>
lea    0xe9f(%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    0x4(%rsp),%rdi
call   1050 <get_float@plt>
test   %rax,%rax
je     115a <main+0x2a>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeaf(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1166 <main+0x36>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%g\0A\00"
@.str.1 = [34 x i8] c"error occured when reading float\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i64 @get_float(float* %2)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %7)
br label %11
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %5
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%g\0A\00"
@str = [33 x i8] c"error occured when reading float\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i64 @get_float(float* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %0
%6 = load float, float* %1
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %7)
br label %11
9: ; preds = %0
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %9, %5
ret i32 0
}
void str_ucase(char *str) {
  for (; *str; str++)
    if (*str >= 'a' && *str <= 'z')
      *str = *str - ('a' - 'A');
}


x86 assembly (clang, -O0):
<str_ucase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115d <str_ucase+0x5d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1147 <str_ucase+0x47>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     1147 <str_ucase+0x47>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x20,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    114c <str_ucase+0x4c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <str_ucase+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_ucase>:
mov    (%rdi),%al
test   %al,%al
je     112a <str_ucase+0x2a>
add    $0x1,%rdi
jmp    111b <str_ucase+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <str_ucase+0x2a>
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <str_ucase+0x10>
add    $0xe0,%al
mov    %al,-0x1(%rdi)
jmp    1110 <str_ucase+0x10>
ret

LLVM IR (-O0):
define void @str_ucase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %25, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %28
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp sge i32 %10, 97
br i1 %11, label %12, label %24
12: ; preds = %7
%13 = load i8*, i8** %2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp sle i32 %15, 122
br i1 %16, label %17, label %24
17: ; preds = %12
%18 = load i8*, i8** %2
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = sub nsw i32 %20, 32
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %2
store i8 %22, i8* %23
br label %24
24: ; preds = %17, %12, %7
br label %25
25: ; preds = %24
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %2
br label %3
28: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @str_ucase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %5, -32
store i8 %10, i8* %6
br label %11
11: ; preds = %4, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nullf(char *);
int /*<<< orphan*/ output_byte(int);
void emit_fabs() {
  nullf("fabs\n");
  output_byte(0xd9);
  output_byte(0xe1);
}


x86 assembly (clang, -O0):
<emit_fabs>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <nullf@plt>
mov    $0xd9,%edi
call   1040 <output_byte@plt>
mov    $0xe1,%edi
call   1040 <output_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fabs>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <nullf@plt>
mov    $0xd9,%edi
call   1040 <output_byte@plt>
mov    $0xe1,%edi
pop    %rax
jmp    1040 <output_byte@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"fabs\0A\00"
define void @emit_fabs() {
%1 = call i32 @nullf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @output_byte(i32 217)
%3 = call i32 @output_byte(i32 225)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"fabs\0A\00"
define void @emit_fabs() {
%1 = tail call i32 @nullf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_byte(i32 217)
%3 = tail call i32 @output_byte(i32 225)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ getuid();
uid_t c_getuid_() { return getuid(); }


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

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

LLVM IR (-O0):
define i32 @c_getuid_() {
%1 = call i32 (...) @getuid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @c_getuid_() {
%1 = tail call i32 (...) @getuid()
ret i32 %1
}
void INT_Excep_MTU4_TGIC4(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU4_TGIC4() {
ret void
}
/* Variables and functions */
double fabs(double const);
int /*<<< orphan*/ printf(char *, double, char);
void printposn(const double c, int is_lat) {
  char d;
  if (is_lat) {
    if (c < 0)
      d = 'S';
    else
      d = 'N';
  } else {
    if (c < 0)
      d = 'W';
    else
      d = 'E';
  }
  printf("%f%c ", fabs(c), d);
}


x86 assembly (clang, -O0):
<printposn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114a <printposn+0x3a>
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1141 <printposn+0x31>
movb   $0x53,-0xd(%rbp)
jmp    1145 <printposn+0x35>
movb   $0x4e,-0xd(%rbp)
jmp    116a <printposn+0x5a>
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1161 <printposn+0x51>
movb   $0x57,-0xd(%rbp)
jmp    1165 <printposn+0x55>
movb   $0x45,-0xd(%rbp)
jmp    116a <printposn+0x5a>
movsd  -0x8(%rbp),%xmm0
movaps 0xe8a(%rip),%xmm1
pand   %xmm1,%xmm0
lea    0xe8f(%rip),%rdi
movsbl -0xd(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printposn>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
mov    $0x57,%ecx
mov    $0x45,%edx
cmova  %ecx,%edx
test   %edi,%edi
lea    0x4e(%rax,%rax,4),%eax
cmove  %edx,%eax
andpd  0xec5(%rip),%xmm0
movzbl %al,%esi
lea    0xecb(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%f%c \00"
define void @printposn(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca i8
store double %0, double* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load double, double* %3
%10 = fcmp olt double %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %8
store i8 83, i8* %5
br label %13
12: ; preds = %8
store i8 78, i8* %5
br label %13
13: ; preds = %12, %11
br label %20
14: ; preds = %2
%15 = load double, double* %3
%16 = fcmp olt double %15, 0.000000e+00
br i1 %16, label %17, label %18
17: ; preds = %14
store i8 87, i8* %5
br label %19
18: ; preds = %14
store i8 69, i8* %5
br label %19
19: ; preds = %18, %17
br label %20
20: ; preds = %19, %13
%21 = load double, double* %3
%22 = call double @llvm.fabs.f64(double %21)
%23 = load i8, i8* %5
%24 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %22, i8 signext %23)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%f%c \00"
define void @printposn(double %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = fcmp olt double %0, 0.000000e+00
%5 = select i1 %4, i8 83, i8 78
%6 = select i1 %4, i8 87, i8 69
%7 = select i1 %3, i8 %6, i8 %5
%8 = tail call double @llvm.fabs.f64(double %0)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %8, i8 signext %7)
ret void
}
void xxtea_encode_byte(char *v, int *k, int p) {
  char y[] = "XtEaNpK";
  *v = *v ^ y[p] ^ (char)(k[p % 4] % 0xFF);
}


x86 assembly (clang, -O0):
<xxtea_encode_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0xeea(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movslq -0x14(%rbp),%rcx
movsbl -0x1c(%rbp,%rcx,1),%ecx
xor    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0x28(%rbp),%rax
movslq %edx,%rcx
mov    (%rax,%rcx,4),%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%eax
mov    %dl,%cl
movsbl %cl,%ecx
xor    %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xxtea_encode_byte>:
movslq %edx,%rcx
lea    0xef6(%rip),%rax
mov    (%rcx,%rax,1),%al
xor    (%rdi),%al
lea    0x3(%rcx),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
and    $0xfffffffc,%edx
sub    %edx,%ecx
movslq %ecx,%rcx
movslq (%rsi,%rcx,4),%rcx
imul   $0xffffffff80808081,%rcx,%rdx
shr    $0x20,%rdx
add    %ecx,%edx
mov    %edx,%esi
shr    $0x1f,%esi
shr    $0x7,%edx
add    %esi,%edx
add    %ecx,%edx
xor    %al,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
@__const.xxtea_encode_byte.y = [8 x i8] c"XtEaNpK\00"
define void @xxtea_encode_byte(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca [8 x i8]
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = bitcast [8 x i8]* %7 to i8*
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = xor i32 %11, %16
%18 = load i32*, i32** %5
%19 = load i32, i32* %6
%20 = srem i32 %19, 4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %18, i64 %21
%23 = load i32, i32* %22
%24 = srem i32 %23, 255
%25 = trunc i32 %24 to i8
%26 = sext i8 %25 to i32
%27 = xor i32 %17, %26
%28 = trunc i32 %27 to i8
%29 = load i8*, i8** %4
store i8 %28, i8* %29
ret void
}

LLVM IR (-O2):
@__const.xxtea_encode_byte.y = [8 x i8] c"XtEaNpK\00"
define void @xxtea_encode_byte(i8* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i8, i8* %0
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [8 x i8], [8 x i8]* @__const.xxtea_encode_byte.y, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = xor i8 %7, %4
%9 = srem i32 %2, 4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = srem i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = xor i8 %8, %14
store i8 %15, i8* %0
ret void
}
int cycle_get_sprite_num(unsigned int flags) {
  return (flags & 0x00007000) >> 12;
}


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

x86 assembly (clang, -O2):
<cycle_get_sprite_num>:
mov    %edi,%eax
shr    $0xc,%eax
and    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @cycle_get_sprite_num(i32 %0) {
%2 = lshr i32 %0, 12
%3 = and i32 %2, 7
ret i32 %3
}
/* Variables and functions */
int check_strict_monotonicity(double *, int);
int test1() {
  double arr[] = {0.0, 1.0, 2.0};
  int n = 3;
  int i = check_strict_monotonicity(arr, n);
  return (i == 1);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x3,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <check_strict_monotonicity@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x1,-0x28(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
sub    $0x18,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
call   1030 <check_strict_monotonicity@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test1.arr = [3 x double] [double 0.000000e+00, double 1.000000e+00, double 2.000000e+00]
define i32 @test1() {
%1 = alloca [3 x double]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [3 x double]* %1 to i8*
store i32 3, i32* %2
%5 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @check_strict_monotonicity(double* %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@__const.test1.arr = [3 x double] [double 0.000000e+00, double 1.000000e+00, double 2.000000e+00]
define i32 @test1() {
%1 = alloca [3 x double]
%2 = bitcast [3 x double]* %1 to i8*
%3 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%4 = call i32 @check_strict_monotonicity(double* %3, i32 3)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void void_int(int x) { printf("void_int: %d\n", x); }


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

x86 assembly (clang, -O2):
<void_int>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"void_int: %d\0A\00"
define void @void_int(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ override_redirect;
};
struct TYPE_4__ {
  TYPE_1__ xcreatewindow;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xcreatewindow_override_redirect(void *_p) {
  return (int)((XEvent *)_p)->xcreatewindow.override_redirect;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XEvent_xcreatewindow_override_redirect(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
unsigned long clk_best_div(unsigned long parent_rate, unsigned long rate) {
  return parent_rate / rate + ((rate > (2 * (parent_rate % rate))) ? 0 : 1);
}


x86 assembly (clang, -O0):
<clk_best_div>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rdx,%rdi
shl    $0x1,%rdi
mov    $0x1,%ecx
xor    %edx,%edx
cmp    %rdi,%rsi
cmova  %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clk_best_div>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1116 <clk_best_div+0x16>
xor    %edx,%edx
div    %rsi
jmp    111a <clk_best_div+0x1a>
xor    %edx,%edx
div    %esi
add    %rdx,%rdx
cmp    %rsi,%rdx
sbb    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @clk_best_div(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = udiv i64 %5, %6
%8 = load i64, i64* %4
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = urem i64 %9, %10
%12 = mul i64 2, %11
%13 = icmp ugt i64 %8, %12
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 0, i32 1
%16 = sext i32 %15 to i64
%17 = add i64 %7, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @clk_best_div(i64 %0, i64 %1) {
%3 = udiv i64 %0, %1
%4 = urem i64 %0, %1
%5 = shl i64 %4, 1
%6 = icmp uge i64 %5, %1
%7 = zext i1 %6 to i64
%8 = add i64 %3, %7
ret i64 %8
}
/* Type definitions */
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
struct tm *localtime(long *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
long time(int /*<<< orphan*/ *);
void getTime(char *str) {
  long t = time(NULL);
  struct tm *tm1 = localtime(&t);
  char buf[128];
  strftime(buf, sizeof(buf), "%H:%M:%S\n", tm1);
  strcpy(str, buf);
  return;
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x80,%esi
lea    0xe80(%rip),%rdx
call   1060 <strftime@plt>
mov    -0x8(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
call   1040 <strcpy@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
push   %r14
push   %rbx
sub    $0x98,%rsp
mov    %rdi,%r14
xor    %edi,%edi
call   1050 <time@plt>
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xe96(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %rax,%rcx
call   1060 <strftime@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
add    $0x98,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [10 x i8] c"%H:%M:%S\0A\00"
define void @getTime(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca %struct.tm*
%5 = alloca [128 x i8]
store i8* %0, i8** %2
%6 = call i64 @time(i32* null)
store i64 %6, i64* %3
%7 = call %struct.tm* @localtime(i64* %3)
store %struct.tm* %7, %struct.tm** %4
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%9 = load %struct.tm*, %struct.tm** %4
%10 = call i32 @strftime(i8* %8, i32 128, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %struct.tm* %9)
%11 = load i8*, i8** %2
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%13 = call i32 @strcpy(i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [10 x i8] c"%H:%M:%S\0A\00"
define void @getTime(i8* %0) {
%2 = alloca i64
%3 = alloca [128 x i8]
%4 = bitcast i64* %2 to i8*
%5 = tail call i64 @time(i32* null)
store i64 %5, i64* %2
%6 = call %struct.tm* @localtime(i64* %2)
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%8 = call i32 @strftime(i8* %7, i32 128, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
%9 = call i32 @strcpy(i8* %0, i8* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void indent(int indt) {
  int i;
  for (i = 0; i < indt; i++) {
    printf(("  "));
  }
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <indent+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <indent+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <indent+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int strlen(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *timestamp() {
  char *stime;
  time_t ltime;
  ltime = time(NULL);
  stime = ctime(&ltime);
  stime[strlen(stime) - 1] = '\0';
  return stime;
}


x86 assembly (clang, -O0):
<timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestamp>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @timestamp() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i32 @time(i32* null)
store i32 %3, i32* %2
%4 = call i8* @ctime(i32* %2)
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 @strlen(i8* %6)
%8 = sub nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %5, i64 %9
store i8 0, i8* %10
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
define i8* @timestamp() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i8* @ctime(i32* %1)
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
store i8 0, i8* %8
ret i8* %4
}
void TestExpectGeFail(void) {
  TestExpect("(1) >= (2)",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/google/makani/refs/heads/master/"
             "avionics/firmware/test/test_test.c",
             __func__, 166, (1) >= (2));
}


x86 assembly (clang, -O0):
<TestExpectGeFail>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee9(%rip),%rsi
lea    0xf7f(%rip),%rdx
mov    $0xa6,%ecx
xor    %r8d,%r8d
mov    $0x0,%al
call   1030 <TestExpect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestExpectGeFail>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
lea    0xf83(%rip),%rdx
mov    $0xa6,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
jmp    1030 <TestExpect@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"(1) >= (2)\00"
@.str.1 = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/google/makani/refs/heads/master/avionics/firmware/test/test_test.c\00"
@__func__.TestExpectGeFail = [17 x i8] c"TestExpectGeFail\00"
define void @TestExpectGeFail() {
%1 = call i32 (i8*, i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @TestExpect to i32 (i8*, i8*, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.TestExpectGeFail, i64 0, i64 0), i32 166, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"(1) >= (2)\00"
@.str.1 = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/google/makani/refs/heads/master/avionics/firmware/test/test_test.c\00"
@__func__.TestExpectGeFail = [17 x i8] c"TestExpectGeFail\00"
define void @TestExpectGeFail() {
%1 = tail call i32 (i8*, i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @TestExpect to i32 (i8*, i8*, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.TestExpectGeFail, i64 0, i64 0), i32 166, i32 0)
ret void
}
void stm32_disable_write_protection() {}


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

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

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

LLVM IR (-O2):
define void @stm32_disable_write_protection() {
ret void
}
int test_imm_11uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x11 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_11uint64_highword_reg>:
movabs $0x1100000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_11uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 73014444032
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int next_utf8(char const *, int *);
int fn_ch_93(const char *text) {
  int pos = 0;
  if (next_utf8(text, &pos) == 93)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_ch_93>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <next_utf8@plt>
cmp    $0x5d,%eax
jne    1144 <fn_ch_93+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_ch_93+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_ch_93>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <next_utf8@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x5d,%ecx
jne    1133 <fn_ch_93+0x23>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fn_ch_93(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @next_utf8(i8* %5, i32* %4)
%7 = icmp eq i32 %6, 93
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %4
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @fn_ch_93(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @next_utf8(i8* %0, i32* %2)
%5 = icmp eq i32 %4, 93
%6 = load i32, i32* %2
%7 = select i1 %5, i32 %6, i32 -1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clear() { printf("\033[H\033[J"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[H\1B[J\00"
define void @clear() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[H\1B[J\00"
define void @clear() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
int uri_alphanum(int c) {
  return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
          (c >= '0' && c <= '9'));
}


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

x86 assembly (clang, -O2):
<uri_alphanum>:
mov    %edi,%eax
and    $0xffffffdf,%eax
add    $0xffffffbf,%eax
cmp    $0x1a,%eax
setb   %al
add    $0xffffffd0,%edi
cmp    $0xa,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @uri_alphanum(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = add i32 %0, -48
%6 = icmp ult i32 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
void foo239() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p384_to_bytes(uintptr_t, uintptr_t);
void fiat_p384_to_bytes(uint8_t out1[48], const uint32_t arg1[12]) {
  internal_fiat_p384_to_bytes((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_p384_to_bytes>:
jmp    1030 <internal_fiat_p384_to_bytes@plt>

LLVM IR (-O0):
define void @fiat_p384_to_bytes(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p384_to_bytes(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p384_to_bytes(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p384_to_bytes(i64 %3, i64 %4)
ret void
}
/* Type definitions */
struct sym {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
void symbol_putname(struct sym *sym, char *name) {
  if (sym != NULL)
    return;
  free(name);
}


x86 assembly (clang, -O0):
<symbol_putname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <symbol_putname+0x20>
jmp    1139 <symbol_putname+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<symbol_putname>:
test   %rdi,%rdi
je     1116 <symbol_putname+0x6>
ret
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.sym = type { i32 }
define void @symbol_putname(%struct.sym* %0, i8* %1) {
%3 = alloca %struct.sym*
%4 = alloca i8*
store %struct.sym* %0, %struct.sym** %3
store i8* %1, i8** %4
%5 = load %struct.sym*, %struct.sym** %3
%6 = icmp ne %struct.sym* %5, null
br i1 %6, label %7, label %8
7: ; preds = %2
br label %11
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i32 @free(i8* %9)
br label %11
11: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
%struct.sym = type { i32 }
define void @symbol_putname(%struct.sym* readnone %0, i8* nocapture %1) {
%3 = icmp eq %struct.sym* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @free(i8* %1)
br label %6
6: ; preds = %2, %4
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *pn_calloc(size_t nmemb, size_t size) {
  void *ret = calloc(nmemb, size);
  if (!ret) {
    do {
      fprintf(stderr, "Out of memory.\n");
      exit(1);
    } while (0);
  }
  return ret;
}


x86 assembly (clang, -O0):
<pn_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1180 <pn_calloc+0x50>
jmp    1161 <pn_calloc+0x31>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pn_calloc>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <pn_calloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"Out of memory.\0A\00"
define i8* @pn_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %17, label %11
11: ; preds = %2
br label %12
12: ; preds = %11
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; No predecessors!
br label %17
17: ; preds = %16, %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Out of memory.\0A\00"
define noalias i8* @pn_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
unsigned int rgb888_to_rgb565(char r, char g, char b) {
  unsigned int colour = 0x0000;
  colour = ((r >> 3) << 11) & 0xF800;
  colour |= ((g >> 2) << 5) & 0x07E0;
  colour |= ((b >> 3) << 0) & 0x001F;
  return colour;
}


x86 assembly (clang, -O0):
<rgb888_to_rgb565>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x3,%eax
shl    $0xb,%eax
and    $0xf800,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x2(%rbp),%eax
sar    $0x2,%eax
shl    $0x5,%eax
and    $0x7e0,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
movsbl -0x3(%rbp),%eax
sar    $0x3,%eax
shl    $0x0,%eax
and    $0x1f,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb888_to_rgb565>:
shr    $0x3,%dil
movzbl %dil,%eax
shl    $0xb,%eax
movzwl %ax,%eax
and    $0xfc,%esi
shr    $0x3,%dl
movzbl %dl,%ecx
or     %eax,%ecx
lea    (%rcx,%rsi,8),%eax
ret

LLVM IR (-O0):
define i32 @rgb888_to_rgb565(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i32
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
store i32 0, i32* %7
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = ashr i32 %9, 3
%11 = shl i32 %10, 11
%12 = and i32 %11, 63488
store i32 %12, i32* %7
%13 = load i8, i8* %5
%14 = sext i8 %13 to i32
%15 = ashr i32 %14, 2
%16 = shl i32 %15, 5
%17 = and i32 %16, 2016
%18 = load i32, i32* %7
%19 = or i32 %18, %17
store i32 %19, i32* %7
%20 = load i8, i8* %6
%21 = sext i8 %20 to i32
%22 = ashr i32 %21, 3
%23 = shl i32 %22, 0
%24 = and i32 %23, 31
%25 = load i32, i32* %7
%26 = or i32 %25, %24
store i32 %26, i32* %7
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @rgb888_to_rgb565(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = ashr i8 %0, 3
%5 = sext i8 %4 to i32
%6 = shl nsw i32 %5, 11
%7 = and i32 %6, 63488
%8 = ashr i8 %1, 2
%9 = sext i8 %8 to i32
%10 = shl nsw i32 %9, 5
%11 = and i32 %10, 2016
%12 = lshr i8 %2, 3
%13 = zext i8 %12 to i32
%14 = or i32 %7, %13
%15 = or i32 %14, %11
ret i32 %15
}
/* Type definitions */
typedef double time_t;

/* Variables and functions */
const char *tformat(void) {
  if (0.5 == (time_t)0.5) {
    if (sizeof(time_t) > sizeof(double))
      return "%Lg";
    return "%g";
  }
  if (0 > (time_t)-1) {
    if (sizeof(time_t) > sizeof(long))
      return "%lld";
    if (sizeof(time_t) > sizeof(int))
      return "%ld";
    return "%d";
  }
  if (sizeof(time_t) > sizeof(unsigned long))
    return "%llu";
  if (sizeof(time_t) > sizeof(unsigned int))
    return "%lu";
  return "%u";
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%g\00"
define i8* @tformat() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [3 x i8] c"%g\00"
define i8* @tformat() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
int test_imm_8Aint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x8A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_8Aint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 9043968
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int multiply(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int integer1;
  int integer2;
  int sum;
  int multiplyVal;
  integer1 = 55;
  integer2 = 66;
  multiplyVal = 0;
  sum = integer1 + integer2;
  multiplyVal = multiply(integer1, integer2);
  printf("The sum of %d and %d is %d.\n", integer1, integer2, sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x37,-0x8(%rbp)
movl   $0x42,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <multiply@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x37,%edi
mov    $0x42,%esi
call   1030 <multiply@plt>
lea    0xec9(%rip),%rdi
mov    $0x37,%esi
mov    $0x42,%edx
mov    $0x79,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"The sum of %d and %d is %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 55, i32* %2
store i32 66, i32* %3
store i32 0, i32* %5
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
store i32 %8, i32* %4
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @multiply(i32 %9, i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"The sum of %d and %d is %d.\0A\00"
define i32 @main() {
%1 = tail call i32 @multiply(i32 55, i32 66)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 55, i32 66, i32 121)
ret i32 0
}