#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 */
typedef unsigned int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
uint32_t read_length(uint32_t min) {
  unsigned int length = 0;
  while (!(length > min)) {
    scanf("%d", &length);
    if (!(length > min))
      printf("Too small value, chose another\n");
  }
  return length;
}


x86 assembly (clang, -O0):
<read_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
seta   %al
xor    $0xff,%al
test   $0x1,%al
jne    114a <read_length+0x2a>
jmp    1177 <read_length+0x57>
lea    0xeaf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
ja     1172 <read_length+0x52>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <read_length+0x12>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_length>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edi,%ebx
movl   $0x0,0x4(%rsp)
lea    0xec7(%rip),%r14
lea    0x4(%rsp),%r15
lea    0xebe(%rip),%r12
jmp    1154 <read_length+0x34>
nopw   0x0(%rax,%rax,1)
cmp    %ebx,%eax
ja     1175 <read_length+0x55>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    %ebx,%eax
ja     1150 <read_length+0x30>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%eax
jmp    1150 <read_length+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [32 x i8] c"Too small value, chose another\0A\00"
define i32 @read_length(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp ugt i32 %5, %6
%8 = xor i1 %7, true
br i1 %8, label %9, label %17
9: ; preds = %4
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = icmp ugt i32 %11, %12
br i1 %13, label %16, label %14
14: ; preds = %9
%15 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %9
br label %4
17: ; preds = %4
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [31 x i8] c"Too small value, chose another\00"
define i32 @read_length(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
br label %4
4: ; preds = %1, %11
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp ugt i32 %6, %0
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%10 = load i32, i32* %2
br label %11
11: ; preds = %8, %4
%12 = phi i32 [ %10, %8 ], [ %6, %4 ]
%13 = icmp ugt i32 %12, %0
br i1 %13, label %14, label %4
14: ; preds = %11
ret i32 %12
}