xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void printArray(char *array, int len) { write(STDOUT_FILENO, array, len); }


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ed4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define void @printArray(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @STDOUT_FILENO
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @write(i32 %5, i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define void @printArray(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @STDOUT_FILENO
%4 = tail call i32 @write(i32 %3, i8* %0, i32 %1)
ret void
}
void toLower(char *string) {
  while (*string != 0) {
    if (*string >= 'A' && *string <= 'Z')
      *string += 32;
    string++;
  }
}


x86 assembly (clang, -O0):
<toLower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <toLower+0x55>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     1144 <toLower+0x44>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     1144 <toLower+0x44>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <toLower+0x8>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @toLower(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, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%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
}
double test_cosh(double x) { return __builtin_cosh(x); }


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

x86 assembly (clang, -O2):
<test_cosh>:
jmp    1030 <cosh@plt>

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

LLVM IR (-O2):
define double @test_cosh(double %0) {
%2 = tail call double @cosh(double %0)
ret double %2
}
/* Variables and functions */
int abs(int);
int BLSCheck(int *dBuf, int dbPtr, int *maxder) {
  int max, min, maxt, mint, t, x;
  max = min = 0;
  return (0);
  for (t = 0; t < ((int)(220 / 5 + 0.5)); ++t) {
    x = dBuf[dbPtr];
    if (x > max) {
      maxt = t;
      max = x;
    } else if (x < min) {
      mint = t;
      min = x;
    }
    if (++dbPtr == 16 + 1 + 5 - 1 + 12 + ((int)(200 / 5 + 0.5)) + 20)
      dbPtr = 0;
  }
  *maxder = max;
  min = -min;
  if ((max > (min >> 3)) && (min > (max >> 3)) &&
      (abs(maxt - mint) < ((int)(150 / 5 + 0.5))))
    return (0);
  else
    return (1);
}


x86 assembly (clang, -O0):
<BLSCheck>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @BLSCheck(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
store i32 0, i32* %8
store i32 0, i32* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @BLSCheck(i32* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
scalar_t__ _response(char *);
int do_rnfr(void) {
  if (_response("350 Please send the RNTO command.\r\n") < 0) {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<do_rnfr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <_response@plt>
cmp    $0x0,%rax
jge    113a <do_rnfr+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <do_rnfr+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_rnfr>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <_response@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"350 Please send the RNTO command.\0D\0A\00"
define i32 @do_rnfr() {
%1 = alloca i32
%2 = call i64 @_response(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [36 x i8] c"350 Please send the RNTO command.\0D\0A\00"
define i32 @do_rnfr() {
%1 = tail call i64 @_response(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%2 = ashr i64 %1, 63
%3 = trunc i64 %2 to i32
ret i32 %3
}
long long llabs(long long j) { return j < 0 ? -j : j; }


x86 assembly (clang, -O0):
<llabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <llabs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <llabs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @llabs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void TAMPER_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @TAMPER_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @TAMPER_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
unsigned char pio_inbyte(unsigned char);
void pio_rep_inbyte(unsigned char addrDataReg, unsigned char *bufAddr,
                    long byteCnt) {
  while (byteCnt > 0) {
    *bufAddr = pio_inbyte(addrDataReg);
    bufAddr++;
    byteCnt--;
  }
}


x86 assembly (clang, -O0):
<pio_rep_inbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jle    115f <pio_rep_inbyte+0x4f>
movzbl -0x1(%rbp),%edi
call   1030 <pio_inbyte@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1126 <pio_rep_inbyte+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pio_rep_inbyte>:
push   %rbp
push   %r14
push   %rbx
test   %rdx,%rdx
jle    1147 <pio_rep_inbyte+0x37>
mov    %rdx,%r14
mov    %rsi,%rbx
add    $0x1,%r14
movzbl %dil,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <pio_inbyte@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
add    $0xffffffffffffffff,%r14
cmp    $0x1,%r14
ja     1130 <pio_rep_inbyte+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @pio_rep_inbyte(i8 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i64
store i8 %0, i8* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
br label %7
7: ; preds = %10, %3
%8 = load i64, i64* %6
%9 = icmp sgt i64 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i8, i8* %4
%12 = call zeroext i8 @pio_inbyte(i8 zeroext %11)
%13 = load i8*, i8** %5
store i8 %12, i8* %13
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %5
%16 = load i64, i64* %6
%17 = add nsw i64 %16, -1
store i64 %17, i64* %6
br label %7
18: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @pio_rep_inbyte(i8 zeroext %0, i8* nocapture writeonly %1, i64 %2) {
%4 = icmp sgt i64 %2, 0
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i64 [ %10, %5 ], [ %2, %3 ]
%7 = phi i8* [ %9, %5 ], [ %1, %3 ]
%8 = tail call zeroext i8 @pio_inbyte(i8 zeroext %0)
store i8 %8, i8* %7
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = add nsw i64 %6, -1
%11 = icmp ugt i64 %6, 1
br i1 %11, label %5, label %12
12: ; preds = %5, %3
ret void
}
void XkbGetKeyExplicitComponents() {}


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

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

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

LLVM IR (-O2):
define void @XkbGetKeyExplicitComponents() {
ret void
}
unsigned short floor_log2_s_asm_loop(register unsigned short x) {
  unsigned short result = 0;
  asm("movw   %1, %%ax      ;"
      "shrw   %%ax          ;"
      "testw  %%ax, %%ax    ;"
      "je     end_%=        ;"
      "xorl   %%edx, %%edx  ;"
      "loop_%=:             ;"
      "incw   %%dx          ;"
      "shrw   %%ax          ;"
      "jne    loop_%=       ;"
      "movw   %%dx, %%ax    ;"
      "end_%=:              ;"
      "mov    %%ax, %0      ;"
      : "=r"(result)
      : "r"(x)
      : "%eax", "%edx");
  return result;
}


x86 assembly (clang, -O0):
<floor_log2_s_asm_loop>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movw   $0x0,-0x4(%rbp)
mov    -0x2(%rbp),%cx
mov    %cx,%ax
shr    %ax
test   %ax,%ax
je     1135 <end_0>
xor    %edx,%edx

x86 assembly (clang, -O2):
<floor_log2_s_asm_loop>:
mov    %di,%ax
shr    %ax
test   %ax,%ax
je     1118 <end_0>
xor    %edx,%edx

LLVM IR (-O0):
define zeroext i16 @floor_log2_s_asm_loop(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
store i16 0, i16* %3
%4 = load i16, i16* %2
%5 = call i16 asm "movw $1, %ax ;shrw %ax ;testw %ax, %ax ;je end_${:uid} ;xorl %edx, %edx ;loop_${:uid}: ;incw %dx ;shrw %ax ;jne loop_${:uid} ;movw %dx, %ax ;end_${:uid}: ;mov %ax, $0 ;", "=r,r,~{eax},~{edx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @floor_log2_s_asm_loop(i16 zeroext %0) {
%2 = tail call i16 asm "movw $1, %ax ;shrw %ax ;testw %ax, %ax ;je end_${:uid} ;xorl %edx, %edx ;loop_${:uid}: ;incw %dx ;shrw %ax ;jne loop_${:uid} ;movw %dx, %ax ;end_${:uid}: ;mov %ax, $0 ;", "=r,r,~{eax},~{edx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ printDateAndTime();
int /*<<< orphan*/ printTmpSample();
int main() {
  printTmpSample();
  printDateAndTime();
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @printTmpSample()
%3 = call i32 (...) @printDateAndTime()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @printTmpSample()
%2 = tail call i32 (...) @printDateAndTime()
ret i32 0
}
/* Variables and functions */
float fmodf(float, float);
float fmod32(float x, float y) { return fmodf(x, y); }


x86 assembly (clang, -O0):
<fmod32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <fmodf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmod32>:
jmp    1030 <fmodf@plt>

LLVM IR (-O0):
define float @fmod32(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @fmodf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @fmod32(float %0, float %1) {
%3 = tail call float @fmodf(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sig_intr_handler(int signo) {
  printf("SIGINT, exit...\n");
  exit(0);
}


x86 assembly (clang, -O0):
<sig_intr_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sig_intr_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"SIGINT, exit...\0A\00"
define void @sig_intr_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [16 x i8] c"SIGINT, exit...\00"
define void @sig_intr_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void do_banner() {
  printf(
      "MiniZip 1.01b, demo of zLib + Zip package written by Gilles Vollant\n");
  printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n");
}


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

x86 assembly (clang, -O2):
<do_banner>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf20(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [69 x i8] c"MiniZip 1.01b, demo of zLib + Zip package written by Gilles Vollant\0A\00"
@.str.1 = [58 x i8] c"more info at http://www.winimage.com/zLibDll/unzip.html\0A\0A\00"
define void @do_banner() {
%1 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [68 x i8] c"MiniZip 1.01b, demo of zLib + Zip package written by Gilles Vollant\00"
@str.2 = [57 x i8] c"more info at http://www.winimage.com/zLibDll/unzip.html\0A\00"
define void @do_banner() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.2, i64 0, i64 0))
ret void
}
int medofme(int A[], int *comp) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @medofme(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ add_array_number(double *, double *, double, int, int);
void add_array_number_inplace(double *out, double f, int ncol, int nlns) {
  add_array_number(out, out, f, ncol, nlns);
}


x86 assembly (clang, -O0):
<add_array_number_inplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <add_array_number@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_array_number_inplace>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
jmp    1030 <add_array_number@plt>

LLVM IR (-O0):
define void @add_array_number_inplace(double* %0, double %1, i32 %2, i32 %3) {
%5 = alloca double*
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
store double* %0, double** %5
store double %1, double* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load double*, double** %5
%10 = load double*, double** %5
%11 = load double, double* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @add_array_number(double* %9, double* %10, double %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @add_array_number_inplace(double* %0, double %1, i32 %2, i32 %3) {
%5 = tail call i32 @add_array_number(double* %0, double* %0, double %1, i32 %2, i32 %3)
ret void
}
int test_imm_6Auint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x6A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Auint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 106
%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_6Auint64_midword_reg(i64 %0) {
%2 = and i64 %0, 6946816
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void rpc_wake_lock_init(void) {}


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

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

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

LLVM IR (-O2):
define void @rpc_wake_lock_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
void z(int i) { bar(1); }


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

x86 assembly (clang, -O2):
<z>:
mov    $0x1,%edi
jmp    1030 <bar@plt>

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

LLVM IR (-O2):
define void @z(i32 %0) {
%2 = tail call i32 @bar(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x45() {
  Assert_real((islower(69) == 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",
              350, ("islower should be 0 for E"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x45>:
push   %rax
mov    $0x45,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x15e,%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 = [26 x i8] c"islower should be 0 for E\00"
define void @t_islower_0x45() {
%1 = call i64 @islower(i32 69)
%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 350, i8* getelementptr inbounds ([26 x i8], [26 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 = [26 x i8] c"islower should be 0 for E\00"
define void @t_islower_0x45() {
%1 = tail call i64 @islower(i32 69)
%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 350, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void utf8_latin1(FILE *in, FILE *out) {
  fprintf(stderr, "Not implemented yet\n");
}


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

x86 assembly (clang, -O2):
<utf8_latin1>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Not implemented yet\0A\00"
define void @utf8_latin1(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Not implemented yet\0A\00"
define void @utf8_latin1(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pnp_write_config(unsigned char, unsigned int, int);
void pnp_set_irq0(unsigned char port, unsigned irq) {
  pnp_write_config(port, irq, 0x70);
}


x86 assembly (clang, -O0):
<pnp_set_irq0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
mov    $0x70,%edx
movzbl %al,%edi
call   1030 <pnp_write_config@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pnp_set_irq0>:
mov    $0x70,%edx
jmp    1030 <pnp_write_config@plt>

LLVM IR (-O0):
define void @pnp_set_irq0(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = load i32, i32* %4
%7 = call i32 @pnp_write_config(i8 zeroext %5, i32 %6, i32 112)
ret void
}

LLVM IR (-O2):
define void @pnp_set_irq0(i8 zeroext %0, i32 %1) {
%3 = tail call i32 @pnp_write_config(i8 zeroext %0, i32 %1, i32 112)
ret void
}
int lookup(name, up, den, c)
char *name;
char *up;
{ return 0; }


x86 assembly (clang, -O0):
<lookup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @lookup(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @lookup(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 0
}
void system_sound_update(void) { return; }


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

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

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

LLVM IR (-O2):
define void @system_sound_update() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void print_version() {
  printf("%s, version: %s, author: %s\n", "check_nofiles_limits", "0.1",
         "Adrian Vondendriesch");
  exit(0);
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xeeb(%rip),%rsi
lea    0xef9(%rip),%rdx
lea    0xef6(%rip),%rcx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xefc(%rip),%rdx
lea    0xef9(%rip),%rcx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"%s, version: %s, author: %s\0A\00"
@.str.1 = [21 x i8] c"check_nofiles_limits\00"
@.str.2 = [4 x i8] c"0.1\00"
@.str.3 = [21 x i8] c"Adrian Vondendriesch\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [29 x i8] c"%s, version: %s, author: %s\0A\00"
@.str.1 = [21 x i8] c"check_nofiles_limits\00"
@.str.2 = [4 x i8] c"0.1\00"
@.str.3 = [21 x i8] c"Adrian Vondendriesch\00"
define void @print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void foo3c() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int get_codigo(char *arquivoAuxiliar) {
  FILE *fp;
  int codigo;
  fp = fopen(arquivoAuxiliar, "r");
  if (fp == NULL) {
    return (-1);
  }
  fscanf(fp, "%d\n", &codigo);
  fclose(fp);
  return (codigo);
}


x86 assembly (clang, -O0):
<get_codigo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1167 <get_codigo+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    118a <get_codigo+0x5a>
mov    -0x18(%rbp),%rdi
lea    0xe90(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_codigo>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     116b <get_codigo+0x3b>
mov    %rax,%rbx
lea    0xeb2(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
call   1040 <fscanf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    0xc(%rsp),%eax
jmp    1170 <get_codigo+0x40>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @get_codigo(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %17
11: ; preds = %1
%12 = load i32*, i32** %4
%13 = call i32 @fscanf(i32* %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%14 = load i32*, i32** %4
%15 = call i32 @fclose(i32* %14)
%16 = load i32, i32* %5
store i32 %16, i32* %2
br label %17
17: ; preds = %11, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @get_codigo(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = call i32 @fclose(i32* %4)
%9 = load i32, i32* %2
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ -1, %1 ]
ret i32 %11
}
const char *roadmap_log_filename() { return ("postmortem"); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"postmortem\00"
define i8* @roadmap_log_filename() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
int test_imm_36int16_reg(short val) {
  return ((val) & (-0x36 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_36int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffca,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_36int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -54
%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_36int16_reg(i16 signext %0) {
%2 = and i16 %0, -54
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int cos(double);
double log(int);
double AngleScore(double angle) {
  if (angle < 0.1)
    angle = 0.1;
  return -log((1 - cos(angle)) / 2);
}


x86 assembly (clang, -O0):
<AngleScore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xecb(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    114d <AngleScore+0x2d>
movsd  0xeb8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AngleScore>:
push   %rax
movsd  0xed7(%rip),%xmm1
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <cos@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
mov    %ecx,%edi
shr    $0x1f,%edi
add    %ecx,%edi
sar    %edi
call   1040 <log@plt>
xorpd  0xebd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @AngleScore(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 1.000000e-01
br i1 %4, label %5, label %6
5: ; preds = %1
store double 1.000000e-01, double* %2
br label %6
6: ; preds = %5, %1
%7 = load double, double* %2
%8 = call i32 @cos(double %7)
%9 = sub nsw i32 1, %8
%10 = sdiv i32 %9, 2
%11 = call double @log(i32 %10)
%12 = fneg double %11
ret double %12
}

LLVM IR (-O2):
define double @AngleScore(double %0) {
%2 = fcmp olt double %0, 1.000000e-01
%3 = select i1 %2, double 1.000000e-01, double %0
%4 = tail call i32 @cos(double %3)
%5 = sub nsw i32 1, %4
%6 = sdiv i32 %5, 2
%7 = tail call double @log(i32 %6)
%8 = fneg double %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
double f(int, int, int, int, int, int, double);
int main() {
  if (f(1, 2, 3, 4, 5, 6, 7.0) != 7.0)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
movsd  0xe99(%rip),%xmm0
call   1040 <f@plt>
movsd  0xe8c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1189 <main+0x59>
jp     1189 <main+0x59>
jmp    1190 <main+0x60>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xec7(%rip),%xmm0
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
call   1040 <f@plt>
ucomisd 0xe9a(%rip),%xmm0
jne    116a <main+0x3a>
jnp    1171 <main+0x41>
xor    %eax,%eax
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @f(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, double 7.000000e+00)
%3 = fcmp une double %2, 7.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double @f(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, double 7.000000e+00)
%2 = fcmp une double %1, 7.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_visualbasic_comments() {
  test_parser_verify_parse(test_parser_sourcefile("visualbasic", " 'comment"),
                           "visualbasic", "", "'comment", 0);
}


x86 assembly (clang, -O0):
<test_visualbasic_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec4(%rip),%rdx
lea    0xebf(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_visualbasic_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xedd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xecd(%rip),%rdx
lea    0xec8(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"visualbasic\00"
@.str.1 = [10 x i8] c" 'comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"'comment\00"
define void @test_visualbasic_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"visualbasic\00"
@.str.1 = [10 x i8] c" 'comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"'comment\00"
define void @test_visualbasic_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int core7_swap(char *, int);
int U_EMRSETWINDOWEXTEX_swap(char *record, int torev) {
  return (core7_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRSETWINDOWEXTEX_swap>:
jmp    1030 <core7_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRSETWINDOWEXTEX_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core7_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct nlattr {
  int nla_type;
};

/* Variables and functions */
int NLA_TYPE_MASK;
int nla_type(const struct nlattr *nla) { return nla->nla_type & NLA_TYPE_MASK; }


x86 assembly (clang, -O0):
<nla_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2ecb(%rip),%rcx
and    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_type>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
and    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.nlattr = type { i32 }
@NLA_TYPE_MASK = global i32 0
define i32 @nla_type(%struct.nlattr* %0) {
%2 = alloca %struct.nlattr*
store %struct.nlattr* %0, %struct.nlattr** %2
%3 = load %struct.nlattr*, %struct.nlattr** %2
%4 = getelementptr inbounds %struct.nlattr, %struct.nlattr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = load i32, i32* @NLA_TYPE_MASK
%7 = and i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
%struct.nlattr = type { i32 }
@NLA_TYPE_MASK = global i32 0
define i32 @nla_type(%struct.nlattr* nocapture %0) {
%2 = getelementptr inbounds %struct.nlattr, %struct.nlattr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = load i32, i32* @NLA_TYPE_MASK
%5 = and i32 %4, %3
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int riva128_ramin_readl(int, void *);
int /*<<< orphan*/ riva128_ramin_writel(int, int, void *);
void riva128_ramin_writeb(uint32_t addr, uint8_t val, void *p) {
  uint32_t tmp = riva128_ramin_readl(addr, p);
  tmp &= ~(0xff << ((addr & 3) << 3));
  tmp |= val << ((addr & 3) << 3);
  riva128_ramin_writel(addr, tmp, p);
}


x86 assembly (clang, -O0):
<riva128_ramin_writeb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <riva128_ramin_readl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
shl    $0x3,%ecx
mov    $0xff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
and    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
shl    $0x3,%ecx
shl    %cl,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <riva128_ramin_writel@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<riva128_ramin_writeb>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
mov    %rdx,%rsi
call   1040 <riva128_ramin_readl@plt>
lea    0x0(,%rbx,8),%ecx
mov    $0xff,%edx
shl    %cl,%edx
not    %edx
and    %eax,%edx
shl    %cl,%ebp
or     %edx,%ebp
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <riva128_ramin_writel@plt>

LLVM IR (-O0):
define void @riva128_ramin_writeb(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %6
%10 = call i32 @riva128_ramin_readl(i32 %8, i8* %9)
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = and i32 %11, 3
%13 = shl i32 %12, 3
%14 = shl i32 255, %13
%15 = xor i32 %14, -1
%16 = load i32, i32* %7
%17 = and i32 %16, %15
store i32 %17, i32* %7
%18 = load i32, i32* %5
%19 = load i32, i32* %4
%20 = and i32 %19, 3
%21 = shl i32 %20, 3
%22 = shl i32 %18, %21
%23 = load i32, i32* %7
%24 = or i32 %23, %22
store i32 %24, i32* %7
%25 = load i32, i32* %4
%26 = load i32, i32* %7
%27 = load i8*, i8** %6
%28 = call i32 @riva128_ramin_writel(i32 %25, i32 %26, i8* %27)
ret void
}

LLVM IR (-O2):
define void @riva128_ramin_writeb(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @riva128_ramin_readl(i32 %0, i8* %2)
%5 = shl i32 %0, 3
%6 = and i32 %5, 24
%7 = shl nuw i32 255, %6
%8 = xor i32 %7, -1
%9 = and i32 %4, %8
%10 = shl i32 %1, %6
%11 = or i32 %9, %10
%12 = tail call i32 @riva128_ramin_writel(i32 %0, i32 %11, i8* %2)
ret void
}
int my_find_prime_sup(int nb) {
  int result;
  int i;
  i = 2;
  while (i < nb) {
    result = nb / i;
    if (result * i == nb) {
      nb++;
      i = 1;
    }
    i++;
  }
  return (nb);
}


x86 assembly (clang, -O0):
<my_find_prime_sup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1152 <my_find_prime_sup+0x52>
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    1144 <my_find_prime_sup+0x44>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <my_find_prime_sup+0xe>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_find_prime_sup>:
cmp    $0x3,%edi
jl     1128 <my_find_prime_sup+0x28>
mov    $0x2,%ecx
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
add    $0x1,%esi
xor    %eax,%eax
test   %edx,%edx
sete   %al
cmove  %ecx,%esi
add    %eax,%edi
cmp    %edi,%esi
jl     1110 <my_find_prime_sup+0x10>
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @my_find_prime_sup(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %13
3: ; preds = %1, %3
%4 = phi i32 [ %11, %3 ], [ 2, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = srem i32 %5, %4
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = add nsw i32 %5, %8
%10 = add nsw i32 %4, 1
%11 = select i1 %7, i32 2, i32 %10
%12 = icmp slt i32 %11, %9
br i1 %12, label %3, label %13
13: ; preds = %3, %1
%14 = phi i32 [ %0, %1 ], [ %9, %3 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ cputchar(int /*<<< orphan*/);
void cputstring(const char *s) {
  while (*s)
    cputchar(*s++);
}


x86 assembly (clang, -O0):
<cputstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <cputstring+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <cputchar@plt>
jmp    111c <cputstring+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cputstring(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @cputchar(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @cputstring(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @cputchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}