#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 *, int *);
int main() {
  int n;
  printf("Voer een getal in tussen 0 en 100: ");
  while (!scanf("%d", &n) || !(0 < n && n < 100)) {
    printf("Ongeldige invoer\n");
    while (getchar() != '\n')
      ;
    printf("Voer een getal in: ");
  }
  for (int i = 1; i != 11; i++) {
    printf("%*d * %*d = %*d\n", 2, i, 2, n, 3, i * n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     118f <main+0x5f>
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x8(%rbp),%ecx
mov    %al,-0xe(%rbp)
jge    1187 <main+0x57>
cmpl   $0x64,-0x8(%rbp)
setl   %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
xor    $0xff,%al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    119f <main+0x6f>
jmp    11d8 <main+0xa8>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     11c5 <main+0x95>
jmp    11ad <main+0x7d>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114d <main+0x1d>
movl   $0x1,-0xc(%rbp)
cmpl   $0xb,-0xc(%rbp)
je     1223 <main+0xf3>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%r8d
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
lea    0xe4f(%rip),%rdi
mov    $0x2,%ecx
mov    $0x3,%r9d
mov    %ecx,%esi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11df <main+0xaf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec4(%rip),%r14
lea    0x14(%rsp),%r12
lea    0xee0(%rip),%r15
lea    0xeb4(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %r12,%rsi
call   1060 <scanf@plt>
test   %eax,%eax
je     119d <main+0x5d>
mov    0x14(%rsp),%r8d
lea    -0x64(%r8),%eax
cmp    $0xffffff9d,%eax
jae    11c7 <main+0x87>
mov    %r15,%rdi
call   1030 <puts@plt>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
jne    11b0 <main+0x70>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1180 <main+0x40>
mov    %r8d,(%rsp)
lea    0xe69(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x3,%r9d
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%r8d
lea    (%r8,%r8,1),%eax
mov    %eax,(%rsp)
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
mov    $0x2,%ecx
mov    $0x3,%r9d
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%r8d
lea    (%r8,%r8,2),%eax
mov    %eax,(%rsp)
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x2,%ecx
mov    $0x3,%r9d
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%r8d
lea    0x0(,%r8,4),%eax
mov    %eax,(%rsp)
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x4,%edx
mov    $0x2,%ecx
mov    $0x3,%r9d
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%r8d
lea    (%r8,%r8,4),%eax
mov    %eax,(%rsp)
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x5,%edx
mov    $0x2,%ecx
mov    $0x3,%r9d
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%r8d
lea    (%r8,%r8,1),%eax
lea    (%rax,%rax,2),%eax
mov    %eax,(%rsp)
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x6,%edx
mov    $0x2,%ecx
mov    $0x3,%r9d
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%r8d
lea    0x0(,%r8,8),%eax
sub    %r8d,%eax
mov    %eax,(%rsp)
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x7,%edx
mov    $0x2,%ecx
mov    $0x3,%r9d
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%r8d
lea    0x0(,%r8,8),%eax
mov    %eax,(%rsp)
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x8,%edx
mov    $0x2,%ecx
mov    $0x3,%r9d
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%r8d
lea    (%r8,%r8,8),%eax
mov    %eax,(%rsp)
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x9,%edx
mov    $0x2,%ecx
mov    $0x3,%r9d
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%r8d
lea    (%r8,%r8,1),%eax
lea    (%rax,%rax,4),%eax
mov    %eax,(%rsp)
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0xa,%edx
mov    $0x2,%ecx
mov    $0x3,%r9d
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Voer een getal in tussen 0 en 100: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"Ongeldige invoer\0A\00"
@.str.3 = [20 x i8] c"Voer een getal in: \00"
@.str.4 = [17 x i8] c"%*d * %*d = %*d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %26, %0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp slt i32 0, %9
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 100
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
%16 = xor i1 %15, true
br label %17
17: ; preds = %14, %5
%18 = phi i1 [ true, %5 ], [ %16, %14 ]
br i1 %18, label %19, label %28
19: ; preds = %17
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %25, %19
%22 = call signext i8 (...) @getchar()
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 10
br i1 %24, label %25, label %26
25: ; preds = %21
br label %21
26: ; preds = %21
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %5
28: ; preds = %17
store i32 1, i32* %3
br label %29
29: ; preds = %39, %28
%30 = load i32, i32* %3
%31 = icmp ne i32 %30, 11
br i1 %31, label %32, label %42
32: ; preds = %29
%33 = load i32, i32* %3
%34 = load i32, i32* %2
%35 = load i32, i32* %3
%36 = load i32, i32* %2
%37 = mul nsw i32 %35, %36
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 2, i32 %33, i32 2, i32 %34, i32 3, i32 %37)
br label %39
39: ; preds = %32
%40 = load i32, i32* %3
%41 = add nsw i32 %40, 1
store i32 %41, i32* %3
br label %29
42: ; preds = %29
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"Voer een getal in tussen 0 en 100: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [20 x i8] c"Voer een getal in: \00"
@.str.4 = [17 x i8] c"%*d * %*d = %*d\0A\00"
@str = [17 x i8] c"Ongeldige invoer\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %45, %0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %40, label %7
7: ; preds = %4
%8 = load i32, i32* %1
%9 = add i32 %8, -100
%10 = icmp ult i32 %9, -99
br i1 %10, label %40, label %11
11: ; preds = %7
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 2, i32 1, i32 2, i32 %8, i32 3, i32 %8)
%13 = load i32, i32* %1
%14 = shl nsw i32 %13, 1
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 2, i32 2, i32 2, i32 %13, i32 3, i32 %14)
%16 = load i32, i32* %1
%17 = mul nsw i32 %16, 3
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 2, i32 3, i32 2, i32 %16, i32 3, i32 %17)
%19 = load i32, i32* %1
%20 = shl nsw i32 %19, 2
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 2, i32 4, i32 2, i32 %19, i32 3, i32 %20)
%22 = load i32, i32* %1
%23 = mul nsw i32 %22, 5
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 2, i32 5, i32 2, i32 %22, i32 3, i32 %23)
%25 = load i32, i32* %1
%26 = mul nsw i32 %25, 6
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 2, i32 6, i32 2, i32 %25, i32 3, i32 %26)
%28 = load i32, i32* %1
%29 = mul nsw i32 %28, 7
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 2, i32 7, i32 2, i32 %28, i32 3, i32 %29)
%31 = load i32, i32* %1
%32 = shl nsw i32 %31, 3
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 2, i32 8, i32 2, i32 %31, i32 3, i32 %32)
%34 = load i32, i32* %1
%35 = mul nsw i32 %34, 9
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 2, i32 9, i32 2, i32 %34, i32 3, i32 %35)
%37 = load i32, i32* %1
%38 = mul nsw i32 %37, 10
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 2, i32 10, i32 2, i32 %37, i32 3, i32 %38)
ret i32 0
40: ; preds = %4, %7
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %42
42: ; preds = %42, %40
%43 = call signext i8 (...) @getchar()
%44 = icmp eq i8 %43, 10
br i1 %44, label %45, label %42
45: ; preds = %42
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %4
}