#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 scanf(char *, ...);
int /*<<< orphan*/ stampaErrori(int);
void inputDatiUnsignedInt(unsigned int *streamOutputPtr) {
  int esitoScanf = 0;
  do {
    esitoScanf = scanf("%u", streamOutputPtr);
    if (esitoScanf == 0) {
      scanf("%*[^%\n]");
      stampaErrori(1);
    }
  } while (esitoScanf == 0);
  return;
}


x86 assembly (clang, -O0):
<inputDatiUnsignedInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <scanf@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    116a <inputDatiUnsignedInt+0x4a>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <scanf@plt>
mov    $0x1,%edi
call   1040 <stampaErrori@plt>
jmp    116f <inputDatiUnsignedInt+0x4f>
cmpl   $0x0,-0xc(%rbp)
je     1133 <inputDatiUnsignedInt+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputDatiUnsignedInt>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <scanf@plt>
test   %eax,%eax
jne    1175 <inputDatiUnsignedInt+0x55>
lea    0xebf(%rip),%r14
lea    0xeb5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <scanf@plt>
mov    $0x1,%edi
call   1040 <stampaErrori@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <scanf@plt>
test   %eax,%eax
je     1150 <inputDatiUnsignedInt+0x30>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
@.str.1 = [8 x i8] c"%*[^%\0A]\00"
define void @inputDatiUnsignedInt(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32*, i32** %2
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @stampaErrori(i32 1)
br label %12
12: ; preds = %9, %4
br label %13
13: ; preds = %12
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 0
br i1 %15, label %4, label %16
16: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
@.str.1 = [8 x i8] c"%*[^%\0A]\00"
define void @inputDatiUnsignedInt(i32* %0) {
%2 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @stampaErrori(i32 1)
%7 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
%8 = icmp eq i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %1
ret void
}