#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*/ sclp_print(char *);
int virtio_get_block_size();
void print_eckd_msg(void) {
  char msg[] = "Using ECKD scheme (block size *****), ";
  char *p = &msg[34], *q = &msg[30];
  int n = virtio_get_block_size();
  if (n > 0 && n <= 99999) {
    while (n) {
      *p-- = '0' + (n % 10);
      n /= 10;
    }
    while (p >= q) {
      *p-- = ' ';
    }
  }
  sclp_print(msg);
}


x86 assembly (clang, -O0):
<print_eckd_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x27,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rax
add    $0x22,%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rax
add    $0x1e,%rax
mov    %rax,-0x40(%rbp)
mov    $0x0,%al
call   1030 <virtio_get_block_size@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jle    11f8 <print_eckd_msg+0xc8>
cmpl   $0x1869f,-0x44(%rbp)
jg     11f8 <print_eckd_msg+0xc8>
jmp    118b <print_eckd_msg+0x5b>
cmpl   $0x0,-0x44(%rbp)
je     11c9 <print_eckd_msg+0x99>
mov    -0x44(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x38(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x38(%rbp)
mov    %cl,(%rax)
mov    -0x44(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x44(%rbp)
jmp    118b <print_eckd_msg+0x5b>
jmp    11ce <print_eckd_msg+0x9e>
mov    -0x38(%rbp),%rax
cmp    -0x40(%rbp),%rax
jb     11f3 <print_eckd_msg+0xc3>
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x38(%rbp)
movb   $0x20,(%rax)
jmp    11ce <print_eckd_msg+0x9e>
jmp    11f8 <print_eckd_msg+0xc8>
lea    -0x30(%rbp),%rdi
call   1050 <sclp_print@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_eckd_msg>:
sub    $0x28,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x202c292a2a2a2a,%rax
mov    %rax,0x1f(%rsp)
xor    %eax,%eax
call   1030 <virtio_get_block_size@plt>
lea    -0x1(%rax),%ecx
cmp    $0x1869e,%ecx
ja     11e0 <print_eckd_msg+0xb0>
lea    0x1e(%rsp),%r8
lea    0x22(%rsp),%rdx
lea    0x21(%rsp),%r9
mov    %rdx,%rdi
xchg   %ax,%ax
movslq %eax,%rsi
imul   $0x66666667,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
lea    (%rax,%rax,1),%ecx
lea    (%rcx,%rcx,4),%r10d
mov    %esi,%ecx
sub    %r10d,%ecx
add    $0x30,%cl
mov    %cl,(%rdi)
add    $0xffffffffffffffff,%rdi
add    $0x9,%esi
add    $0xffffffffffffffff,%rdx
add    $0xffffffffffffffff,%r9
cmp    $0x13,%esi
jae    1180 <print_eckd_msg+0x50>
cmp    %r8,%rdi
jb     11e0 <print_eckd_msg+0xb0>
lea    0x1d(%rsp),%rax
cmp    %rax,%r9
cmovb  %r9,%rax
sub    %rax,%rdx
sub    %r9,%rax
add    %rax,%rdi
mov    $0x20,%esi
call   1040 <memset@plt>
mov    %rsp,%rdi
call   1050 <sclp_print@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.print_eckd_msg.msg = [39 x i8] c"Using ECKD scheme (block size *****), \00"
define void @print_eckd_msg() {
%1 = alloca [39 x i8]
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = bitcast [39 x i8]* %1 to i8*
%6 = getelementptr inbounds [39 x i8], [39 x i8]* %1, i64 0, i64 34
store i8* %6, i8** %2
%7 = getelementptr inbounds [39 x i8], [39 x i8]* %1, i64 0, i64 30
store i8* %7, i8** %3
%8 = call i32 (...) @virtio_get_block_size()
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %36
11: ; preds = %0
%12 = load i32, i32* %4
%13 = icmp sle i32 %12, 99999
br i1 %13, label %14, label %36
14: ; preds = %11
br label %15
15: ; preds = %18, %14
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %27
18: ; preds = %15
%19 = load i32, i32* %4
%20 = srem i32 %19, 10
%21 = add nsw i32 48, %20
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %2
%24 = getelementptr inbounds i8, i8* %23, i32 -1
store i8* %24, i8** %2
store i8 %22, i8* %23
%25 = load i32, i32* %4
%26 = sdiv i32 %25, 10
store i32 %26, i32* %4
br label %15
27: ; preds = %15
br label %28
28: ; preds = %32, %27
%29 = load i8*, i8** %2
%30 = load i8*, i8** %3
%31 = icmp uge i8* %29, %30
br i1 %31, label %32, label %35
32: ; preds = %28
%33 = load i8*, i8** %2
%34 = getelementptr inbounds i8, i8* %33, i32 -1
store i8* %34, i8** %2
store i8 32, i8* %33
br label %28
35: ; preds = %28
br label %36
36: ; preds = %35, %11, %0
%37 = getelementptr inbounds [39 x i8], [39 x i8]* %1, i64 0, i64 0
%38 = call i32 @sclp_print(i8* %37)
ret void
}

LLVM IR (-O2):
@__const.print_eckd_msg.msg = [39 x i8] c"Using ECKD scheme (block size *****), \00"
define void @print_eckd_msg() {
%1 = alloca [39 x i8]
%2 = ptrtoint [39 x i8]* %1 to i64
%3 = getelementptr inbounds [39 x i8], [39 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [39 x i8], [39 x i8]* %1, i64 0, i64 30
%5 = tail call i32 (...) @virtio_get_block_size()
%6 = add i32 %5, -1
%7 = icmp ult i32 %6, 99999
br i1 %7, label %8, label %31
8: ; preds = %0
%9 = getelementptr inbounds [39 x i8], [39 x i8]* %1, i64 0, i64 34
br label %21
10: ; preds = %21
%11 = ptrtoint i8* %27 to i64
%12 = icmp ult i8* %27, %4
br i1 %12, label %31, label %13
13: ; preds = %10
%14 = add i64 %11, -1
%15 = add i64 %2, 29
%16 = call i64 @llvm.umin.i64(i64 %14, i64 %15)
%17 = add i64 %16, 1
%18 = sub i64 %17, %11
%19 = getelementptr i8, i8* %27, i64 %18
%20 = sub i64 %11, %16
br label %31
21: ; preds = %8, %21
%22 = phi i32 [ %28, %21 ], [ %5, %8 ]
%23 = phi i8* [ %27, %21 ], [ %9, %8 ]
%24 = srem i32 %22, 10
%25 = trunc i32 %24 to i8
%26 = add nsw i8 %25, 48
%27 = getelementptr inbounds i8, i8* %23, i64 -1
store i8 %26, i8* %23
%28 = sdiv i32 %22, 10
%29 = add i32 %22, 9
%30 = icmp ult i32 %29, 19
br i1 %30, label %10, label %21
31: ; preds = %13, %10, %0
%32 = call i32 @sclp_print(i8* %3)
ret void
}