#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void c_print_results(char *name, char class, int n1, int n2, int n3, int niter,
                     char *optype, int passed_verification, char *npbversion) {
  printf("\n\n %s Benchmark Completed\n", name);
  printf(" Class           =                        %c\n", class);
  if (n3 == 0) {
    long nn = n1;
    if (n2 != 0)
      nn *= n2;
    printf(" Size            =             %12ld\n", nn);
  } else
    printf(" Size            =             %4dx%4dx%4d\n", n1, n2, n3);
  printf(" Iterations      =             %12d\n", niter);
  printf(" Operation type  = %24s\n", optype);
  if (passed_verification < 0)
    printf(" Verification    =            NOT PERFORMED\n");
  else if (passed_verification)
    printf(" Verification    =               SUCCESSFUL\n");
  else
    printf(" Verification    =             UNSUCCESSFUL\n");
  printf(" Version         =             %12s\n", npbversion);
  printf("\n\n");
  printf(" Please send all errors/feedbacks to:\n\n");
  printf(" NPB Development Team\n");
  printf(" npb@nas.nasa.gov\n\n");
}


x86 assembly (clang, -O0):
<c_print_results>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    0x20(%rbp),%rsi
mov    0x18(%rbp),%esi
mov    0x10(%rbp),%rsi
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x9(%rbp),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x18(%rbp)
jne    119f <c_print_results+0x8f>
movslq -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1188 <c_print_results+0x78>
movslq -0x14(%rbp),%rax
imul   -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b6 <c_print_results+0xa6>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x10(%rbp),%rsi
lea    0xeee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,0x18(%rbp)
jge    11f6 <c_print_results+0xe6>
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1226 <c_print_results+0x116>
cmpl   $0x0,0x18(%rbp)
je     1213 <c_print_results+0x103>
lea    0xeff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1221 <c_print_results+0x111>
lea    0xf19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1226 <c_print_results+0x116>
mov    0x20(%rbp),%rsi
lea    0xf2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_print_results>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9d,%r15d
mov    %r8d,%ebx
mov    %ecx,%ebp
mov    %edx,%r13d
mov    %esi,%r14d
mov    %rdi,%rsi
mov    0x60(%rsp),%rax
mov    %rax,0x10(%rsp)
mov    0x58(%rsp),%eax
mov    %eax,0xc(%rsp)
mov    0x50(%rsp),%r12
lea    0xea3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
je     1190 <c_print_results+0x70>
lea    0xeef(%rip),%rdi
mov    %r13d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11b2 <c_print_results+0x92>
movslq %r13d,%rax
test   %ebp,%ebp
mov    $0x1,%ecx
cmovne %ebp,%ecx
movslq %ecx,%rsi
imul   %rax,%rsi
lea    0xe9e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee2(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef6(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,0xc(%rsp)
lea    0xf1e(%rip),%rax
lea    0xf93(%rip),%rcx
cmove  %rax,%rcx
lea    0xfb4(%rip),%rdi
cmovns %rcx,%rdi
call   1030 <puts@plt>
lea    0xed7(%rip),%rdi
mov    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf3a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
lea    0xf24(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2e(%rip),%rdi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"\0A\0A %s Benchmark Completed\0A\00"
@.str.1 = [46 x i8] c" Class = %c\0A\00"
@.str.2 = [38 x i8] c" Size = %12ld\0A\00"
@.str.3 = [44 x i8] c" Size = %4dx%4dx%4d\0A\00"
@.str.4 = [37 x i8] c" Iterations = %12d\0A\00"
@.str.5 = [25 x i8] c" Operation type = %24s\0A\00"
@.str.6 = [45 x i8] c" Verification = NOT PERFORMED\0A\00"
@.str.7 = [45 x i8] c" Verification = SUCCESSFUL\0A\00"
@.str.8 = [45 x i8] c" Verification = UNSUCCESSFUL\0A\00"
@.str.9 = [37 x i8] c" Version = %12s\0A\00"
@.str.10 = [3 x i8] c"\0A\0A\00"
@.str.11 = [40 x i8] c" Please send all errors/feedbacks to:\0A\0A\00"
@.str.12 = [23 x i8] c" NPB Development Team\0A\00"
@.str.13 = [20 x i8] c" npb@nas.nasa.gov\0A\0A\00"
define void @c_print_results(i8* %0, i8 signext %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7, i8* %8) {
%10 = alloca i8*
%11 = alloca i8
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i8*
%19 = alloca i64
store i8* %0, i8** %10
store i8 %1, i8* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i8* %6, i8** %16
store i32 %7, i32* %17
store i8* %8, i8** %18
%20 = load i8*, i8** %10
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = load i8, i8* %11
%23 = sext i8 %22 to i32
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %23)
%25 = load i32, i32* %14
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %40
27: ; preds = %9
%28 = load i32, i32* %12
%29 = sext i32 %28 to i64
store i64 %29, i64* %19
%30 = load i32, i32* %13
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %37
32: ; preds = %27
%33 = load i32, i32* %13
%34 = sext i32 %33 to i64
%35 = load i64, i64* %19
%36 = mul nsw i64 %35, %34
store i64 %36, i64* %19
br label %37
37: ; preds = %32, %27
%38 = load i64, i64* %19
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i64 %38)
br label %45
40: ; preds = %9
%41 = load i32, i32* %12
%42 = load i32, i32* %13
%43 = load i32, i32* %14
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0), i32 %41, i32 %42, i32 %43)
br label %45
45: ; preds = %40, %37
%46 = load i32, i32* %15
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i32 %46)
%48 = load i8*, i8** %16
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %48)
%50 = load i32, i32* %17
%51 = icmp slt i32 %50, 0
br i1 %51, label %52, label %54
52: ; preds = %45
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0))
br label %62
54: ; preds = %45
%55 = load i32, i32* %17
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %54
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0))
br label %61
59: ; preds = %54
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.8, i64 0, i64 0))
br label %61
61: ; preds = %59, %57
br label %62
62: ; preds = %61, %52
%63 = load i8*, i8** %18
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0), i8* %63)
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.11, i64 0, i64 0))
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0))
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"\0A\0A %s Benchmark Completed\0A\00"
@.str.1 = [46 x i8] c" Class = %c\0A\00"
@.str.2 = [38 x i8] c" Size = %12ld\0A\00"
@.str.3 = [44 x i8] c" Size = %4dx%4dx%4d\0A\00"
@.str.4 = [37 x i8] c" Iterations = %12d\0A\00"
@.str.5 = [25 x i8] c" Operation type = %24s\0A\00"
@.str.9 = [37 x i8] c" Version = %12s\0A\00"
@str = [44 x i8] c" Verification = UNSUCCESSFUL\00"
@str.14 = [2 x i8] c"\0A\00"
@str.15 = [39 x i8] c" Please send all errors/feedbacks to:\0A\00"
@str.16 = [22 x i8] c" NPB Development Team\00"
@str.17 = [19 x i8] c" npb@nas.nasa.gov\0A\00"
@str.18 = [44 x i8] c" Verification = SUCCESSFUL\00"
@str.19 = [44 x i8] c" Verification = NOT PERFORMED\00"
define void @c_print_results(i8* %0, i8 signext %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7, i8* %8) {
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%11 = sext i8 %1 to i32
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = icmp eq i32 %4, 0
br i1 %13, label %14, label %21
14: ; preds = %9
%15 = sext i32 %2 to i64
%16 = icmp eq i32 %3, 0
%17 = select i1 %16, i32 1, i32 %3
%18 = sext i32 %17 to i64
%19 = mul nsw i64 %18, %15
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i64 %19)
br label %23
21: ; preds = %9
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0), i32 %2, i32 %3, i32 %4)
br label %23
23: ; preds = %21, %14
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i32 %5)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %6)
%26 = icmp slt i32 %7, 0
%27 = icmp eq i32 %7, 0
%28 = select i1 %27, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @str.18, i64 0, i64 0)
%29 = select i1 %26, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @str.19, i64 0, i64 0), i8* %28
%30 = tail call i32 @puts(i8* dereferenceable(1) %29)
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0), i8* %8)
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.14, i64 0, i64 0))
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.15, i64 0, i64 0))
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.16, i64 0, i64 0))
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.17, i64 0, i64 0))
ret void
}