xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ putchar(char const);
int puts(const char *string) {
  int i = 0;
  while (string[i] != 0) {
    putchar(string[i]);
    i = i + 1;
  }
  putchar('\n');
  return i + 1;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <puts+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <puts+0x13>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1147 <puts+0x37>
mov    %rdi,%r14
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%r14,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <puts+0x20>
jmp    114c <puts+0x3c>
mov    $0x1,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @putchar(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4
%13 = trunc i64 %8 to i32
%14 = add i32 %13, 1
br label %15
15: ; preds = %12, %1
%16 = phi i32 [ 1, %1 ], [ %14, %12 ]
%17 = tail call i32 @putchar(i8 signext 10)
ret i32 %16
}
int knc_transfer_length(int request_length, int response_length) {
  return 2 +
         ((request_length) < (4 + response_length) ? (4 + response_length)
                                                   : (request_length)) +
         4 + 1 + 3;
}


x86 assembly (clang, -O0):
<knc_transfer_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x4,%ecx
cmp    %ecx,%eax
jge    1129 <knc_transfer_length+0x29>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <knc_transfer_length+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
add    $0x4,%eax
add    $0x1,%eax
add    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<knc_transfer_length>:
lea    0x4(%rsi),%eax
cmp    %edi,%eax
cmovle %edi,%eax
add    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @knc_transfer_length(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 4, %6
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* %4
%11 = add nsw i32 4, %10
br label %14
12: ; preds = %2
%13 = load i32, i32* %3
br label %14
14: ; preds = %12, %9
%15 = phi i32 [ %11, %9 ], [ %13, %12 ]
%16 = add nsw i32 2, %15
%17 = add nsw i32 %16, 4
%18 = add nsw i32 %17, 1
%19 = add nsw i32 %18, 3
ret i32 %19
}

LLVM IR (-O2):
define i32 @knc_transfer_length(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 4
%4 = icmp sgt i32 %3, %0
%5 = select i1 %4, i32 %3, i32 %0
%6 = add nsw i32 %5, 10
ret i32 %6
}
void ECAPCaptureLoadingDisable(unsigned int baseAdd) {
  (*((volatile unsigned short *)(baseAdd + (0x28)))) &= ~(0x0100u);
}


x86 assembly (clang, -O0):
<ECAPCaptureLoadingDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x28,%eax
mov    %eax,%eax
mov    (%rax),%cx
movzwl %cx,%ecx
and    $0xfffffeff,%ecx
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ECAPCaptureLoadingDisable>:
add    $0x28,%edi
andw   $0xfeff,(%rdi)
ret

LLVM IR (-O0):
define void @ECAPCaptureLoadingDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 40
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i16*
%7 = load volatile i16, i16* %6
%8 = zext i16 %7 to i32
%9 = and i32 %8, -257
%10 = trunc i32 %9 to i16
store volatile i16 %10, i16* %6
ret void
}

LLVM IR (-O2):
define void @ECAPCaptureLoadingDisable(i32 %0) {
%2 = add i32 %0, 40
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i16*
%5 = load volatile i16, i16* %4
%6 = and i16 %5, -257
store volatile i16 %6, i16* %4
ret void
}
char UARTGetChar(void) { return *((char *)0xFFFFFFE0); }


x86 assembly (clang, -O0):
<UARTGetChar>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffe0,%eax
movsbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTGetChar>:
mov    $0xffffffe0,%eax
mov    (%rax),%al
ret

LLVM IR (-O0):
define signext i8 @UARTGetChar() {
%1 = load i8, i8* inttoptr (i64 4294967264 to i8*)
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @UARTGetChar() {
%1 = load i8, i8* inttoptr (i64 4294967264 to i8*)
ret i8 %1
}
/* Variables and functions */
float sin(int);
float f(int a) { return sin(a); }


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

x86 assembly (clang, -O2):
<f>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define float @f(i32 %0) {
%2 = tail call float @sin(i32 %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int);
int main() {
  foo(5, -1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
mov    $0xffffffff,%esi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0xffffffff,%esi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 5, i32 -1)
ret i32 0
}
double d_abs(double D) {
  if (D < 0)
    D = -1.0 * D;
  return D;
}


x86 assembly (clang, -O0):
<d_abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <d_abs+0x29>
movsd  0xee1(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_abs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @d_abs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fmul double -1.000000e+00, %6
store double %7, double* %2
br label %8
8: ; preds = %5, %1
%9 = load double, double* %2
ret double %9
}

LLVM IR (-O2):
define double @d_abs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
char HEX_DIGIT(char n) {
  n &= 0xf;
  return n < 10 ? n + '0' : n - 10 + 'A';
}


x86 assembly (clang, -O0):
<HEX_DIGIT>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jge    1130 <HEX_DIGIT+0x30>
movsbl -0x1(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <HEX_DIGIT+0x3d>
movsbl -0x1(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HEX_DIGIT>:
and    $0xf,%dil
lea    0x30(%rdi),%eax
lea    0x37(%rdi),%ecx
cmp    $0xa,%dil
movzbl %al,%edx
movzbl %cl,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @HEX_DIGIT(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 15
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, 48
br label %19
14: ; preds = %1
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = sub nsw i32 %16, 10
%18 = add nsw i32 %17, 65
br label %19
19: ; preds = %14, %10
%20 = phi i32 [ %13, %10 ], [ %18, %14 ]
%21 = trunc i32 %20 to i8
ret i8 %21
}

LLVM IR (-O2):
define signext i8 @HEX_DIGIT(i8 signext %0) {
%2 = and i8 %0, 15
%3 = icmp ult i8 %2, 10
%4 = or i8 %2, 48
%5 = add nuw nsw i8 %2, 55
%6 = select i1 %3, i8 %4, i8 %5
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ filename(char *);
int main() {
  filename("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/rutgers-apl/Atomicity-Violation-Detector/"
           "refs/heads/master/3rd/templight/llvm/tools/clang/test/"
           "CoverageMapping/builtinmacro.c"
           "test.c");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <filename@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [222 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/rutgers-apl/Atomicity-Violation-Detector/refs/heads/master/3rd/templight/llvm/tools/clang/test/CoverageMapping/builtinmacro.ctest.c\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @filename(i8* getelementptr inbounds ([222 x i8], [222 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [222 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/rutgers-apl/Atomicity-Violation-Detector/refs/heads/master/3rd/templight/llvm/tools/clang/test/CoverageMapping/builtinmacro.ctest.c\00"
define i32 @main() {
%1 = tail call i32 @filename(i8* getelementptr inbounds ([222 x i8], [222 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void getenv(void) {}


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

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

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

LLVM IR (-O2):
define void @getenv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hanno(int, char, char, char);
int main(void) {
  hanno(3, 'A', 'B', 'C');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1030 <hanno@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1030 <hanno@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @hanno(i32 3, i8 signext 65, i8 signext 66, i8 signext 67)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @hanno(i32 3, i8 signext 65, i8 signext 66, i8 signext 67)
ret i32 0
}
/* Type definitions */
struct ao_hex_image {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ao_hex_image *);
void ao_hex_image_free(struct ao_hex_image *image) { free(image); }


x86 assembly (clang, -O0):
<ao_hex_image_free>:
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):
<ao_hex_image_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.ao_hex_image = type { i32 }
define void @ao_hex_image_free(%struct.ao_hex_image* nocapture %0) {
%2 = tail call i32 @free(%struct.ao_hex_image* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void default_free(void *ctx, void *ptr) {
  (void)ctx;
  free(ptr);
}


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

x86 assembly (clang, -O2):
<default_free>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @default_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ permute(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  printf("Enter N: ");
  int n;
  scanf("%d", &n);
  permute(n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <permute@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"Enter N: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @permute(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Enter N: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @permute(i32 %5)
ret i32 0
}
/* Variables and functions */
char toupper(char);
void fixcase(char *name) {
  char *cp = name;
  while (*cp) {
    *cp = toupper(*cp);
    cp++;
  }
  return;
}


x86 assembly (clang, -O0):
<fixcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <fixcase+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <fixcase+0x14>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @fixcase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
unsigned int strlen(char const *);
size_t san_c(const char *input) {
  unsigned int count = strlen(input);
  const char *i;
  for (i = input; *i; i++) {
    if (*i == '\\' || *i == '\'') {
      count++;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<san_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     117c <san_c+0x6c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     115d <san_c+0x4d>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x27,%eax
jne    1166 <san_c+0x56>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116b <san_c+0x5b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1130 <san_c+0x20>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<san_c>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
jmp    1127 <san_c+0x17>
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
add    $0x1,%rbx
movzbl (%rbx),%ecx
cmp    $0x27,%cl
je     1120 <san_c+0x10>
cmp    $0x5c,%cl
je     1120 <san_c+0x10>
test   %cl,%cl
jne    1123 <san_c+0x13>
mov    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @san_c(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
br label %3
3: ; preds = %9, %1
%4 = phi i32 [ %2, %1 ], [ %10, %9 ]
%5 = phi i8* [ %0, %1 ], [ %11, %9 ]
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %12
i8 92, label %7
i8 39, label %7
]
7: ; preds = %3, %3
%8 = add i32 %4, 1
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ %8, %7 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %5, i64 1
br label %3
12: ; preds = %3
%13 = zext i32 %4 to i64
ret i64 %13
}
/* Variables and functions */
int atoi(char *);
int install_int(char *str) { return atoi(str); }


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

x86 assembly (clang, -O2):
<install_int>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @install_int(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ nlError(char *, char *);
void nlCloseDLL(void *handle) {
  (void)handle;
  nlError("nlCloseDLL", "Not implemented");
}


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

x86 assembly (clang, -O2):
<nlCloseDLL>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
jmp    1030 <nlError@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"nlCloseDLL\00"
@.str.1 = [16 x i8] c"Not implemented\00"
define void @nlCloseDLL(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @nlError(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"nlCloseDLL\00"
@.str.1 = [16 x i8] c"Not implemented\00"
define void @nlCloseDLL(i8* nocapture readnone %0) {
%2 = tail call i32 @nlError(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ rdc_disable_pg_v1p2();
int /*<<< orphan*/ rdc_disable_pg_vbat();
int /*<<< orphan*/ rdc_enable_clock();
int /*<<< orphan*/ rdc_reset();
void rdc_power_on() {
  rdc_reset();
  rdc_disable_pg_v1p2();
  delay(200);
  rdc_disable_pg_vbat();
  delay(200);
  rdc_enable_clock();
}


x86 assembly (clang, -O0):
<rdc_power_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <rdc_reset@plt>
mov    $0x0,%al
call   1070 <rdc_disable_pg_v1p2@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0x0,%al
call   1050 <rdc_disable_pg_vbat@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0x0,%al
call   1030 <rdc_enable_clock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdc_power_on>:
push   %rax
xor    %eax,%eax
call   1060 <rdc_reset@plt>
xor    %eax,%eax
call   1070 <rdc_disable_pg_v1p2@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
xor    %eax,%eax
call   1050 <rdc_disable_pg_vbat@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <rdc_enable_clock@plt>

LLVM IR (-O0):
define void @rdc_power_on() {
%1 = call i32 (...) @rdc_reset()
%2 = call i32 (...) @rdc_disable_pg_v1p2()
%3 = call i32 @delay(i32 200)
%4 = call i32 (...) @rdc_disable_pg_vbat()
%5 = call i32 @delay(i32 200)
%6 = call i32 (...) @rdc_enable_clock()
ret void
}

LLVM IR (-O2):
define void @rdc_power_on() {
%1 = tail call i32 (...) @rdc_reset()
%2 = tail call i32 (...) @rdc_disable_pg_v1p2()
%3 = tail call i32 @delay(i32 200)
%4 = tail call i32 (...) @rdc_disable_pg_vbat()
%5 = tail call i32 @delay(i32 200)
%6 = tail call i32 (...) @rdc_enable_clock()
ret void
}
void ff_hevc_put_hevc_epel_h64_10_sse4() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void flow_table_vlog(const char *fmt, va_list ap) {
  fprintf(stderr, "flow-table-ctl: ");
  vfprintf(stderr, fmt, ap);
}


x86 assembly (clang, -O0):
<flow_table_vlog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <vfprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flow_table_vlog>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb0(%rip),%r14
mov    (%r14),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <vfprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"flow-table-ctl: \00"
define void @flow_table_vlog(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @vfprintf(i32 %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"flow-table-ctl: \00"
define void @flow_table_vlog(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @vfprintf(i32 %5, i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t myrandom(uint8_t seed) {
  uint8_t out = seed >> 1;
  if (seed & 1) {
    out = out ^ 0xB8;
  }
  return out;
}


x86 assembly (clang, -O0):
<myrandom>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     112a <myrandom+0x2a>
mov    -0x8(%rbp),%eax
xor    $0xb8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myrandom>:
mov    %edi,%ecx
sar    %ecx
mov    %ecx,%eax
xor    $0xb8,%eax
test   $0x1,%dil
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @myrandom(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 1
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = and i32 %6, 1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = xor i32 %10, 184
store i32 %11, i32* %3
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @myrandom(i32 %0) {
%2 = ashr i32 %0, 1
%3 = and i32 %0, 1
%4 = icmp eq i32 %3, 0
%5 = xor i32 %2, 184
%6 = select i1 %4, i32 %2, i32 %5
ret i32 %6
}
int hash(char *c, int size) {
  int i, hash = 0;
  for (i = 0; c[i] != '\0'; i++)
    hash += c[i];
  hash %= size;
  return hash;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114e <hash+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <hash+0x19>
mov    -0xc(%rbp),%ecx
mov    -0x14(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1122 <hash+0x22>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
jmp    1124 <hash+0x24>
xor    %eax,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %11, %5 ], [ 0, %2 ]
%7 = phi i8 [ %13, %5 ], [ %3, %2 ]
%8 = phi i32 [ %10, %5 ], [ 0, %2 ]
%9 = sext i8 %7 to i32
%10 = add nsw i32 %8, %9
%11 = add nuw nsw i64 %6, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %10, %5 ]
%17 = srem i32 %16, %1
ret i32 %17
}
void __attribute__((constructor)) bar(void) {}


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @bar, i8* null }]
define void @bar() {
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] zeroinitializer
define void @bar() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ values;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int read_basic_csv(char *, int, int *);
int main() {
  int values[5];
  int result;
  char *fileLocation = "solution_3_txt.txt";
  int length = sizeof(values) / sizeof(values[0]);
  printf("%d\n", length);
  result = read_basic_csv(fileLocation, length, values);
  printf("result=%d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
movl   $0x5,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xecf(%rip),%rdi
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
lea    -0x20(%rbp),%rdx
call   1030 <read_basic_csv@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xeef(%rip),%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
mov    %rsp,%rdx
mov    $0x5,%esi
call   1030 <read_basic_csv@plt>
lea    0xec3(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"solution_3_txt.txt\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [11 x i8] c"result=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %4
store i32 5, i32* %5
%6 = load i32, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%11 = call i32 @read_basic_csv(i8* %8, i32 %9, i32* %10)
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"solution_3_txt.txt\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [11 x i8] c"result=%d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 5)
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = call i32 @read_basic_csv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 5, i32* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
void abcd3efghijklmnopqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @abcd3efghijklmnopqrstuvwxzy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bbgemm(double *, double *, double *);
void workload(double m1[64 * 64], double m2[64 * 64], double prod[64 * 64]) {
#pragma HLS INTERFACE m_axi port = m1 offset = slave bundle = gmem
#pragma HLS INTERFACE m_axi port = m2 offset = slave bundle = gmem
#pragma HLS INTERFACE m_axi port = prod offset = slave bundle = gmem
#pragma HLS INTERFACE s_axilite port = m1 bundle = control
#pragma HLS INTERFACE s_axilite port = m2 bundle = control
#pragma HLS INTERFACE s_axilite port = prod bundle = control
#pragma HLS INTERFACE s_axilite port = return bundle = control
  bbgemm(m1, m2, prod);
  return;
}


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

x86 assembly (clang, -O2):
<workload>:
jmp    1030 <bbgemm@plt>

LLVM IR (-O0):
define void @workload(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load double*, double** %6
%10 = call i32 @bbgemm(double* %7, double* %8, double* %9)
ret void
}

LLVM IR (-O2):
define void @workload(double* %0, double* %1, double* %2) {
%4 = tail call i32 @bbgemm(double* %0, double* %1, double* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *ecalloc(size_t nmemb, size_t size) {
  void *memory = calloc(nmemb, size);
  if (memory == NULL) {
    fprintf(stderr, "Erro: Impossível alocar memória.\n");
    exit(EXIT_FAILURE);
  }
  return memory;
}


x86 assembly (clang, -O0):
<ecalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <ecalloc+0x4f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"Erro: Imposs\C3\ADvel alocar mem\C3\B3ria.\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @ecalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"Erro: Imposs\C3\ADvel alocar mem\C3\B3ria.\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @ecalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ dumpShort(int /*<<< orphan*/);
void dumpVtable(unsigned short size, const unsigned short *vtable) {
  while (size) {
    dumpShort(*vtable++);
    size--;
  }
}


x86 assembly (clang, -O0):
<dumpVtable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
cmpw   $0x0,-0x2(%rbp)
je     1156 <dumpVtable+0x46>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x10(%rbp)
movzwl (%rax),%edi
call   1030 <dumpShort@plt>
mov    -0x2(%rbp),%ax
add    $0xffff,%ax
mov    %ax,-0x2(%rbp)
jmp    1123 <dumpVtable+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpVtable>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
je     1144 <dumpVtable+0x34>
mov    %rsi,%r14
movzwl %di,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzwl (%r14,%rbx,2),%edi
call   1030 <dumpShort@plt>
add    $0x1,%rbx
cmp    %bx,%r15w
jne    1130 <dumpVtable+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @dumpVtable(i16 zeroext %0, i16* %1) {
%3 = alloca i16
%4 = alloca i16*
store i16 %0, i16* %3
store i16* %1, i16** %4
br label %5
5: ; preds = %8, %2
%6 = load i16, i16* %3
%7 = icmp ne i16 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = load i16*, i16** %4
%10 = getelementptr inbounds i16, i16* %9, i32 1
store i16* %10, i16** %4
%11 = load i16, i16* %9
%12 = zext i16 %11 to i32
%13 = call i32 @dumpShort(i32 %12)
%14 = load i16, i16* %3
%15 = add i16 %14, -1
store i16 %15, i16* %3
br label %5
16: ; preds = %5
ret void
}

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


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

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

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

LLVM IR (-O2):
define void @mcu_atmel_atmega328p_Atmega328p_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void set_assert(unsigned char *crap, unsigned char old, unsigned char new) {
  assert(*crap == old);
  *crap = new;
}


x86 assembly (clang, -O0):
<set_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_assert>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
cmp    %sil,(%rbx)
sete   %dil
call   1030 <assert@plt>
mov    %bpl,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @set_assert(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = icmp eq i32 %9, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i8, i8* %6
%16 = load i8*, i8** %4
store i8 %15, i8* %16
ret void
}

LLVM IR (-O2):
define void @set_assert(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, %1
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
store i8 %2, i8* %0
ret void
}
/* Variables and functions */
long randnormalize();
long int randint(long int max) {
  return (long int)(randnormalize() * (max + 1));
}


x86 assembly (clang, -O0):
<randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <randnormalize@plt>
mov    -0x8(%rbp),%rcx
add    $0x1,%rcx
imul   %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randint>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <randnormalize@plt>
add    $0x1,%rbx
imul   %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @randint(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i64 (...) @randnormalize()
%4 = load i64, i64* %2
%5 = add nsw i64 %4, 1
%6 = mul nsw i64 %3, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @randint(i64 %0) {
%2 = tail call i64 (...) @randnormalize()
%3 = add nsw i64 %0, 1
%4 = mul nsw i64 %2, %3
ret i64 %4
}
/* Type definitions */
struct ida {
  int dummy;
};

/* Variables and functions */
int ida_get_new_above(struct ida *, int /*<<< orphan*/, int *);
int ida_get_new(struct ida *ida, int *p_id) {
  return ida_get_new_above(ida, 0, p_id);
}


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

x86 assembly (clang, -O2):
<ida_get_new>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <ida_get_new_above@plt>

LLVM IR (-O0):
%struct.ida = type { i32 }
define i32 @ida_get_new(%struct.ida* %0, i32* %1) {
%3 = alloca %struct.ida*
%4 = alloca i32*
store %struct.ida* %0, %struct.ida** %3
store i32* %1, i32** %4
%5 = load %struct.ida*, %struct.ida** %3
%6 = load i32*, i32** %4
%7 = call i32 @ida_get_new_above(%struct.ida* %5, i32 0, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.ida = type { i32 }
define i32 @ida_get_new(%struct.ida* %0, i32* %1) {
%3 = tail call i32 @ida_get_new_above(%struct.ida* %0, i32 0, i32* %1)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void store32_be(uint8_t dst[4], uint32_t w) {
  dst[3] = (uint8_t)w;
  w >>= 8;
  dst[2] = (uint8_t)w;
  w >>= 8;
  dst[1] = (uint8_t)w;
  w >>= 8;
  dst[0] = (uint8_t)w;
}


x86 assembly (clang, -O0):
<store32_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<store32_be>:
movslq %esi,%rax
mov    %rax,0x18(%rdi)
mov    %eax,%ecx
sar    $0x8,%ecx
movslq %ecx,%rcx
mov    %rcx,0x10(%rdi)
mov    %eax,%ecx
sar    $0x10,%ecx
movslq %ecx,%rcx
mov    %rcx,0x8(%rdi)
sar    $0x18,%eax
cltq
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @store32_be(i64* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i64, i64* %0, i64 3
store i64 %3, i64* %4
%5 = ashr i32 %1, 8
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i64, i64* %0, i64 2
store i64 %6, i64* %7
%8 = ashr i32 %1, 16
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %9, i64* %10
%11 = ashr i32 %1, 24
%12 = sext i32 %11 to i64
store i64 %12, i64* %0
ret void
}
int ctoi(char c) { return c - '0'; }


x86 assembly (clang, -O0):
<ctoi>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctoi>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ctoi(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @ctoi(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}