xunge/DecIR huggingface dataset:
Vdiv(a, b, s) double a[3], b[3], s;
{
  a[0] = b[0] / s;
  a[1] = b[1] / s;
  a[2] = b[2] / s;
}


x86 assembly (clang, -O0):
<Vdiv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
divsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
divsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
divsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vdiv>:
movsd  (%rsi),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rdi)
movsd  0x8(%rsi),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rdi)
movsd  0x10(%rsi),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rdi)
ret

LLVM IR (-O0):
define i32 @Vdiv(double* %0, double* %1, double %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store double %2, double* %7
%8 = load double*, double** %6
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double, double* %7
%12 = fdiv double %10, %11
%13 = load double*, double** %5
%14 = getelementptr inbounds double, double* %13, i64 0
store double %12, double* %14
%15 = load double*, double** %6
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = load double, double* %7
%19 = fdiv double %17, %18
%20 = load double*, double** %5
%21 = getelementptr inbounds double, double* %20, i64 1
store double %19, double* %21
%22 = load double*, double** %6
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = load double, double* %7
%26 = fdiv double %24, %25
%27 = load double*, double** %5
%28 = getelementptr inbounds double, double* %27, i64 2
store double %26, double* %28
%29 = load i32, i32* %4
ret i32 %29
}

LLVM IR (-O2):
define i32 @Vdiv(double* nocapture writeonly %0, double* nocapture %1, double %2) {
%4 = load double, double* %1
%5 = fdiv double %4, %2
store double %5, double* %0
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = fdiv double %7, %2
%9 = getelementptr inbounds double, double* %0, i64 1
store double %8, double* %9
%10 = getelementptr inbounds double, double* %1, i64 2
%11 = load double, double* %10
%12 = fdiv double %11, %2
%13 = getelementptr inbounds double, double* %0, i64 2
store double %12, double* %13
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ cardReset();
int /*<<< orphan*/ ioDelay2(int);
void NTR_CmdReset(void) {
  cardReset();
  ioDelay2(0xF000);
}


x86 assembly (clang, -O0):
<NTR_CmdReset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <cardReset@plt>
mov    $0xf000,%edi
call   1040 <ioDelay2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NTR_CmdReset>:
push   %rax
xor    %eax,%eax
call   1030 <cardReset@plt>
mov    $0xf000,%edi
pop    %rax
jmp    1040 <ioDelay2@plt>

LLVM IR (-O0):
define void @NTR_CmdReset() {
%1 = call i32 (...) @cardReset()
%2 = call i32 @ioDelay2(i32 61440)
ret void
}

LLVM IR (-O2):
define void @NTR_CmdReset() {
%1 = tail call i32 (...) @cardReset()
%2 = tail call i32 @ioDelay2(i32 61440)
ret void
}
long hash(char *word) {
  int counter = 0;
  long hashed = 42;
  while (word[counter] != '\0') {
    hashed += word[counter] * (counter + 1);
    counter++;
  }
  return hashed;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movq   $0x2a,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1159 <hash+0x59>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
cltq
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <hash+0x17>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%dl
mov    $0x2a,%eax
test   %dl,%dl
je     1128 <hash+0x28>
mov    $0x1,%ecx
movsbl %dl,%edx
imul   %ecx,%edx
movslq %edx,%rdx
add    %rdx,%rax
movzbl (%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <hash+0x10>
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %15, %4 ], [ %2, %1 ]
%7 = phi i64 [ %13, %4 ], [ 42, %1 ]
%8 = sext i8 %6 to i64
%9 = add nuw nsw i64 %5, 1
%10 = mul i64 %9, %8
%11 = shl i64 %10, 32
%12 = ashr exact i64 %11, 32
%13 = add nsw i64 %7, %12
%14 = getelementptr inbounds i8, i8* %0, i64 %9
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %4, %1
%18 = phi i64 [ 42, %1 ], [ %13, %4 ]
ret i64 %18
}
/* Variables and functions */
scalar_t__ mu_badv_kmod_available(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (mu_badv_kmod_available(NULL)) {
    printf("TRUE");
  } else {
    printf("FALSE");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <mu_badv_kmod_available@plt>
cmp    $0x0,%rax
je     1153 <main+0x33>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
jmp    115f <main+0x3f>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <mu_badv_kmod_available@plt>
test   %rax,%rax
lea    0xed3(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"TRUE\00"
@.str.1 = [6 x i8] c"FALSE\00"
define i32 @main() {
%1 = tail call i64 @mu_badv_kmod_available(i32* null)
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret i32 0
}
int checknext(const char *s, int count) {
  int i;
  for (i = 0; i < count; i++) {
    if ((s[i] & 0xc0) != 0x80)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<checknext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1159 <checknext+0x59>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
je     1146 <checknext+0x46>
movl   $0x0,-0x4(%rbp)
jmp    1160 <checknext+0x60>
jmp    114b <checknext+0x4b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <checknext+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checknext>:
mov    $0x1,%eax
test   %esi,%esi
jle    1125 <checknext+0x25>
mov    %esi,%esi
xor    %edx,%edx
nopl   (%rax)
movzbl (%rdi,%rdx,1),%ecx
and    $0xc0,%cl
cmp    $0x80,%cl
jne    1126 <checknext+0x26>
add    $0x1,%rdx
cmp    %rdx,%rsi
jne    1110 <checknext+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @checknext(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %14, %5
br i1 %7, label %15, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %14, %6 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = and i8 %11, -64
%13 = icmp eq i8 %12, -128
%14 = add nuw nsw i64 %9, 1
br i1 %13, label %6, label %15
15: ; preds = %8, %6, %2
%16 = phi i32 [ 1, %2 ], [ 1, %6 ], [ 0, %8 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xc8() {
  Assert_real((islower(200) == 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_islower.c",
              1005, ("islower should be 0 for 0xc8"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xc8>:
push   %rax
mov    $0xc8,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3ed,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xc8\00"
define void @t_islower_0xc8() {
%1 = call i64 @islower(i32 200)
%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 1005, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xc8\00"
define void @t_islower_0xc8() {
%1 = tail call i64 @islower(i32 200)
%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 1005, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float make_float(unsigned int x) {
  union {
    unsigned int i;
    float f;
  } fi;
  fi.i = x;
  return fi.f;
}


x86 assembly (clang, -O0):
<make_float>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_float>:
movd   %edi,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @make_float(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = bitcast %union.anon* %3 to i32*
store i32 %4, i32* %5
%6 = bitcast %union.anon* %3 to float*
%7 = load float, float* %6
ret float %7
}

LLVM IR (-O2):
define float @make_float(i32 %0) {
%2 = bitcast i32 %0 to float
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ EC_KEY;

/* Variables and functions */
unsigned long ERR_get_error();
int /*<<< orphan*/ *d2i_EC_PUBKEY(int /*<<< orphan*/ *, unsigned char const **,
                                  long);
EC_KEY *openssl_d2i_EC_PUBKEY(const unsigned char *data, long len,
                              unsigned long *e) {
  EC_KEY *k = d2i_EC_PUBKEY(NULL, &data, len);
  if (k != NULL) {
    *e = 0;
    return k;
  }
  *e = ERR_get_error();
  return NULL;
}


x86 assembly (clang, -O0):
<openssl_d2i_EC_PUBKEY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%edi
lea    -0x10(%rbp),%rsi
call   1030 <d2i_EC_PUBKEY@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     116c <openssl_d2i_EC_PUBKEY+0x4c>
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1185 <openssl_d2i_EC_PUBKEY+0x65>
mov    $0x0,%al
call   1040 <ERR_get_error@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openssl_d2i_EC_PUBKEY>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rdx
mov    %rdi,0x8(%rsp)
xor    %r15d,%r15d
lea    0x8(%rsp),%rsi
xor    %edi,%edi
call   1030 <d2i_EC_PUBKEY@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1155 <openssl_d2i_EC_PUBKEY+0x35>
xor    %eax,%eax
call   1040 <ERR_get_error@plt>
mov    %rax,%r15
mov    %r15,(%r14)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32* @openssl_d2i_EC_PUBKEY(i8* %0, i64 %1, i64* nocapture writeonly %2) {
%4 = alloca i8*
store i8* %0, i8** %4
%5 = call i32* @d2i_EC_PUBKEY(i32* null, i8** %4, i64 %1)
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i64 (...) @ERR_get_error()
br label %9
9: ; preds = %3, %7
%10 = phi i64 [ %8, %7 ], [ 0, %3 ]
store i64 %10, i64* %2
ret i32* %5
}
/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
int shl(int, int);
uint64_t shr_arith(uint64_t n, unsigned amt) {
  uint64_t result = n >> amt;
  uint64_t sign_bits;
  if (amt == 64) {
    return 0;
  }
  if (n & 0x8000000000000000) {
    sign_bits = ~(shl(1, 64 - amt) - 1);
    result = result | sign_bits;
  }
  return result;
}


x86 assembly (clang, -O0):
<shr_arith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x40,-0xc(%rbp)
jne    113f <shr_arith+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1183 <shr_arith+0x73>
mov    -0x8(%rbp),%eax
movabs $0x8000000000000000,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     117d <shr_arith+0x6d>
mov    $0x40,%esi
sub    -0xc(%rbp),%esi
mov    $0x1,%edi
call   1030 <shl@plt>
sub    $0x1,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shr_arith>:
mov    %esi,%ecx
shr    %cl,%edi
xor    %eax,%eax
cmp    $0x40,%esi
cmovne %edi,%eax
ret

LLVM IR (-O0):
define i32 @shr_arith(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = lshr i32 %8, %9
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 64
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 0, i32* %3
br label %30
14: ; preds = %2
%15 = load i32, i32* %4
%16 = zext i32 %15 to i64
%17 = and i64 %16, -9223372036854775808
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %28
19: ; preds = %14
%20 = load i32, i32* %5
%21 = sub i32 64, %20
%22 = call i32 @shl(i32 1, i32 %21)
%23 = sub nsw i32 %22, 1
%24 = xor i32 %23, -1
store i32 %24, i32* %7
%25 = load i32, i32* %6
%26 = load i32, i32* %7
%27 = or i32 %25, %26
store i32 %27, i32* %6
br label %28
28: ; preds = %19, %14
%29 = load i32, i32* %6
store i32 %29, i32* %3
br label %30
30: ; preds = %28, %13
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @shr_arith(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 64
%4 = lshr i32 %0, %1
%5 = select i1 %3, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main(void) {
  int hour, minutes, seconds;
  printf("enter hour:minutes:seconds: ");
  scanf("%i:%i:%i", &hour, &minutes, &seconds);
  printf("%i:%i:%i\n", hour, minutes, seconds);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"enter hour:minutes:seconds: \00"
@.str.1 = [9 x i8] c"%i:%i:%i\00"
@.str.2 = [10 x i8] c"%i:%i:%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"enter hour:minutes:seconds: \00"
@.str.1 = [9 x i8] c"%i:%i:%i\00"
@.str.2 = [10 x i8] c"%i:%i:%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret i32 0
}
int asln_bind_key(char key, char *action) { return 0; }


x86 assembly (clang, -O0):
<asln_bind_key>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @asln_bind_key(i8 signext %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ EXTENDED_KEY_USAGE;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ EXTENDED_KEY_USAGE_it;
int i2d_EXTENDED_KEY_USAGE(EXTENDED_KEY_USAGE *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &EXTENDED_KEY_USAGE_it);
}


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

x86 assembly (clang, -O2):
<i2d_EXTENDED_KEY_USAGE>:
mov    0x2ed1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@EXTENDED_KEY_USAGE_it = global i32 0
define i32 @i2d_EXTENDED_KEY_USAGE(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @EXTENDED_KEY_USAGE_it)
ret i32 %3
}
/* Variables and functions */
char *ft_itoa(int);
int /*<<< orphan*/ ft_putstr_fd(char *, int);
void ft_putnbr_fd(int n, int fd) {
  char *value;
  value = ft_itoa(n);
  ft_putstr_fd(value, fd);
}


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

x86 assembly (clang, -O2):
<ft_putnbr_fd>:
push   %rbx
mov    %esi,%ebx
call   1030 <ft_itoa@plt>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <ft_putstr_fd@plt>

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

LLVM IR (-O2):
define void @ft_putnbr_fd(i32 %0, i32 %1) {
%3 = tail call i8* @ft_itoa(i32 %0)
%4 = tail call i32 @ft_putstr_fd(i8* %3, i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ getuid();
long GETUID() { return ((long)getuid()); }


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

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

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

LLVM IR (-O2):
define i64 @GETUID() {
%1 = tail call i64 (...) @getuid()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *, int, long long, double);
int CheckSimple() {
#pragma omp target
  {
    const char *fmt = "%d %lld %f";
    printf(fmt, 1, 2ll, 3.0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<CheckSimple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
movsd  0xec7(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckSimple>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
mov    $0x2,%edx
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%d %lld %f\00"
define i32 @CheckSimple() {
%1 = alloca i8*
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @printf(i8* %2, i32 1, i64 2, double 3.000000e+00)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%d %lld %f\00"
define i32 @CheckSimple() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1, i64 2, double 3.000000e+00)
ret i32 0
}
void __attribute__((constructor)) initialize() {
  printf(__func__);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<initialize>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@__func__.initialize = [11 x i8] c"initialize\00"
@.str = [2 x i8] c"\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @initialize, i8* null }]
define void @initialize() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.initialize, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.initialize = [11 x i8] c"initialize\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @initialize, i8* null }]
define void @initialize() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.initialize, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ time;
};
typedef TYPE_1__ XKeyPressedEvent;

/* Variables and functions */
unsigned long get_XKeyPressedEvent_time(void *_p) {
  return (unsigned long)((XKeyPressedEvent *)_p)->time;
}


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

x86 assembly (clang, -O2):
<get_XKeyPressedEvent_time>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @get_XKeyPressedEvent_time(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
struct game_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct game_state *);
void state_delete(struct game_state *state) { free(state); }


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

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

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

LLVM IR (-O2):
%struct.game_state = type { i32 }
define void @state_delete(%struct.game_state* nocapture %0) {
%2 = tail call i32 @free(%struct.game_state* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ *v;
  int /*<<< orphan*/ *s;
};
typedef TYPE_1__ SRP_user_pwd;
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int SRP_user_pwd_set_sv_BN(SRP_user_pwd *vinfo, BIGNUM *s, BIGNUM *v) {
  vinfo->v = v;
  vinfo->s = s;
  return (vinfo->s != NULL && vinfo->v != NULL);
}


x86 assembly (clang, -O0):
<SRP_user_pwd_set_sv_BN>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpq   $0x0,0x8(%rcx)
mov    %al,-0x19(%rbp)
je     1149 <SRP_user_pwd_set_sv_BN+0x49>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SRP_user_pwd_set_sv_BN>:
mov    %rdx,(%rdi)
mov    %rsi,0x8(%rdi)
test   %rsi,%rsi
setne  %al
test   %rdx,%rdx
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32*, i32* }
define i32 @SRP_user_pwd_set_sv_BN(%struct.TYPE_3__* %0, i32* %1, i32* %2) {
%4 = alloca %struct.TYPE_3__*
%5 = alloca i32*
%6 = alloca i32*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32* %7, i32** %9
%10 = load i32*, i32** %5
%11 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %11, i32 0, i32 1
store i32* %10, i32** %12
%13 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%14 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %13, i32 0, i32 1
%15 = load i32*, i32** %14
%16 = icmp ne i32* %15, null
br i1 %16, label %17, label %22
17: ; preds = %3
%18 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%19 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %18, i32 0, i32 0
%20 = load i32*, i32** %19
%21 = icmp ne i32* %20, null
br label %22
22: ; preds = %17, %3
%23 = phi i1 [ false, %3 ], [ %21, %17 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32*, i32* }
define i32 @SRP_user_pwd_set_sv_BN(%struct.TYPE_3__* nocapture %0, i32* %1, i32* %2) {
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
store i32* %2, i32** %4
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
store i32* %1, i32** %5
%6 = icmp ne i32* %1, null
%7 = icmp ne i32* %2, null
%8 = and i1 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
int linear_search(int arr[], int size, int element) {
  for (int i = 0; i < size; i++) {
    if (arr[i] == element) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<linear_search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <linear_search+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <linear_search+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <linear_search+0x5a>
jmp    1145 <linear_search+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <linear_search+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_search>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <linear_search+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <linear_search+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <linear_search+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @linear_search(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
double calerf(double, int);
double derfcx(double x) { return (calerf(x, 2)); }


x86 assembly (clang, -O0):
<derfcx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <calerf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<derfcx>:
mov    $0x2,%edi
jmp    1030 <calerf@plt>

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

LLVM IR (-O2):
define double @derfcx(double %0) {
%2 = tail call double @calerf(double %0, i32 2)
ret double %2
}
int test_imm_BFint64_lowword_mem(long long *val) {
  return ((*val) & (0xBF << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BFint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 191
%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_BFint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 191
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
bool ncui_is_pfx_char(char c) {
  return (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9');
}


x86 assembly (clang, -O0):
<ncui_is_pfx_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1129 <ncui_is_pfx_char+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <ncui_is_pfx_char+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <ncui_is_pfx_char+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncui_is_pfx_char>:
lea    -0x41(%rdi),%eax
cmp    $0x1a,%al
setb   %al
add    $0xd0,%dil
cmp    $0xa,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @ncui_is_pfx_char(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -48
%5 = icmp ult i8 %4, 10
%6 = or i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
int set_proximity_threshold(struct ssp_data *data, unsigned char uData1,
                            unsigned char uData2) {
  return 0;
}


x86 assembly (clang, -O0):
<set_proximity_threshold>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ssp_data = type opaque
define i32 @set_proximity_threshold(%struct.ssp_data* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca %struct.ssp_data*
%5 = alloca i8
%6 = alloca i8
store %struct.ssp_data* %0, %struct.ssp_data** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
ret i32 0
}

LLVM IR (-O2):
%struct.ssp_data = type opaque
define i32 @set_proximity_threshold(%struct.ssp_data* nocapture readnone %0, i8 zeroext %1, i8 zeroext %2) {
ret i32 0
}
/* Type definitions */
struct t_infolist {
  int dummy;
};

/* Variables and functions */
scalar_t__ infolist_prev(struct t_infolist *);
int /*<<< orphan*/ infolist_valid(struct t_infolist *);
int plugin_api_infolist_prev(struct t_infolist *infolist) {
  if (!infolist || !infolist_valid(infolist))
    return 0;
  return (infolist_prev(infolist)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<plugin_api_infolist_prev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1149 <plugin_api_infolist_prev+0x29>
mov    -0x10(%rbp),%rdi
call   1040 <infolist_valid@plt>
cmp    $0x0,%eax
jne    1155 <plugin_api_infolist_prev+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1172 <plugin_api_infolist_prev+0x52>
mov    -0x10(%rbp),%rdi
call   1030 <infolist_prev@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_api_infolist_prev>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
test   %rdi,%rdi
je     1147 <plugin_api_infolist_prev+0x27>
mov    %rdi,%rbx
call   1040 <infolist_valid@plt>
test   %eax,%eax
je     1147 <plugin_api_infolist_prev+0x27>
mov    %rbx,%rdi
call   1030 <infolist_prev@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.t_infolist = type { i32 }
define i32 @plugin_api_infolist_prev(%struct.t_infolist* %0) {
%2 = alloca i32
%3 = alloca %struct.t_infolist*
store %struct.t_infolist* %0, %struct.t_infolist** %3
%4 = load %struct.t_infolist*, %struct.t_infolist** %3
%5 = icmp ne %struct.t_infolist* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.t_infolist*, %struct.t_infolist** %3
%8 = call i32 @infolist_valid(%struct.t_infolist* %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %6, %1
store i32 0, i32* %2
br label %17
11: ; preds = %6
%12 = load %struct.t_infolist*, %struct.t_infolist** %3
%13 = call i64 @infolist_prev(%struct.t_infolist* %12)
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 1, i32 0
store i32 %16, i32* %2
br label %17
17: ; preds = %11, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.t_infolist = type { i32 }
define i32 @plugin_api_infolist_prev(%struct.t_infolist* %0) {
%2 = icmp eq %struct.t_infolist* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @infolist_valid(%struct.t_infolist* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 @infolist_prev(%struct.t_infolist* %0)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %1, %3, %6
%11 = phi i32 [ %9, %6 ], [ 0, %3 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
short rshft_h(short *, short *);
short intr_wrap_563(short p1, short p2) { return rshft_h(&p1, &p2); }


x86 assembly (clang, -O0):
<intr_wrap_563>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
lea    -0x2(%rbp),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <rshft_h@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_563>:
push   %rax
mov    %di,0x6(%rsp)
mov    %si,0x4(%rsp)
lea    0x6(%rsp),%rdi
lea    0x4(%rsp),%rsi
call   1030 <rshft_h@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @intr_wrap_563(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call signext i16 @rshft_h(i16* %3, i16* %4)
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @intr_wrap_563(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call signext i16 @rshft_h(i16* %3, i16* %4)
ret i16 %5
}
void force_eval_float(float x) { volatile float y __attribute__((unused)) = x; }


x86 assembly (clang, -O0):
<force_eval_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<force_eval_float>:
movss  %xmm0,-0x4(%rsp)
ret

LLVM IR (-O0):
define void @force_eval_float(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
store volatile float %4, float* %3
ret void
}

LLVM IR (-O2):
define void @force_eval_float(float %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
store volatile float %0, float* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void main() {
  printf("Hello\n");
  getchar();
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

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

LLVM IR (-O2):
@str = [6 x i8] c"Hello\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret void
}
int test_imm_D6uint32_mem(unsigned int *val) {
  return ((*val) & (0xD6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D6uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xd6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_D6uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 214
%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_D6uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 214
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int ft_tolower(int c) { return (((c >= 65) && (c <= 90)) ? c + 32 : c); }


x86 assembly (clang, -O0):
<ft_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1129 <ft_tolower+0x29>
cmpl   $0x5a,-0x4(%rbp)
jg     1129 <ft_tolower+0x29>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <ft_tolower+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 32
br label %13
11: ; preds = %5, %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @ft_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void print_decimal64(uint64_t value) {
  if (fprintf(stdout, "%llu\n", value) < 0) {
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<print_decimal64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
cmp    $0x0,%rax
jge    115b <print_decimal64+0x3b>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_decimal64>:
push   %rax
mov    %edi,%edx
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
test   %rax,%rax
js     113f <print_decimal64+0x1f>
pop    %rax
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [6 x i8] c"%llu\0A\00"
@EXIT_FAILURE = global i32 0
define void @print_decimal64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = load i32, i32* %2
%5 = call i64 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [6 x i8] c"%llu\0A\00"
@EXIT_FAILURE = global i32 0
define void @print_decimal64(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i64 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}