#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 */
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main(int argc, char **argv) {
  typedef struct {
    int nummer;
    char naam[20];
    double gewicht, lengte;
  } voorwerp;
  voorwerp object;
  printf("Nummer: ");
  while (!scanf(" %d", &object.nummer)) {
    printf("Ongeldige invoer.\n");
    while (getchar() != '\n')
      ;
    printf("Nummer: ");
  }
  printf("Naam: ");
  scanf(" %s", object.naam);
  printf("Gewicht: ");
  while (!scanf(" %lf", &object.gewicht)) {
    printf("Ongeldige invoer.\n");
    while (getchar() != '\n')
      ;
    printf("Gewicht: ");
  }
  printf("Lengte: ");
  while (!scanf(" %lf", &object.lengte)) {
    printf("Ongeldige invoer.\n");
    while (getchar() != '\n')
      ;
    printf("Lengte: ");
  }
  printf("%s heeft nummer %d, weegt %f en is %f cm.\n", object.naam,
         object.nummer, object.gewicht, object.lengte);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x38(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1050 <scanf@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1179 <main+0x49>
jmp    11b2 <main+0x82>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     119f <main+0x6f>
jmp    1187 <main+0x57>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1154 <main+0x24>
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x38(%rbp),%rsi
add    $0x4,%rsi
lea    0xe58(%rip),%rdi
call   1050 <scanf@plt>
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x38(%rbp),%rsi
add    $0x18,%rsi
lea    0xe44(%rip),%rdi
call   1050 <scanf@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    120b <main+0xdb>
jmp    1244 <main+0x114>
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1231 <main+0x101>
jmp    1219 <main+0xe9>
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e2 <main+0xb2>
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x38(%rbp),%rsi
add    $0x20,%rsi
lea    0xdd4(%rip),%rdi
call   1050 <scanf@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    127b <main+0x14b>
jmp    12b4 <main+0x184>
lea    0xd8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     12a1 <main+0x171>
jmp    1289 <main+0x159>
lea    0xd92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1252 <main+0x122>
lea    -0x38(%rbp),%rsi
add    $0x4,%rsi
mov    -0x38(%rbp),%edx
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xd73(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x30,%rsp
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea7(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1060 <scanf@plt>
test   %eax,%eax
jne    11c4 <main+0x84>
lea    0xee4(%rip),%r14
lea    0xe82(%rip),%r15
lea    0xe84(%rip),%r12
lea    0x8(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
jne    11a0 <main+0x60>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
test   %eax,%eax
je     1190 <main+0x50>
lea    0xe42(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%r14
lea    0xe36(%rip),%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
lea    0xe2b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x20(%rsp),%r15
lea    0xe22(%rip),%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
test   %eax,%eax
jne    1264 <main+0x124>
lea    0xe48(%rip),%r12
lea    0xdfe(%rip),%r13
lea    0xe01(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1030 <puts@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
jne    1240 <main+0x100>
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
test   %eax,%eax
je     1230 <main+0xf0>
lea    0xdbc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x28(%rsp),%r15
lea    0xda4(%rip),%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
test   %eax,%eax
jne    12d4 <main+0x194>
lea    0xdca(%rip),%r12
lea    0xd8f(%rip),%r13
lea    0xd83(%rip),%rbx
nop
mov    %r12,%rdi
call   1030 <puts@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
jne    12b0 <main+0x170>
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
test   %eax,%eax
je     12a0 <main+0x160>
mov    0x8(%rsp),%edx
movsd  0x20(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
lea    0xd45(%rip),%rdi
mov    %r14,%rsi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.voorwerp = type { i32, [20 x i8], double, double }
@.str = [9 x i8] c"Nummer: \00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [19 x i8] c"Ongeldige invoer.\0A\00"
@.str.3 = [7 x i8] c"Naam: \00"
@.str.4 = [4 x i8] c" %s\00"
@.str.5 = [10 x i8] c"Gewicht: \00"
@.str.6 = [5 x i8] c" %lf\00"
@.str.7 = [9 x i8] c"Lengte: \00"
@.str.8 = [43 x i8] c"%s heeft nummer %d, weegt %f en is %f cm.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.voorwerp
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %21, %2
%9 = getelementptr inbounds %struct.voorwerp, %struct.voorwerp* %6, i32 0, i32 0
%10 = bitcast i32* %9 to double*
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br i1 %13, label %14, label %23
14: ; preds = %8
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %20, %14
%17 = call signext i8 (...) @getchar()
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 10
br i1 %19, label %20, label %21
20: ; preds = %16
br label %16
21: ; preds = %16
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %8
23: ; preds = %8
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%25 = getelementptr inbounds %struct.voorwerp, %struct.voorwerp* %6, i32 0, i32 1
%26 = getelementptr inbounds [20 x i8], [20 x i8]* %25, i64 0, i64 0
%27 = bitcast i8* %26 to double*
%28 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %27)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %30
30: ; preds = %42, %23
%31 = getelementptr inbounds %struct.voorwerp, %struct.voorwerp* %6, i32 0, i32 2
%32 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), double* %31)
%33 = icmp ne i32 %32, 0
%34 = xor i1 %33, true
br i1 %34, label %35, label %44
35: ; preds = %30
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %37
37: ; preds = %41, %35
%38 = call signext i8 (...) @getchar()
%39 = sext i8 %38 to i32
%40 = icmp ne i32 %39, 10
br i1 %40, label %41, label %42
41: ; preds = %37
br label %37
42: ; preds = %37
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %30
44: ; preds = %30
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
br label %46
46: ; preds = %58, %44
%47 = getelementptr inbounds %struct.voorwerp, %struct.voorwerp* %6, i32 0, i32 3
%48 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), double* %47)
%49 = icmp ne i32 %48, 0
%50 = xor i1 %49, true
br i1 %50, label %51, label %60
51: ; preds = %46
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %53
53: ; preds = %57, %51
%54 = call signext i8 (...) @getchar()
%55 = sext i8 %54 to i32
%56 = icmp ne i32 %55, 10
br i1 %56, label %57, label %58
57: ; preds = %53
br label %53
58: ; preds = %53
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
br label %46
60: ; preds = %46
%61 = getelementptr inbounds %struct.voorwerp, %struct.voorwerp* %6, i32 0, i32 1
%62 = getelementptr inbounds [20 x i8], [20 x i8]* %61, i64 0, i64 0
%63 = getelementptr inbounds %struct.voorwerp, %struct.voorwerp* %6, i32 0, i32 0
%64 = load i32, i32* %63
%65 = getelementptr inbounds %struct.voorwerp, %struct.voorwerp* %6, i32 0, i32 2
%66 = load double, double* %65
%67 = getelementptr inbounds %struct.voorwerp, %struct.voorwerp* %6, i32 0, i32 3
%68 = load double, double* %67
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0), i8* %62, i32 %64, double %66, double %68)
ret i32 0
}

LLVM IR (-O2):
%struct.voorwerp = type { i32, [20 x i8], double, double }
@.str = [9 x i8] c"Nummer: \00"
@.str.1 = [4 x i8] c" %d\00"
@.str.3 = [7 x i8] c"Naam: \00"
@.str.4 = [4 x i8] c" %s\00"
@.str.5 = [10 x i8] c"Gewicht: \00"
@.str.6 = [5 x i8] c" %lf\00"
@.str.7 = [9 x i8] c"Lengte: \00"
@.str.8 = [43 x i8] c"%s heeft nummer %d, weegt %f en is %f cm.\0A\00"
@str.10 = [18 x i8] c"Ongeldige invoer.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.voorwerp
%4 = bitcast %struct.voorwerp* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = bitcast %struct.voorwerp* %3 to double*
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %2, %14
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.10, i64 0, i64 0))
br label %11
11: ; preds = %11, %9
%12 = call signext i8 (...) @getchar()
%13 = icmp eq i8 %12, 10
br i1 %13, label %14, label %11
14: ; preds = %11
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %6)
%17 = icmp eq i32 %16, 0
br i1 %17, label %9, label %18
18: ; preds = %14, %2
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%20 = getelementptr inbounds %struct.voorwerp, %struct.voorwerp* %3, i64 0, i32 1, i64 0
%21 = bitcast i8* %20 to double*
%22 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %21)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%24 = getelementptr inbounds %struct.voorwerp, %struct.voorwerp* %3, i64 0, i32 2
%25 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), double* %24)
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %36
27: ; preds = %18, %32
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.10, i64 0, i64 0))
br label %29
29: ; preds = %29, %27
%30 = call signext i8 (...) @getchar()
%31 = icmp eq i8 %30, 10
br i1 %31, label %32, label %29
32: ; preds = %29
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%34 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), double* %24)
%35 = icmp eq i32 %34, 0
br i1 %35, label %27, label %36
36: ; preds = %32, %18
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%38 = getelementptr inbounds %struct.voorwerp, %struct.voorwerp* %3, i64 0, i32 3
%39 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), double* %38)
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %50
41: ; preds = %36, %46
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.10, i64 0, i64 0))
br label %43
43: ; preds = %43, %41
%44 = call signext i8 (...) @getchar()
%45 = icmp eq i8 %44, 10
br i1 %45, label %46, label %43
46: ; preds = %43
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%48 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), double* %38)
%49 = icmp eq i32 %48, 0
br i1 %49, label %41, label %50
50: ; preds = %46, %36
%51 = getelementptr inbounds %struct.voorwerp, %struct.voorwerp* %3, i64 0, i32 0
%52 = load i32, i32* %51
%53 = load double, double* %24
%54 = load double, double* %38
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0), i8* %20, i32 %52, double %53, double %54)
ret i32 0
}