#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 /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ str_digit(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int get_e_br(char *e_br) {
  char tmp[9];
  int ok = 0;
  do {
    printf("Evidencioni broj: ");
    scanf("%s", tmp);
    int len = strlen(tmp);
    if (!str_digit(tmp, len)) {
      puts("Evidencioni broj se sastoji od tacno 9 cifara.");
      puts("Upisi ponovo.");
      break;
    } else {
      strcpy(e_br, tmp);
      ok = 1;
    }
  } while (!ok);
  return 1;
}


x86 assembly (clang, -O0):
<get_e_br>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xe86(%rip),%rdi
call   1060 <printf@plt>
lea    -0x11(%rbp),%rsi
lea    0xe89(%rip),%rdi
call   1070 <scanf@plt>
lea    -0x11(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x11(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1080 <str_digit@plt>
cmp    $0x0,%eax
jne    11cd <get_e_br+0x6d>
lea    0xe5f(%rip),%rdi
call   1040 <puts@plt>
lea    0xe82(%rip),%rdi
call   1040 <puts@plt>
jmp    11f7 <get_e_br+0x97>
mov    -0x8(%rbp),%rdi
lea    -0x11(%rbp),%rsi
call   1030 <strcpy@plt>
movl   $0x1,-0x18(%rbp)
jmp    11e6 <get_e_br+0x86>
cmpl   $0x0,-0x18(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1173 <get_e_br+0x13>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_e_br>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%r14
lea    0xe8f(%rip),%rdi
call   1060 <printf@plt>
lea    0xe96(%rip),%rdi
lea    0xf(%rsp),%rbx
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1080 <str_digit@plt>
test   %eax,%eax
je     11af <get_e_br+0x4f>
lea    0xf(%rsp),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
jmp    11c7 <get_e_br+0x67>
lea    0xe60(%rip),%rdi
call   1040 <puts@plt>
lea    0xe83(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Evidencioni broj: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [47 x i8] c"Evidencioni broj se sastoji od tacno 9 cifara.\00"
@.str.3 = [14 x i8] c"Upisi ponovo.\00"
define i32 @get_e_br(i8* %0) {
%2 = alloca i8*
%3 = alloca [9 x i8]
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
br label %6
6: ; preds = %24, %1
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%11 = call i32 @strlen(i8* %10)
store i32 %11, i32* %5
%12 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%13 = load i32, i32* %5
%14 = call i32 @str_digit(i8* %12, i32 %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %6
%17 = call i32 @puts(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %28
19: ; preds = %6
%20 = load i8*, i8** %2
%21 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%22 = call i32 @strcpy(i8* %20, i8* %21)
store i32 1, i32* %4
br label %23
23: ; preds = %19
br label %24
24: ; preds = %23
%25 = load i32, i32* %4
%26 = icmp ne i32 %25, 0
%27 = xor i1 %26, true
br i1 %27, label %6, label %28
28: ; preds = %24, %16
ret i32 1
}

LLVM IR (-O2):
@.str = [19 x i8] c"Evidencioni broj: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [47 x i8] c"Evidencioni broj se sastoji od tacno 9 cifara.\00"
@.str.3 = [14 x i8] c"Upisi ponovo.\00"
define i32 @get_e_br(i8* %0) {
%2 = alloca [9 x i8]
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = call i32 @strlen(i8* %3)
%7 = call i32 @str_digit(i8* %3, i32 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %14
12: ; preds = %1
%13 = call i32 @strcpy(i8* %0, i8* %3)
br label %14
14: ; preds = %9, %12
ret i32 1
}