#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 *, ...);
int readln_int();
void get_crop_parameters(int *minx, int *miny, int *minz, int *maxx, int *maxy,
                         int *maxz, int extx, int exty, int extz) {
  printf("voledit> Voxel range of cropping. Enter new grid values:\n");
  printf("voledit> Minimum x value (1-%d): ", extx);
  *minx = readln_int() - 1;
  if (*minx < 0)
    *minx = 0;
  if (*minx >= extx)
    *minx = extx - 1;
  printf("voledit> Maximum x value (%d-%d): ", *minx + 1, extx);
  *maxx = readln_int() - 1;
  if (*maxx < *minx)
    *maxx = *minx;
  if (*maxx >= extx)
    *maxx = extx - 1;
  printf("voledit> Minimum y value (1-%d): ", exty);
  *miny = readln_int() - 1;
  if (*miny < 0)
    *miny = 0;
  if (*miny >= exty)
    *miny = exty - 1;
  printf("voledit> Maximum y value (%d-%d): ", *miny + 1, exty);
  *maxy = readln_int() - 1;
  if (*maxy < *miny)
    *maxy = *miny;
  if (*maxy >= exty)
    *maxy = exty - 1;
  printf("voledit> Minimum z value (1-%d): ", extz);
  *minz = readln_int() - 1;
  if (*minz < 0)
    *minz = 0;
  if (*minz >= extz)
    *minz = extz - 1;
  printf("voledit> Maximum z value (%d-%d): ", *minz + 1, extz);
  *maxz = readln_int() - 1;
  if (*maxz < *minz)
    *maxz = *minz;
  if (*maxz >= extz)
    *maxz = extz - 1;
}


x86 assembly (clang, -O0):
<get_crop_parameters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x10(%rbp),%esi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <readln_int@plt>
mov    %eax,%ecx
sub    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jge    1191 <get_crop_parameters+0x71>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    0x10(%rbp),%eax
jl     11ac <get_crop_parameters+0x8c>
mov    0x10(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
add    $0x1,%esi
mov    0x10(%rbp),%edx
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <readln_int@plt>
mov    %eax,%ecx
sub    $0x1,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jge    11f6 <get_crop_parameters+0xd6>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
cmp    0x10(%rbp),%eax
jl     1211 <get_crop_parameters+0xf1>
mov    0x10(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    0x18(%rbp),%esi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <readln_int@plt>
mov    %eax,%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jge    124b <get_crop_parameters+0x12b>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    0x18(%rbp),%eax
jl     1266 <get_crop_parameters+0x146>
mov    0x18(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
add    $0x1,%esi
mov    0x18(%rbp),%edx
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <readln_int@plt>
mov    %eax,%ecx
sub    $0x1,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    12b0 <get_crop_parameters+0x190>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
cmp    0x18(%rbp),%eax
jl     12cb <get_crop_parameters+0x1ab>
mov    0x18(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    0x20(%rbp),%esi
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <readln_int@plt>
mov    %eax,%ecx
sub    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jge    1305 <get_crop_parameters+0x1e5>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
cmp    0x20(%rbp),%eax
jl     1320 <get_crop_parameters+0x200>
mov    0x20(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
add    $0x1,%esi
mov    0x20(%rbp),%edx
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <readln_int@plt>
mov    %eax,%ecx
sub    $0x1,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    136a <get_crop_parameters+0x24a>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rax
mov    (%rax),%eax
cmp    0x20(%rbp),%eax
jl     1385 <get_crop_parameters+0x265>
mov    0x20(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_crop_parameters>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,0x20(%rsp)
mov    %r8,0x10(%rsp)
mov    %rcx,%r14
mov    %rdx,0x18(%rsp)
mov    %rsi,0x8(%rsp)
mov    %rdi,%r12
mov    0x68(%rsp),%ebp
mov    0x60(%rsp),%r15d
lea    0xf67(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8c(%rip),%rdi
xor    %ebx,%ebx
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <readln_int@plt>
lea    -0x1(%rax),%esi
test   %eax,%eax
cmovle %ebx,%esi
lea    -0x1(%r15),%r13d
cmp    %r15d,%esi
cmovge %r13d,%esi
mov    %esi,(%r12)
add    $0x1,%esi
lea    0xe7a(%rip),%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <readln_int@plt>
lea    -0x1(%rax),%ecx
mov    %ecx,(%r14)
mov    (%r12),%edx
cmp    %edx,%eax
cmovg  %ecx,%edx
cmp    %r15d,%edx
cmovge %r13d,%edx
mov    %edx,(%r14)
lea    0xe6c(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <readln_int@plt>
lea    -0x1(%rax),%esi
test   %eax,%eax
mov    $0x0,%r15d
cmovle %r15d,%esi
mov    %rbp,%r14
lea    -0x1(%rbp),%ebx
cmp    %r14d,%esi
cmovge %ebx,%esi
mov    0x8(%rsp),%rbp
mov    %esi,0x0(%rbp)
add    $0x1,%esi
lea    0xe51(%rip),%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <readln_int@plt>
lea    -0x1(%rax),%ecx
mov    0x10(%rsp),%rsi
mov    %ecx,(%rsi)
mov    0x0(%rbp),%edx
cmp    %edx,%eax
cmovg  %ecx,%edx
cmp    %r14d,%edx
cmovge %ebx,%edx
mov    %edx,(%rsi)
lea    0xe42(%rip),%rdi
mov    0x70(%rsp),%r14d
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <readln_int@plt>
lea    -0x1(%rax),%esi
test   %eax,%eax
cmovle %r15d,%esi
lea    -0x1(%r14),%ebx
cmp    %r14d,%esi
cmovge %ebx,%esi
mov    0x18(%rsp),%rbp
mov    %esi,0x0(%rbp)
add    $0x1,%esi
lea    0xe29(%rip),%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <readln_int@plt>
lea    -0x1(%rax),%ecx
mov    0x20(%rsp),%rsi
mov    %ecx,(%rsi)
mov    0x0(%rbp),%edx
cmp    %edx,%eax
cmovg  %ecx,%edx
cmp    %r14d,%edx
cmovge %ebx,%edx
mov    %edx,(%rsi)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [58 x i8] c"voledit> Voxel range of cropping. Enter new grid values:\0A\00"
@.str.1 = [34 x i8] c"voledit> Minimum x value (1-%d): \00"
@.str.2 = [35 x i8] c"voledit> Maximum x value (%d-%d): \00"
@.str.3 = [34 x i8] c"voledit> Minimum y value (1-%d): \00"
@.str.4 = [35 x i8] c"voledit> Maximum y value (%d-%d): \00"
@.str.5 = [34 x i8] c"voledit> Minimum z value (1-%d): \00"
@.str.6 = [35 x i8] c"voledit> Maximum z value (%d-%d): \00"
define void @get_crop_parameters(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32 %6, i32 %7, i32 %8) {
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32* %0, i32** %10
store i32* %1, i32** %11
store i32* %2, i32** %12
store i32* %3, i32** %13
store i32* %4, i32** %14
store i32* %5, i32** %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%20 = load i32, i32* %16
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = call i32 (...) @readln_int()
%23 = sub nsw i32 %22, 1
%24 = load i32*, i32** %10
store i32 %23, i32* %24
%25 = load i32*, i32** %10
%26 = load i32, i32* %25
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %9
%29 = load i32*, i32** %10
store i32 0, i32* %29
br label %30
30: ; preds = %28, %9
%31 = load i32*, i32** %10
%32 = load i32, i32* %31
%33 = load i32, i32* %16
%34 = icmp sge i32 %32, %33
br i1 %34, label %35, label %39
35: ; preds = %30
%36 = load i32, i32* %16
%37 = sub nsw i32 %36, 1
%38 = load i32*, i32** %10
store i32 %37, i32* %38
br label %39
39: ; preds = %35, %30
%40 = load i32*, i32** %10
%41 = load i32, i32* %40
%42 = add nsw i32 %41, 1
%43 = load i32, i32* %16
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %42, i32 %43)
%45 = call i32 (...) @readln_int()
%46 = sub nsw i32 %45, 1
%47 = load i32*, i32** %13
store i32 %46, i32* %47
%48 = load i32*, i32** %13
%49 = load i32, i32* %48
%50 = load i32*, i32** %10
%51 = load i32, i32* %50
%52 = icmp slt i32 %49, %51
br i1 %52, label %53, label %57
53: ; preds = %39
%54 = load i32*, i32** %10
%55 = load i32, i32* %54
%56 = load i32*, i32** %13
store i32 %55, i32* %56
br label %57
57: ; preds = %53, %39
%58 = load i32*, i32** %13
%59 = load i32, i32* %58
%60 = load i32, i32* %16
%61 = icmp sge i32 %59, %60
br i1 %61, label %62, label %66
62: ; preds = %57
%63 = load i32, i32* %16
%64 = sub nsw i32 %63, 1
%65 = load i32*, i32** %13
store i32 %64, i32* %65
br label %66
66: ; preds = %62, %57
%67 = load i32, i32* %17
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %67)
%69 = call i32 (...) @readln_int()
%70 = sub nsw i32 %69, 1
%71 = load i32*, i32** %11
store i32 %70, i32* %71
%72 = load i32*, i32** %11
%73 = load i32, i32* %72
%74 = icmp slt i32 %73, 0
br i1 %74, label %75, label %77
75: ; preds = %66
%76 = load i32*, i32** %11
store i32 0, i32* %76
br label %77
77: ; preds = %75, %66
%78 = load i32*, i32** %11
%79 = load i32, i32* %78
%80 = load i32, i32* %17
%81 = icmp sge i32 %79, %80
br i1 %81, label %82, label %86
82: ; preds = %77
%83 = load i32, i32* %17
%84 = sub nsw i32 %83, 1
%85 = load i32*, i32** %11
store i32 %84, i32* %85
br label %86
86: ; preds = %82, %77
%87 = load i32*, i32** %11
%88 = load i32, i32* %87
%89 = add nsw i32 %88, 1
%90 = load i32, i32* %17
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i32 %89, i32 %90)
%92 = call i32 (...) @readln_int()
%93 = sub nsw i32 %92, 1
%94 = load i32*, i32** %14
store i32 %93, i32* %94
%95 = load i32*, i32** %14
%96 = load i32, i32* %95
%97 = load i32*, i32** %11
%98 = load i32, i32* %97
%99 = icmp slt i32 %96, %98
br i1 %99, label %100, label %104
100: ; preds = %86
%101 = load i32*, i32** %11
%102 = load i32, i32* %101
%103 = load i32*, i32** %14
store i32 %102, i32* %103
br label %104
104: ; preds = %100, %86
%105 = load i32*, i32** %14
%106 = load i32, i32* %105
%107 = load i32, i32* %17
%108 = icmp sge i32 %106, %107
br i1 %108, label %109, label %113
109: ; preds = %104
%110 = load i32, i32* %17
%111 = sub nsw i32 %110, 1
%112 = load i32*, i32** %14
store i32 %111, i32* %112
br label %113
113: ; preds = %109, %104
%114 = load i32, i32* %18
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i32 %114)
%116 = call i32 (...) @readln_int()
%117 = sub nsw i32 %116, 1
%118 = load i32*, i32** %12
store i32 %117, i32* %118
%119 = load i32*, i32** %12
%120 = load i32, i32* %119
%121 = icmp slt i32 %120, 0
br i1 %121, label %122, label %124
122: ; preds = %113
%123 = load i32*, i32** %12
store i32 0, i32* %123
br label %124
124: ; preds = %122, %113
%125 = load i32*, i32** %12
%126 = load i32, i32* %125
%127 = load i32, i32* %18
%128 = icmp sge i32 %126, %127
br i1 %128, label %129, label %133
129: ; preds = %124
%130 = load i32, i32* %18
%131 = sub nsw i32 %130, 1
%132 = load i32*, i32** %12
store i32 %131, i32* %132
br label %133
133: ; preds = %129, %124
%134 = load i32*, i32** %12
%135 = load i32, i32* %134
%136 = add nsw i32 %135, 1
%137 = load i32, i32* %18
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i32 %136, i32 %137)
%139 = call i32 (...) @readln_int()
%140 = sub nsw i32 %139, 1
%141 = load i32*, i32** %15
store i32 %140, i32* %141
%142 = load i32*, i32** %15
%143 = load i32, i32* %142
%144 = load i32*, i32** %12
%145 = load i32, i32* %144
%146 = icmp slt i32 %143, %145
br i1 %146, label %147, label %151
147: ; preds = %133
%148 = load i32*, i32** %12
%149 = load i32, i32* %148
%150 = load i32*, i32** %15
store i32 %149, i32* %150
br label %151
151: ; preds = %147, %133
%152 = load i32*, i32** %15
%153 = load i32, i32* %152
%154 = load i32, i32* %18
%155 = icmp sge i32 %153, %154
br i1 %155, label %156, label %160
156: ; preds = %151
%157 = load i32, i32* %18
%158 = sub nsw i32 %157, 1
%159 = load i32*, i32** %15
store i32 %158, i32* %159
br label %160
160: ; preds = %156, %151
ret void
}

LLVM IR (-O2):
@.str.1 = [34 x i8] c"voledit> Minimum x value (1-%d): \00"
@.str.2 = [35 x i8] c"voledit> Maximum x value (%d-%d): \00"
@.str.3 = [34 x i8] c"voledit> Minimum y value (1-%d): \00"
@.str.4 = [35 x i8] c"voledit> Maximum y value (%d-%d): \00"
@.str.5 = [34 x i8] c"voledit> Minimum z value (1-%d): \00"
@.str.6 = [35 x i8] c"voledit> Maximum z value (%d-%d): \00"
@str = [57 x i8] c"voledit> Voxel range of cropping. Enter new grid values:\00"
define void @get_crop_parameters(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture %5, i32 %6, i32 %7, i32 %8) {
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%12 = tail call i32 (...) @readln_int()
%13 = add nsw i32 %12, -1
%14 = icmp sgt i32 %12, 0
%15 = select i1 %14, i32 %13, i32 0
%16 = icmp slt i32 %15, %6
%17 = add nsw i32 %6, -1
%18 = select i1 %16, i32 %15, i32 %17
store i32 %18, i32* %0
%19 = add nsw i32 %18, 1
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %19, i32 %6)
%21 = tail call i32 (...) @readln_int()
%22 = add nsw i32 %21, -1
store i32 %22, i32* %3
%23 = load i32, i32* %0
%24 = icmp sgt i32 %21, %23
%25 = select i1 %24, i32 %22, i32 %23
%26 = icmp slt i32 %25, %6
%27 = select i1 %26, i32 %25, i32 %17
store i32 %27, i32* %3
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%29 = tail call i32 (...) @readln_int()
%30 = add nsw i32 %29, -1
%31 = icmp sgt i32 %29, 0
%32 = select i1 %31, i32 %30, i32 0
%33 = icmp slt i32 %32, %7
%34 = add nsw i32 %7, -1
%35 = select i1 %33, i32 %32, i32 %34
store i32 %35, i32* %1
%36 = add nsw i32 %35, 1
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i32 %36, i32 %7)
%38 = tail call i32 (...) @readln_int()
%39 = add nsw i32 %38, -1
store i32 %39, i32* %4
%40 = load i32, i32* %1
%41 = icmp sgt i32 %38, %40
%42 = select i1 %41, i32 %39, i32 %40
%43 = icmp slt i32 %42, %7
%44 = select i1 %43, i32 %42, i32 %34
store i32 %44, i32* %4
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i32 %8)
%46 = tail call i32 (...) @readln_int()
%47 = add nsw i32 %46, -1
%48 = icmp sgt i32 %46, 0
%49 = select i1 %48, i32 %47, i32 0
%50 = icmp slt i32 %49, %8
%51 = add nsw i32 %8, -1
%52 = select i1 %50, i32 %49, i32 %51
store i32 %52, i32* %2
%53 = add nsw i32 %52, 1
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i32 %53, i32 %8)
%55 = tail call i32 (...) @readln_int()
%56 = add nsw i32 %55, -1
store i32 %56, i32* %5
%57 = load i32, i32* %2
%58 = icmp sgt i32 %55, %57
%59 = select i1 %58, i32 %56, i32 %57
%60 = icmp slt i32 %59, %8
%61 = select i1 %60, i32 %59, i32 %51
store i32 %61, i32* %5
ret void
}